Skip to content

Instantly share code, notes, and snippets.

@jaywon
Last active January 26, 2020 23:17
Show Gist options
  • Save jaywon/5a760f0d6b62001ef2c56a95f9142e13 to your computer and use it in GitHub Desktop.
Save jaywon/5a760f0d6b62001ef2c56a95f9142e13 to your computer and use it in GitHub Desktop.
Hurricane Electric ASN Extraction Snippet
/**
Usage:
1. Browse to https://bgp.he.net/
2. Search for company name ie. Acmecorp
3. On search results page, copy this snippet into Developer Console for an easily copy/paste(able) list of IP ranges w/ new line separators
**/
let links = document.getElementsByTagName('a');
let asnExtractList = "";
for (let i = 0; i < links.length; i++){
if(links[i].href.indexOf('/net/') > 0){
asnExtractList += links[i].innerText + '\n';
}
}
console.log(asnExtractList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment