Grepable return from Nmap. All are one line but IP is in either 11 or 12 digits. They mostly repeat the IP where port is listed and then where the status is as in the example. I need the fastest method of cleaning this by removing all but the ip and removing the duplicate listing. So basically I only need the ip only and no dups.
Here is an example:
Host: xx.x.xx.xx () Status: Up
Host: xxx.x.xx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.x.xx.xx () Status: Up
Host: xxx.x.xx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.xxx.xxx.xx () Ports: xx/closed/tcp//ftp///
Host: xxx.xxx.xxx.xxx () Status: Up
Host: xxx.xxx.xxx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.xxx.xxx.xxx () Status: Up
Host: xxx.xxx.xxx.xxx () Ports: xx/filtered/tcp//ftp///
My issue is how can I do this? Will it need to be done multiple times to account for ip's with varying number lengths or can it be done in one run and if so then how?
Thanks and you (Americans) all have a great Thanksgiving!
Here is an example:
Host: xx.x.xx.xx () Status: Up
Host: xxx.x.xx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.x.xx.xx () Status: Up
Host: xxx.x.xx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.xxx.xxx.xx () Ports: xx/closed/tcp//ftp///
Host: xxx.xxx.xxx.xxx () Status: Up
Host: xxx.xxx.xxx.xx () Ports: xx/filtered/tcp//ftp///
Host: xxx.xxx.xxx.xxx () Status: Up
Host: xxx.xxx.xxx.xxx () Ports: xx/filtered/tcp//ftp///
My issue is how can I do this? Will it need to be done multiple times to account for ip's with varying number lengths or can it be done in one run and if so then how?
Thanks and you (Americans) all have a great Thanksgiving!