Skip to content

Instantly share code, notes, and snippets.

@stenius
Created April 27, 2015 18:49
Show Gist options
  • Save stenius/778841b665d99c96557e to your computer and use it in GitHub Desktop.
Save stenius/778841b665d99c96557e to your computer and use it in GitHub Desktop.
outbound port scan of common ports using portquiz.net
import requests
for x in [80, 443, 22, 21, 8080, 25, 4567, 1723, 53, 23, 3389, 110, 135, 143,
5000, 8081, 445, 139, 10000, 1863, 111, 1025, 81, 1026, 8000, 1027, 5060,
1028, 1029, 7676, 389, 1050, 113, 1024, 587, 30005, 20, 4444, 37, 27374,
5678, 56789, 1002, 18067, 30722, 554, 4664, 8594, 29860, 4]:
try:
r = requests.get('http://portquiz.net:%s' % x, timeout=5)
except requests.exceptions.Timeout:
continue
print r.status_code, x
# results for scan for RC Miller Library in Beaumont, TX on Apr 27 2015
# 200 80
# 200 443
# 200 110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment