fortra/impacket

Unsupported data type on TDS version >=7.2

Open

#877 aperta il 9 giu 2020

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Python (3421 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (12.244 star)
Metriche merge PR
 (Merge medio 30g 8h) (10 PR mergiate in 30 g)

Descrizione

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

>>> d = tds.TDS_COLMETADATA(b"\x81\x01\x00\x00\x00\x00\x00\x08\x00\x38\x09\x41\x00\x70\x00\x70\x00\x74\x00\x43\x00\x6f\x00\x6c\x00\x6f\x00\x72\x00")
>>> tds.MSSQL('bla').parseColMetaData(d)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.7/site-packages/impacket/tds.py", line 1439, in parseColMetaData
    raise Exception("Unsupported data type: 0x%x" % colType)
Exception: Unsupported data type: 0x8

Additional context

This Column Metadata bytes was taken from pcap of TDS version 7.2.

As far as I understand, the problem is size of field userType:

  • until TDS version 7.1, userType size is 2 bytes.
  • since TDS version 7.2, userType size is 4 bytes.

The code of the library assume userType size is 2 bytes.

Guida contributor