Skip to content

Commit

Permalink
Merge pull request #211 from nzrb/add-urldefang-refang
Browse files Browse the repository at this point in the history
Add URL Defang and URL Refang scripts
  • Loading branch information
IvanMathy authored Mar 16, 2021
2 parents 8201524 + 54c0717 commit 0253622
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 0253622

Please sign in to comment.