Now we’re ready to do more network testing using python scripts. And this time we’ll try to build up a more robust scanner and we’ll also try to detect the open ports and see if there are any vulnerabilities.
Let us write the python script first. And after that we’ll see the output. Let us change the ‘test.py’ script to this:
#!/usr/bin/python
import nmap
nm = nmap.PortScanner()
print (nm.nmap_version())
nm.scan('x.x.xx.xxx', '1-1024', '-v')
print(nm.scaninfo())
print(nm.csv())
Here ‘-v’ stands for version and the ‘1-1024’ stands for the range of the port numbers.
It’s a very ...