|
1 | 1 | #!/usr/bin/env python |
2 | 2 | # coding=utf-8 |
| 3 | + ################ |
| 4 | + # AabyssZG # |
| 5 | +################ |
3 | 6 |
|
4 | | -from inc import output,run,vul,springcheck |
5 | | -import sys |
| 7 | +from inc import output,run,vul,console |
| 8 | +import requests, sys |
| 9 | +from termcolor import cprint |
| 10 | +import requests.packages.urllib3 |
| 11 | +requests.packages.urllib3.disable_warnings() |
6 | 12 |
|
7 | | -# 控制台-参数处理和程序调用 |
8 | | -def SpringBoot_Scan_console(args,proxies): |
9 | | - if args.url: |
10 | | - urlnew = springcheck.check(args.url,proxies) |
11 | | - run.url(urlnew,proxies) |
12 | | - if args.file: |
13 | | - run.file(args.file,proxies) |
14 | | - if args.vul: |
15 | | - urlnew = springcheck.check(args.vul,proxies) |
16 | | - vul.vul(urlnew,proxies) |
17 | | - if args.dump: |
18 | | - urlnew = springcheck.check(args.dump,proxies) |
19 | | - run.dump(urlnew,proxies) |
| 13 | +# 检查代理的使用 |
| 14 | +def SpringBoot_Scan_Proxy(args): |
| 15 | + if args.proxy: |
| 16 | + proxies = { |
| 17 | + "http": "http://%(proxy)s/" % {'proxy': args.proxy}, |
| 18 | + "https": "http://%(proxy)s/" % {'proxy': args.proxy} |
| 19 | + } |
| 20 | + cprint(f"================检测代理可用性中================", "cyan") |
| 21 | + testurl = "https://www.baidu.com/" |
| 22 | + headers = {"User-Agent": "Mozilla/5.0"} # 响应头 |
| 23 | + try: |
| 24 | + requests.packages.urllib3.disable_warnings() |
| 25 | + res = requests.get(testurl, timeout=10, proxies=proxies, verify=False, headers=headers) |
| 26 | + print(res.status_code) |
| 27 | + # 发起请求,返回响应码 |
| 28 | + if res.status_code == 200: |
| 29 | + print("GET www.baidu.com 状态码为:" + str(res.status_code)) |
| 30 | + cprint(f"[+] 代理可用,马上执行!", "cyan") |
| 31 | + except KeyboardInterrupt: |
| 32 | + print("Ctrl + C 手动终止了进程") |
| 33 | + sys.exit() |
| 34 | + except: |
| 35 | + cprint(f"[-] 代理不可用,请更换代理!", "magenta") |
| 36 | + sys.exit() |
| 37 | + else: |
| 38 | + proxies = '' |
| 39 | + |
| 40 | + if (args.url or args.file or args.vul or args.dump or args.zoomeye): |
| 41 | + console.SpringBoot_Scan_console(args, proxies) |
20 | 42 | else: |
21 | 43 | output.usage() |
22 | 44 | sys.exit() |
0 commit comments