原文:qq_30934313/article/details/88524143
-
class rewriteJsConfusion(object):
-
def __init__(self, oo, String):
-
self.oo = oo
-
self.String = String
-
-
-
-
def update_oo_1(self):
-
qo = 226
-
while True:
-
if qo < 2:
-
break
-
self.oo[qo] = (-self.oo[qo])&255
-
# print(self.oo[qo], qo, "aaa")
-
self.oo[qo] = (((self.oo[qo]>>1)|(self.oo[qo]<<7)&255)-19)&255
-
qo -= 1
-
-
-
def update_oo_2(self):
-
qo = 225
-
while True:
-
if qo < 3 :
-
break
-
self.oo[qo] = (self.oo[qo]-self.oo[qo-1])&255
-
qo -= 1
-
-
def update_oo_3(self):
-
qo = 1
-
while True:
-
if qo > 225:
-
break
-
self.oo[qo] = (((((self.oo[qo] + 246) & 255)+231) & 255) << 3) & 255\
-
| (((((self.oo[qo]+246) & 255)+231) & 255) >> 5)
-
qo += 1
-
-
def get_char(self):
-
po = ""
-
l = len(self.oo)-1
-
-
for qo in range(1, l):
-
if qo % 7:
-
po += chr(self.oo[qo]^120)
-
print(po)
-
-
-
def run(self):
-
self.update_oo_1()
-
self.update_oo_2()
-
self.update_oo_3()
-
self.get_char()
-
-
-
-
if __name__ == "__main__":
-
OO = [0xe1, 0xa6, 0xd0, 0xc3, 0x3c, 0xb2, 0x25, 0x4b, 0x81, 0x3a, 0x60, 0x53, 0x49, 0x3f, 0xc7, 0xbe, 0x34, 0xa8, 0x11, 0xf6, 0xe8, 0xc9, 0x43, 0xf7, 0xec, 0xa1, 0x16, 0x89, 0x8a, 0xc1, 0x35, 0x6b, 0x60, 0xd4, 0x3d, 0xc1, 0x2a, 0x52, 0x85, 0xee, 0xd6, 0xbd, 0x61, 0x09, 0x7d, 0xa6, 0x10, 0x38, 0xab, 0x77, 0xe2, 0xc9, 0x72, 0x59, 0xcd, 0x36, 0xb9, 0x22, 0x09, 0xfd, 0x72, 0x5a, 0x41, 0x58, 0xbe, 0x71, 0x26, 0x9a, 0xce, 0x33, 0x41, 0xe9, 0x52, 0x3a, 0x2d, 0x93, 0x3d, 0xca, 0xb1, 0x5a, 0x82, 0xe8, 0x8f, 0x44, 0x26, 0x8e, 0x01, 0x76, 0xe9, 0x1d, 0x46, 0x56, 0xbd, 0x25, 0x99, 0x03, 0x69, 0xd2, 0x7d, 0xe5, 0x4e, 0x75, 0x1d, 0x06, 0xed, 0xbd, 0xe6, 0x50, 0xb7, 0xa2, 0x46, 0xba, 0xcf, 0x89, 0x41, 0xb8, 0xef, 0x64, 0x5b, 0x1f, 0x89, 0xb5, 0xee, 0x64, 0x09, 0xae, 0xb9, 0x61, 0x0b, 0x71, 0xdf, 0x53, 0x8c, 0xf2, 0x57, 0xc0, 0x2a, 0xcd, 0x75, 0xe0, 0x87, 0xb2, 0xd9, 0x83, 0xae, 0x16, 0x7d, 0xd4, 0x78, 0x64, 0xd2, 0x81, 0x6c, 0x10, 0xe0, 0x93, 0x89, 0xff, 0x73, 0xea, 0x1f, 0x89, 0xf3, 0x1a, 0x0d, 0x86, 0xf9, 0x20, 0x27, 0x1c, 0x52, 0x3b, 0xe0, 0x98, 0x0c, 0xad, 0x66, 0x1c, 0x86, 0x6c, 0x50, 0x39, 0x13, 0xb8, 0xb0, 0x26, 0x5c, 0x0f, 0x05, 0x1d, 0x15, 0x3b, 0xef, 0xe5, 0xda, 0x51, 0x8c, 0x01, 0x75, 0xab, 0x64, 0x8a, 0x3f, 0xe3, 0xd9, 0xce, 0x42, 0xfa, 0x70, 0x66, 0xd6, 0x0b, 0x75, 0x2a, 0x20, 0x13, 0x8b, 0x5a, 0xd0, 0x43, 0x79, 0x32, 0x58, 0xc8, 0x6b, 0x9c, 0x72, 0x3b]
-
STR = "OD"
-
-
ac = rewriteJsConfusion(OO, String=STR)
-
print(ac.run())
从html获取
-
def get_args(self, html):
-
# 获取js混淆参数、调用函数解析并返回
-
print(html)
-
info = re.findall(
-
"setTimeout\(\"..\((.*?)\)\".*?no=\"\", oo = (.*?);qo = \"qo=(\d{3});.*?oo\[qo\]=\(\(\(oo\[qo\]>>(\d*).*?\(\(oo\[qo\]<<(\d*)\)&0xff\)\)-(\d+)\)&0xff;.*?oo\[qo\] = \(\(\(\(\(\(oo\[qo\] \+ (\d*)\) & 0xff\) \+ (\d*)\) & 0xff\) << (\d*)\) & 0xff\).*?\(\(\(\(\(oo\[qo\] \+ (\d*)\) & 0xff\) \+ (\d*)\) & 0xff\) >> (\d*)\);
把上面函数替换一下,就可以动态破解出正确的JS
-
class rewriteJsConfusion(object):
-
def __init__(self, arg, oo, qo, mr_1, ml_1, minus_1, p31, p32, ml31, p33, p34, mr31, mod1):
阅读(340) | 评论(0) | 转发(0) |