December 2016
Beginner
197 pages
4h 18m
English
© Sanjib Sinha 2017
Sanjib Sinha, Beginning Ethical Hacking with Python, 10.1007/978-1-4842-2541-7_24
Sanjib Sinha1
(1)Howrah, West Bengal, India
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/pythonimport nmapnm = 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 ...
Read now
Unlock full access