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

Traceback error when trying to run mssqlclient.py #1349

Closed samuel-kuhn closed 2 years ago

samuel-kuhn commented 2 years ago

Configuration

impacket version: 0.10.0 Python version: 3.10.4 Target OS: Kali Linux

Debug Output With Command String

I downloaded impacket with the git clone command: git clone https://github.com/SecureAuthCorp/impacket.git

Then I installed it with this command: python3 -m pip install .

The installation gave me an error but it also said that it was successfull:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
crackmapexec 5.2.2 requires impacket<0.10.0,>=0.9.23, but you have impacket 0.10.0 which is incompatible.
crackmapexec 5.2.2 requires pylnk3<0.4.0,>=0.3.0, but you have pylnk3 0.4.0 which is incompatible.
Successfully installed impacket-0.10.0

Then I tried to run mssqlclient.py from the examples folder with this command: sudo python3 mssqlclient.py ARCHETYPE/sql_svc@{some-ip} -windows-auth

The Output was the following:

Impacket v0.10.1.dev1+20220606.123812.ac35841f - Copyright 2022 SecureAuth Corporation

Password:

I typed in the password but then it gave me this error:

Traceback (most recent call last): File "/home/samuel/impacket/examples/mssqlclient.py", line 169, in ms_sql.connect() File "/usr/local/lib/python3.10/dist-packages/impacket/tds.py", line 531, in connect af, socktype, proto, canonname, sa = socket.getaddrinfo(self.server, self.port, 0, socket.SOCK_STREAM)[0] File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known

I have no idea what that error means and I've tried installing impacket several times without success.

0xdeaddood commented 2 years ago

Hi @samuel-kuhn!

You have to define the target IP address without {}. Closing...

samuel-kuhn commented 2 years ago

OMG you are right. It worked fine without them.