socket.gaierror: [Errno -2] Name or service not known [log4j-scanner] - TagMerge

socket.gaierror: [Errno -2] Name or service not known [log4j-scanner]

PeteLRAAsked 4 months ago

Hi,

I get following error if i want to execute the script:

python3 log4j-scan.py -u https://192.168.255.3 [•] CVE-2021-44228 - Apache Log4j RCE Scanner [•] Scanner provided by FullHunt.io - The Next-Gen Attack Surface Management Platform. [•] Secure your External Attack Surface with FullHunt.io. [•] Initiating DNS callback server (interact.sh). Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in newconn conn = connection.createconnection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 61, in createconnection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen httplibresponse = self.make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _makerequest self.validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validateconn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect conn = self.new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='interact.sh', port=443): Max retries exceeded with url: /register (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "log4j-scan.py", line 395, in main() File "log4j-scan.py", line 367, in main dnscallback = Interactsh() File "log4j-scan.py", line 224, in init self.register() File "log4j-scan.py", line 232, in register res = self.session.post( File "/usr/lib/python3/dist-packages/requests/sessions.py", line 581, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **sendkwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='interact.sh', port=443): Max retries exceeded with url: /register (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known'))

Source: link

genericcontributorAnswered 4 months ago

Greetings!

It appears interact.sh was not completing the registration to use their service.

HTTPSConnectionPool(host='interact.sh', port=443): Max retries exceeded with url: /register

I would recommend trying to configure your own Out of band solution like the one on the repo instead. The dns server python script should suffice. The requirement will be a domain you can control. Reference our recommended steps for testing if anything.

Closing this issue.

Recent Issues

    Programming Languages