GhostNET Python Script no longer working

Hi guys,

I got manjaro and endeavourOS Linux Distros in VirtualBox.
GhostNET script was working fine before in both distros. Now it always throws the same error.

socket.gaierror: [Errno -3] Temporary failure in name resolution

The error clearly shows DNS is not working.

I am trying to figure out why.
To those of you more experienced, why is the DNS not working.
What possible fixes can you recommend?
Should i analyze the script carefully and see if i can conclude what’s wrong?

Parrot OS anonsurf works fine.
Could my ISP be blocking the script from running?
It was working before.

I don’t have a VPN service right now, cos if i did i could test if it’s the ISP blocking it.

After i issue ghostnet start the internet connectivity is cut off.
When i do [anon ~]# ghostnet status
The following error Traceback is thrown.

Traceback (most recent call last):
  File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.10/http/client.py", line 941, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.10/socket.py", line 824, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  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 -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/ghostnet", line 463, in <module>
    check()
  File "/usr/bin/ghostnet", line 446, in check
    main()
  File "/usr/bin/ghostnet", line 460, in main
    DoJob(job)
  File "/usr/bin/ghostnet", line 137, in __init__
    self.status()
  File "/usr/bin/ghostnet", line 178, in status
    DoJob.check_status()
  File "/usr/bin/ghostnet", line 117, in check_status
    getip = urlopen('http://ipinfo.io/ip').read()
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

I think you are right and this is nothing to do with python, its a network issue, why ask here?

I would add code to the script to find out what name is being looked up and use that name to debug your dns/network setup outside of python using tools like dig.

1 Like

My coding knowledge is still very, very limited.
I was looking more or less for what you already said. That it’s not an issue with the python code itself, but a network issue.

It’ just strange this stopped working all of a sudden.

The application is missing error handling. Reasonable application should show a useful error message including the address it has problems to access.

Anyway in the traceback you see an URL it is trying to access:

Can you access it from your web browser? Can you do the same when you disable use of a proxy in your browser / network settings?

1 Like

This URL checks what IP address you are using.
Yes i can access it whether with proxy on or off.

I’m reading the script carefully but if there’s anything else you can chime it’s greatly appreciated.

In the browser you will notice that if you start with

http://ipinfo.io/ip

There is a redirect to

https://ipinfo.io/ip

Maybe the code is not handling the redirect. Better yet should use https:.

1 Like

Yes i changed to “https:” in the script. Same error!
I’ll spend some more time reading the script, but I don’t have the knowledge to fix this.