shodan-python
shodan-python copied to clipboard
Keep specific hostname when adding domain-based network alert
If a user runs a command such as:
shodan alert domain www.shodan.io
Then the CLI will create a domain-based network alert for shodan.io
. However, it should create a network alert for just www.shodan.io
which is how the Shodan Monitor website operates.
@achillean Is this issue still something that you would like to be added to the Shodan CLI?
Yes, but we probably need to add something like tldextract
as a dependency to identify whether the user is setting up a specific hostname. The workflow would look something like:
- Parse the domain with
tldextract
- Check if the provided domain has a subdomain
- If it has a subdomain then lookup the IPv4 and IPv6 addresses for the hostname and use that for the list of IPs. If it doesn't have a subdomain then grab the list of IPs from DNSDB; i.e. what we're currently doing.
- Create the new asset group with the list of IPs
Understood! I'll work on this!