Skip to content

Instantly share code, notes, and snippets.

@brianteachman
Created March 7, 2013 18:57
Show Gist options
  • Save brianteachman/5110715 to your computer and use it in GitHub Desktop.
Save brianteachman/5110715 to your computer and use it in GitHub Desktop.
Quick port scan script in python using python-nmap.
# http://xael.org/norman/python/python-nmap
# lets check for common ports using nmap
import nmap
nmScan = nmap.PortScanner()
nmScan.scan('127.0.0.1', '0-1023')
for port in nmScan['127.0.0.1']['tcp']:
thisDict = nmScan['127.0.0.1']['tcp'][port]
print 'Port ' + str(port) + ': ' + thisDict['product'] + ', v' + thisDict['version']
@jeor52y
Copy link

jeor52y commented Oct 3, 2019

Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment