Skip to content

Commit

Permalink
Add URL Defang and URL Refang scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Brown authored and Ross Brown committed Dec 2, 2020
1 parent 5144567 commit 54c0717
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Boop/Boop/scripts/URLDefang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
{
"api":1,
"name":"Defang",
"description":"Defangs dangerous URLs and other IOCs",
"author":"Ross",
"icon":"link",
"tags":"defang,url,ioc"
}
**/

function main(input) {
url = input.text;
url = url.replace(/\./g, "[.]");
url = url.replace(/http/gi, "hXXp");
url = url.replace(/:\/\//g, "[://]");
input.text = url;
}
18 changes: 18 additions & 0 deletions Boop/Boop/scripts/URLRefang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
{
"api":1,
"name":"Refang",
"description":"Removes defanging from dangerous URLs and other IOCs",
"author":"Ross",
"icon":"link",
"tags":"refang,url,ioc"
}
**/

function main(input) {
url = input.text;
url = url.replace(/\[\.\]/g, ".");
url = url.replace(/hXXp/gi, "http");
url = url.replace(/\[:\/\/\]/g, "://");
input.text = url;
}

0 comments on commit 54c0717

Please sign in to comment.