Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Example use:
- //obfuscate.unicodeDomain("www.example.com/poc.exe");
- var obfuscate=(function(window,undefined){
- window.unicode={
- "a":["ª","Ⓐ","ⓐ","A","a"],
- "b":["ℬ","Ⓑ","ⓑ","B","b"],
- "c":["ℂ","ℭ","Ⅽ","ⅽ","Ⓒ","ⓒ","C","c","ⅽ"],
- "d":["ⅅ","ⅆ","Ⅾ","ⅾ","Ⓓ","ⓓ","D","d","ⅾ"],
- "e":["ℯ","ℰ","ⅇ","Ⓔ","ⓔ","E","e"],
- "f":["ℱ","Ⓕ","ⓕ","F","f"],
- "g":["ℊ","Ⓖ","ⓖ","G","g"],
- "h":["h","H","ⓗ","Ⓗ","ℍ","ℎ","ℋ","ʰ"],
- "i":["ℑ","ℐ","ℹ","ⅈ","Ⅰ","ⅰ","Ⓘ","ⓘ"],
- "j":["ⓙ","Ⓙ","ⅉ","ʲ","j","J"],
- "k":["k","K","ⓚ","Ⓚ","K"],
- "l":["ℒ","ℓ","Ⅼ","ⅼ","Ⓛ","ⓛ","L","l"],
- "m":["m","M","ⓜ","Ⓜ","ℳ"],
- "n":["n","N","ⓝ","Ⓝ","ⁿ"],
- "o":["o","O","ⓞ","Ⓞ"],
- "p":["p","P","ⓟ","Ⓟ"],
- "q":["q","Q","ⓠ","Ⓠ","ℚ"],
- "r":["r","R","ⓡ","Ⓡ","ℛ","ℜ","ℝ"],
- "s":["s","S","ⓢ","Ⓢ"],
- "t":["t","T","ⓣ","Ⓣ"],
- "u":["u","U","ⓤ","Ⓤ"],
- "v":["v","V","ⓥ","Ⓥ","Ⅴ","ⅴ"],
- "w":["w","W","ⓦ","Ⓦ"],
- "x":["ˣ","Ⅹ","ⅹ","Ⓧ","ⓧ","X","x"],
- "y":["y","Y","ⓨ","Ⓨ"],
- "z":["z","Z","ⓩ","Ⓩ","ℤ","ℨ",],
- "0":["⁰","₀","⓪","0","⁰","₀"],
- "1":["¹","₁","①","1"],
- "2":["²","₂","②","2"],
- "3":["³","₃","③","3"],
- "4":["⁴","₄","④","4"],
- "5":["⁵","₅","⑤","5"],
- "6":["⁶","₆","⑥","6"],
- "7":["⁷","₇","⑦","7"],
- "8":["⁸","⑧","8","₈"],
- "9":["⁹","⑨","9","₉"]
- };
- function random(min,max){
- return Math.floor((Math.random()*max)+min);
- }
- function isUrl(s){
- var regexp = /(?:http|https)?(?:\:\/\/)?(?:www.)?(([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.[A-Za-z]+)(?:\/.*)?/i;
- return regexp.test(s);
- }
- function isIp(ip){
- ip=ip.replace(/http(s)?:\/\//,"");
- if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ip)){
- return (true);
- }
- return (false)
- }
- function unicodeDomain(url){
- if(isUrl(url) || isIp(url)){
- p=(url.match(/http(s)?:\/\//)!=null)?url.match(/http(s)?:\/\//)[0]:"http://";
- url=url.replace(/http(s)?:\/\//,"");
- su=url.split("/");
- domain=su[0];
- path=url.replace(domain,"");
- i=0;
- l=domain.length;
- obfuscated_domain="";
- while(i<l){
- tmp=(typeof window.unicode[domain[i]]!="undefined")?window.unicode[domain[i]]:domain[i];
- if(typeof tmp == "object"){
- r=random(0,tmp.length);
- obfuscated_domain+=tmp[r];
- }else{
- console.log(tmp);
- obfuscated_domain+=tmp;
- }
- i++;
- }
- return p+obfuscated_domain+path;
- }
- else{
- console.log("Nope!");
- }
- }
- return{
- unicodeDomain:unicodeDomain
- }
- })(window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement