I am trying to make this script for grep open port IPs from nmap, but I cannot do it right.
I have something like this:
nmap 192.168.0.0/24 -sU -p 44555 | grep -oP "([0-9]{1,3}\.){3}[0-9]{1,3}" >output.txt
But all this IP is open and closed.
Nmap output example:
Nmap scan report for 79-119-0-248.rdsnet.ro (79.119.0.248)
Host is up (0.033s latency).
PORT STATE SERVICE
27023/udp open|filtered unknown
Nmap scan report for 79-119-0-249.rdsnet.ro (79.119.0.249)
Host is up (0.032s latency).
PORT STATE SERVICE
27023/udp closed unknown
Only open / filtered I want Thanks
source
share