yassineaboukir / sublert

Sublert is a security and reconnaissance tool which leverages certificate transparency to automatically monitor new subdomains deployed by specific organizations and issued TLS/SSL certificate.
MIT License
988 stars 166 forks source link

Error adding domains? #31

Closed VikzSharma closed 4 years ago

VikzSharma commented 4 years ago

Traceback (most recent call last): File "sublert.py", line 165, in lookup conn = psycopg2.connect("dbname={0} user={1} host={2}".format(DB_NAME, DB_USER, DB_HOST)) File "/usr/local/lib/python3.6/dist-packages/psycopg2/init.py", line 126, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: could not connect to server: Connection timed out Is the server running on host "crt.sh" (91.199.212.48) and accepting TCP/IP connections on port 5432? could not connect to server: Network is unreachable Is the server running on host "crt.sh" (2a0e:ac00:c7:d430::5bc7:d430) and accepting TCP/IP connections on port 5432?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 141, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 83, in create_connection raise err File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 852, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 284, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 150, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f90f73e89b0>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='crt.sh', port=443): Max retries exceeded with url: /?q=%25.datagran.io&output=json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f90f73e89b0>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "sublert.py", line 448, in multithreading(parse_args().threads) File "sublert.py", line 416, in multithreading adding_new_domain(domain_to_monitor) File "sublert.py", line 224, in adding_new_domain response = cert_database().lookup(domain_to_monitor) File "sublert.py", line 184, in lookup req = requests.get(url, headers={'User-Agent': user_agent}, timeout=30, verify=False) #times out after 30 seconds waiting (Mainly for large datasets) File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 508, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='crt.sh', port=443): Max retries exceeded with url: /?q=%25.datagran.io&output=json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f90f73e89b0>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

yassineaboukir commented 4 years ago

Hi,

I tried to reproduce the issue with the same domain you're trying to monitor but it worked just fine. From the stack trace you provided, I guess there was an issue with your internet connection so the tool was unable to connect to the database.

Regards.