fortra/impacket

Unsupported data type on TDS version >=7.2

Open

#877 建立於 2020年6月9日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Python (12,244 star) (3,421 fork)batch import
enhancementhelp wanted

描述

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.

貢獻者指南

Unsupported data type on TDS version >=7.2 · fortra/impacket#877 | Good First Issue