Is there any way to run command after then nmap is scanned port and got positive result if port is open, for every ip address, like - nmap found ip with particular open port (when scanning eg. 192.168.1.0/24 port 554) and run something immediately, then nmap is contiuning to scan. If the port is closed or else, contiune to scan.
Asked
Active
Viewed 634 times
1 Answers
0
The Nmap Scripting Engine was designed for this purpose. You can write a simple script in Lua that will run for every open port (or easily filter to a specific port number or service name). It doesn't run immediately after discovering an open port, but for very large scans, Nmap will alternate between port scanning and running NSE scripts so that you get results in a fairly steady stream.
If you want to run some external program instead, you can write an NSE script that uses the os.execute
function to call that program when necessary.

bonsaiviking
- 5,825
- 1
- 20
- 35