Peter was looking for a way to make nmap’s heartbleed script output grepable. He ended up hacking the script.
I propose a method without modification of the NSE heartbleed script.
Some time ago I recommended to include xml output with your nmap scans.
Script output is included with each port element:
I quickly adapted an old program to produce a Python script to generate a CSV file from XML with one line per host, including only ports with script output (any script, not only ssl-heartbleed).
Like this:
address;vendor;hostname;port;state;service;script;output 10.10.10.10;;heartbleed.local.net;443;open;https;ssl-heartbleed;u'\n VULNERABLE:\n The Heartbleed Bug ...'
nmap-xml-script-output_V0_0_1.zip (https)
MD5: 772B6371C1F5E27E68D9BF14955A02D4
SHA256: C86E42E7FA8EFA42C60062759E69DC8DE7F017D9113CF304D9515ACA59815790