A bit of a mouthful and not that useful for most, but this is saving me headaches left, right and centre at the moment (and is dead simple).
It's always an issue when testing a network that you can run into the same box multiple times with different addresses, this became all too apparent to me recently when I was testing 4 boxes with over 20 interfaces between them serving up different services. Now when it comes to reporting the customer isn't going to want to know about the same issues on the same ports on the same box multiple times, but manually separating this lot out of Nessus is a nightmare.... sed to the rescue.
Lets assume that you have your Nessus output and have it it some useful parse-able format. (xmlstarlet anyone?)
lets also assume that you have a list of ips that match up to each hostname. First things first, create a ip2host.sed file and fill it with your replace statements, e.g.
Next step is nice and simple, either:
sed -f ip2host.sed << EOF | sort | uniq
and copy and paste your results into the terminal, ending with an EOF or...
sed -f ip2host.sed < fileofservices.txt | sort | uniq
if you've already saved the file. This will take:
and convert it to:
Not a complicated one today, but always a handy one to remember.