fortra / impacket

Impacket is a collection of Python classes for working with network protocols.
https://www.coresecurity.com
Other
13.31k stars 3.54k forks source link

TDS: Unknown Token 0 / ac #879

Open dlemel8 opened 4 years ago

dlemel8 commented 4 years ago

Configuration

impacket version: 0.9.21 Python version: 3.7.7 Target OS: Ubuntu 18.04

Debug Output With Command String

i.e.
smbexec -debug domain/user:password@127.0.0.1

>>> tds.MSSQL('bla').parseReply(b"\xac\x0d\x00\x00\x01\x00\x00\x00\x00\x26\x04\x04\x0c\x00\x00\x00\xfe\x00\x00\xe0\x00\x00\x00\x00\x00")
ERROR:impacket:Unknown Token ac
{}

Additional context

This buffer is a 0xac token type taken from a pcap of TDS version 7.1. I expected token values 0xac (TDS_PARAM_TOKEN) and 0x00 (TVP_END_TOKEN) to be parsed.

asolino commented 4 years ago

Looks like you're referring to RETURNVALUE_TOKEN as described in [MS-TDS]section 2.2.5.8. Doesn't look like it's currently implemented (as described here the token implementation isn't complete). I will leave this open as an enhancement issue if anybody wants to give it a shot.