shodan-python icon indicating copy to clipboard operation
shodan-python copied to clipboard

Adding domain alert missing parity from web app

Open johntmyers opened this issue 5 years ago • 5 comments

When trying to add a domain alert via CLI, the underlying API call fails if there are private IPs if any of the discovered sub-domains resolve to these private IPs.

This is not an issue when using the Monitor web app. One solution would be to remove private IPs from the list of IPs acquired here:

https://github.com/achillean/shodan-python/blob/699eb66fc90fff18001dc6d417a9a4591b970faa/shodan/cli/alert.py#L62

Before making the API call. I'd be happy to do a PR for this, but wanted to pass the idea through the maintainers before putting in the effort.

johntmyers avatar Sep 06 '20 16:09 johntmyers

Yes, Shodan Monitor does what you outlined - filter out private IPs before using this Python library to call the API. It would probably be a good idea to have similar logic directly in this library so the end-user doesn't need to think about it.

achillean avatar Sep 08 '20 00:09 achillean

@johntmyers Are you still interested in submitting a PR for this? If you aren't I would be happy to pick this up!

rmhowe425 avatar Jul 13 '23 02:07 rmhowe425

Yes, it would be nice to have. I think we could just filter out private IPs by parsing them first w/ the ipaddress module.

achillean avatar Jul 13 '23 20:07 achillean

Will plan on working on this tonight unless @johntmyers wants to take it

rmhowe425 avatar Jul 13 '23 20:07 rmhowe425

Wow, forgot about this one. nope @rmhowe425 go for it!

johntmyers avatar Jul 13 '23 21:07 johntmyers