I'm using nmap to scan for SSH enabled servers. This is what nmap outputs from the scan:
SSH disabled server example:
Nmap scan report for 70.0.0.109.rev.sfr.net (109.0.0.70)
Host is up (0.15s latency).
PORT STATE SERVICE
22/tcp closed ssh
SSH Enabled server example:
Nmap scan report for 255.0.0.109.rev.sfr.net (109.0.0.255)
Host is up (0.12s latency).
PORT STATE SERVICE
22/tcp filtered ssh
I want to use grep to export all of the SSH enabled servers into a file. The file will only contain the IP addresses of the SSH enabled servers.
For example:
1.1.1.1
2.2.2.2
3.3.3.3
4.4.4.4
5.5.5.5
I couldn't find the grep command that will do this. I just need to export the SSH enabled IP addresses to a file using grep (or any other Linux command for that matter). Thanks, all help is appreciated. (By the way, I'm reading this nmap scan from a file)