Question

I wrote nmap command like:

nmap -oX test.xml -p 23 -il list.txt > out.txt

how can I tell nmap to print hosts from my list.txt which are open on port 23?

Was it helpful?

Solution

You can't ask nmap to just print them, but you can grep nmap results:

nmap -p 23 -i list.txt | grep '^23.*open' -B3 | grep '^Nmap scan' | cut -d\( -f2 | cut -d\) -f1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top