News for hackers. Stuff that matters.
Re:API providing threat analysis of any given IP address by AnkhMorporkian on Sunday August 07, 2016 @03:52PM (#12243357)
This is brilliant. Thank you so much!

Edit: I made a modification for conciseness' sake, and to include SSH in the mix as that can be used as a poor man's VPN.

    def is_vpn(self, ip):
        api = shodan.Shodan(self.config['keys']['shodan'])
        host = api.host(ip)
        return any(banner['port'] in [22, 80, 500, 4500] for banner in host['data'])
Re:API providing threat analysis of any given IP address by achillean on Sunday August 07, 2016 @04:56PM (#12243607)
I realized it only afterwards but you can actually just look at the host['ports'] property which contains a list of ports that were found open. And you might also want to include PPTP on port 1723.