4 ms·
With Shodan you could export a list of IPs that are currently operating a VPN service: https://www.shodan.io/search?query=port%3A500%2C4500+vpn https://www.sho
by achillean 10y ago
With Shodan you could export a list of IPs that are currently operating a VPN service:
https://www.shodan.io/search?query=port%3A500%2C4500+vpn https://www.shodan.io/search?query=port%3A500%2C4500+vpn
Or you could lookup the IP of the user on Shodan and check whether that IP is running a VPN service. Per IP lookups are free on Shodan and it's fairly simple. For example, this is how you'd do it in Python:
def is_vpn(user_ip):
import shodan
api = shodan.Shodan("API key")
host = api.host(user_ip)
for banner in host['data']:
if banner['port'] in [500, 4500]:
return True
return False
Here's an overview of the VPN services that are currently on Shodan:
https://www.shodan.io/report/2aLrR79C https://www.shodan.io/report/2aLrR79C
- AnkhMorporkian 10y agoThis 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'])
- achillean 10y agoI 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.