-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeobfuscator.py
More file actions
56 lines (43 loc) · 1.1 KB
/
Copy pathdeobfuscator.py
File metadata and controls
56 lines (43 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from __future__ import unicode_literals
import re
_0xce1e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/"
def duf(d,e,f):
g = list(_0xce1e)
h = g[0:e]
i = g[0:f]
d = list(d)[::-1]
j = 0
for c,b in enumerate(d):
if b in h:
j = j + h.index(b)*e**c
k = ""
while j > 0:
k = i[j%f] + k
j = (j - (j%f))//f
return int(k) or 0
def hunter(h,u,n,t,e,r):
r = "";
i = 0
while i < len(h):
j = 0
s = ""
while h[i] is not n[e]:
s = ''.join([s,h[i]])
i = i + 1
while j < len(n):
s = s.replace(n[j],str(j))
j = j + 1
r = ''.join([r,''.join(map(chr, [duf(s,e,10) - t]))])
i = i + 1
return r
code=input("Enter Hunter JS Obfuscated Code : ")
regex = r"\(\"([^)]+)\)"
matches = re.findall(regex, code, re.MULTILINE)[0]
code_list = matches.split(',')
for idx,code in enumerate(code_list):
if code.isdigit():
code_list[idx] = int(code)
else:
code_list[idx] = code.replace('\"','')
result = hunter(*code_list)
print(result)