سؤال

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