Skip to content

Commit

Permalink
catch crt.sh json-error, add shodan-url to ip-recon
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Oct 8, 2024
1 parent 505de7f commit 206e389
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dns/domain_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from json import dumps as json_dumps
from argparse import ArgumentParser
from sys import exit as sys_exit
from json import JSONDecodeError

from whois import whois
from httpx import request, ReadTimeout, ConnectTimeout
Expand Down Expand Up @@ -156,7 +157,7 @@ def _process_certificate_search(self):
certs = request(method='get', url=f'https://crt.sh/?q={TARGET}&output=json', timeout=10).json()
break

except (ReadTimeout, ConnectTimeout):
except (ReadTimeout, ConnectTimeout, JSONDecodeError):
tries += 1
if tries >= 4:
print('ERROR: Certificate information could not be downloaded!')
Expand Down
6 changes: 6 additions & 0 deletions ip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/159.69.187.50",
"shodan_url": "https://www.shodan.io/host/159.69.187.50",
"censys_url": "https://search.censys.io/hosts/159.69.187.50",
"ipinfo": {
"ip": "159.69.187.50",
Expand All @@ -66,6 +67,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/49.13.245.112",
"shodan_url": "https://www.shodan.io/host/49.13.245.112",
"censys_url": "https://search.censys.io/hosts/49.13.245.112",
"ipinfo": {
"ip": "49.13.245.112",
Expand All @@ -85,6 +87,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/49.13.245.113",
"shodan_url": "https://www.shodan.io/host/49.13.245.113",
"censys_url": "https://search.censys.io/hosts/49.13.245.113",
"ipinfo": {
"ip": "49.13.245.113",
Expand All @@ -104,6 +107,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/49.13.245.114",
"shodan_url": "https://www.shodan.io/host/49.13.245.114",
"censys_url": "https://search.censys.io/hosts/49.13.245.114",
"ipinfo": {
"ip": "49.13.245.114",
Expand All @@ -123,6 +127,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/49.13.245.115",
"shodan_url": "https://www.shodan.io/host/49.13.245.115",
"censys_url": "https://search.censys.io/hosts/49.13.245.115",
"ipinfo": {
"ip": "49.13.245.115",
Expand All @@ -144,6 +149,7 @@ Example:
"org": "Hetzner Online GmbH"
},
"ipinfo_url_ip": "https://ipinfo.io/2a01:4f8:c010:97b4::1",
"shodan_url": "https://www.shodan.io/host/2a01:4f8:c010:97b4::1",
"censys_url": "https://search.censys.io/hosts/2a01:4f8:c010:97b4::1",
"ipinfo": {
"ip": "2a01:4f8:c010:97b4::1",
Expand Down
1 change: 1 addition & 0 deletions ip/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def _lookup_ip(self, ip: (IPv4Address, IPv6Address), data_oxl_asn: dict):
d = {
'oxl_asn': data_oxl_asn,
'ipinfo_url_ip': f"{IPINFO_URL}/{ip}",
'shodan_url': f'https://www.shodan.io/host/{ip}',
'censys_url': f'https://search.censys.io/hosts/{ip}',
}

Expand Down

0 comments on commit 206e389

Please sign in to comment.