Last active
May 20, 2023 09:55
-
-
Save aBraM-aBraM/c6cc322c019e2a1b79fc48966940be23 to your computer and use it in GitHub Desktop.
Get all host domains from dns dumpster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
host_records_element = getElementByXpath("/html/body/div[1]/div/section/div[1]/div[3]/div/div[7]/table"); | |
maybe_hosts = host_records_element.getElementsByClassName("col-md-4") | |
hosts = Array.prototype.filter.call( | |
maybe_hosts, | |
function(element) { | |
return element.nodeName == "TD"; | |
} | |
); | |
hosts.forEach((element) => { | |
spanElements = element.querySelectorAll('span'); | |
spanElements.forEach((span) => { | |
span.remove(); | |
}); | |
}); | |
hosts_domains = []; | |
hosts.forEach((element) => { | |
hosts_domains.push(element.textContent.replace(/\n/g, '')); | |
}); | |
console.log(hosts_domains.join("\n")); | |
// nmap -iL output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment