fortra/impacket

Unsupported data type on TDS version >=7.2

Open

#877 aberto em 9 de jun. de 2020

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Python (3.421 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (12.244 stars)
Métricas de merge de PR
 (Mesclagem média 30d 8h) (10 fundiu PRs em 30d)

Description

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.

Guia do colaborador