Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7608892
  • 博文数量: 1769
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16352
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1769)

文章存档

2024年(15)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2024-06-19 16:02:31

原文:qq_30934313/article/details/88524143

点击(此处)折叠或打开

  1. class rewriteJsConfusion(object):
  2.     def __init__(self, oo, String):
  3.         self.oo = oo
  4.         self.String = String
  5.         
  6.  
  7.  
  8.     def update_oo_1(self):
  9.         qo = 226
  10.         while True:
  11.             if qo < 2:
  12.                 break
  13.             self.oo[qo] = (-self.oo[qo])&255
  14.             # print(self.oo[qo], qo, "aaa")
  15.             self.oo[qo] = (((self.oo[qo]>>1)|(self.oo[qo]<<7)&255)-19)&255
  16.             qo -= 1
  17.  
  18.  
  19.     def update_oo_2(self):
  20.         qo = 225
  21.         while True:
  22.             if qo < 3 :
  23.                 break
  24.             self.oo[qo] = (self.oo[qo]-self.oo[qo-1])&255
  25.             qo -= 1
  26.  
  27.     def update_oo_3(self):
  28.         qo = 1
  29.         while True:
  30.             if qo > 225:
  31.                 break
  32.             self.oo[qo] = (((((self.oo[qo] + 246) & 255)+231) & 255) << 3) & 255\
  33.                 | (((((self.oo[qo]+246) & 255)+231) & 255) >> 5)
  34.             qo += 1
  35.  
  36.     def get_char(self):
  37.         po = ""
  38.         l = len(self.oo)-1
  39.  
  40.         for qo in range(1, l):
  41.             if qo % 7:
  42.                 po += chr(self.oo[qo]^120)
  43.         print(po)
  44.  
  45.  
  46.     def run(self):
  47.         self.update_oo_1()
  48.         self.update_oo_2()
  49.         self.update_oo_3()
  50.         self.get_char()
  51.  
  52.  
  53.  
  54. if __name__ == "__main__":
  55.     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]
  56.     STR = "OD"
  57.  
  58.     ac = rewriteJsConfusion(OO, String=STR)
  59.     print(ac.run())
从html获取

点击(此处)折叠或打开

  1. def get_args(self, html):
  2.         # 获取js混淆参数、调用函数解析并返回
  3.         print(html)
  4.         info = re.findall(
  5.             "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

点击(此处)折叠或打开

  1. class rewriteJsConfusion(object):
  2.     def __init__(self, arg, oo, qo, mr_1, ml_1, minus_1, p31, p32, ml31, p33, p34, mr31, mod1):



阅读(340) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~