Skip to content

Instantly share code, notes, and snippets.

@ypcrts
Last active October 7, 2019 19:35
Show Gist options
  • Save ypcrts/70caa6b8ebcf1917f007ce2b12595fbd to your computer and use it in GitHub Desktop.
Save ypcrts/70caa6b8ebcf1917f007ce2b12595fbd to your computer and use it in GitHub Desktop.
nessus output miner
(function attack() {
const rows = document.querySelectorAll('.plugin-details-output table tbody tr');
var ret = [];
rows.forEach(row => {
const port = "Port " + row.querySelector('.port span').innerText.match(/\d{1,7}/)[0];
row.querySelectorAll('.hosts a').forEach(host => {
if (!ret[port])
ret[port] = new Set([]);
ret[port].add(host.attributes['data-host-id'].nodeValue);
});
});
var final = "";
for (let i in ret) {
final += (i + ': ' + Array.from(ret[i]).join(', ')) + "\n";
}
console.log(final)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment