Locate a service through python nmap

2

I need to obtain from a certain subnet, for example 10.0.0.0/24, 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
source

1 answer

1

Rafael!

The use of this library is quite simple:

import nmap

info_scanning = nmap.PortScanner()

info_scanning.scan(hosts='10.0.0.0/24', 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
source