Locate a service through python nmap


I need to obtain from a certain subnet, for example, the ip's that are running a specific service: Ex: I need to know what the 'telnet' service is running, and he will return the ip that service is running. this through python-nmap, thanks

asked by Rafael Gonzalez 19.05.2016 в 09:07

1 answer



The use of this library is quite simple:

import nmap

info_scanning = nmap.PortScanner()

info_scanning.scan(hosts='', arguments='-n -sP') 
#en arguments se usa la misma sintaxis del programa "nmap"

If you have problems with the python-nmap library, you could install the nmap program and then manage it through python, through the os library. It should be something like:

    import os
    os.system("nmap 10.0.0.*")
answered by 23.05.2016 / 18:04