This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'] |