I completed a nmap scan on a large-ish network and now I am trying to organize the data.
The report I have is the result of :
nmap -A -p 0-65535 -iL [filename] -oX [filename]
So what I am trying to do now is to extract the findings for each IP address that I scanned. I found another post here where the solution was to use awk :
awk 'BEGIN {RS="< host ";} /^starttime/ {print RS $0;}' [filename]
This didnt work for me because instead of stopping after the first block it ran right through the report. I realize of course that this is because '< host ' and 'starttime' are found in the output for all the IP addresses in the range.
Is there anyway for me to run through the nmap report and to extract the scan report for each IP address and save it in a separate file? A For loop will be required to do this of course... once the extraction and writing to file of one block is figured out then that can be expanded using the for loop (i think)...
Or does anyone, from experience or sheer inspiration, have a more refined solution/suggestion?
Any help in the matter will be greatly appreciated.