logo

scripts

A bunch of scripts, some to be moved to their own repository git clone https://anongit.hacktivis.me/git/scripts.git/

email-decode.user.js (822B)


  1. // ==UserScript==
  2. // @name CloudFlare email-decode
  3. // @namespace https://hacktivis.me/
  4. // @description decode cloudflare-obfuscated “emails”
  5. // @include http://shodan.io/*
  6. // @version 1.0.1
  7. // @grant none
  8. // ==/UserScript==
  9. function cfDecodeEmail(encodedString)
  10. {
  11. var email = "", r = parseInt(encodedString.substr(0, 2), 16), n, i;
  12. for(n = 2; encodedString.length - n; n += 2)
  13. {
  14. i = parseInt(encodedString.substr(n, 2), 16) ^ r;
  15. email += String.fromCharCode(i);
  16. }
  17. return email;
  18. }
  19. const cf_emails = document.getElementsByClassName("__cf_email__");
  20. var email = "";
  21. for (i = 0; i < cf_emails.length; i++) {
  22. try {
  23. email = cfDecodeEmail(cf_emails[i].getAttribute("data-cfemail"));
  24. cf_emails[i].setAttribute("href", "mailto:"+email);
  25. cf_emails[i].innerText = email;
  26. } catch {}
  27. }