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?

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top