|
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 |
|
4 | 4 | __author__ = 'L' |
5 | | -__version__ = '5.1.0' |
| 5 | +__version__ = '5.2.0' |
6 | 6 |
|
7 | 7 | import sys |
8 | 8 | import os |
|
49 | 49 | MAXRETRY = 10 |
50 | 50 | READINTERVAL = 300 |
51 | 51 | WRITEINTERVAL = 200 |
| 52 | +PHPSERVER = False |
52 | 53 | PHPTIMEOUT = 0.5 |
53 | 54 |
|
54 | 55 | # Logging |
@@ -459,7 +460,7 @@ def setupRemoteSession(self, target, port): |
459 | 460 |
|
460 | 461 | info = {'CMD': 'CONNECT', 'MARK': self.mark, 'IP': self.target, 'PORT': str(self.port)} |
461 | 462 |
|
462 | | - if '.php' in self.connectURLs[0]: |
| 463 | + if '.php' in self.connectURLs[0] or PHPSERVER: |
463 | 464 | try: |
464 | 465 | rinfo = self.neoreg_request(info, timeout=PHPTIMEOUT) |
465 | 466 | except: |
@@ -612,7 +613,7 @@ def askNeoGeorg(conn, connectURLs, redirectURLs, force_redirect): |
612 | 613 | else: |
613 | 614 | response = conn.get(connectURLs[0], headers=headers, timeout=10) |
614 | 615 | log.debug("[HTTP] Ask NeoGeorg Response => HttpCode: {}".format(response.status_code)) |
615 | | - if '.php' in connectURLs[0]: |
| 616 | + if '.php' in connectURLs[0] or PHPSERVER: |
616 | 617 | if 'Expires' in response.headers: |
617 | 618 | expires = response.headers['Expires'] |
618 | 619 | try: |
@@ -775,6 +776,7 @@ def choice_useragent(): |
775 | 776 | parser.add_argument("-c", "--cookie", metavar="LINE", help="Custom init cookies") |
776 | 777 | parser.add_argument("-x", "--proxy", metavar="LINE", help="Proto://host[:port] Use proxy on given port", default=None) |
777 | 778 | parser.add_argument("-T", "--request-template", metavar="STR/FILE", help="HTTP request template (eg: 'img=data:image/png;base64,NEOREGBODY&save=ok')", type=str) |
| 779 | + parser.add_argument("--php", help="Use php connection method", action='store_true') |
778 | 780 | parser.add_argument("--php-connect-timeout", metavar="S", help="PHP connect timeout (default: {})".format(PHPTIMEOUT), type=float, default=PHPTIMEOUT) |
779 | 781 | parser.add_argument("--local-dns", help="Use local resolution DNS", action='store_true') |
780 | 782 | parser.add_argument("--read-buff", metavar="KB", help="Local read buffer, max data to be sent per POST (default: {}, max: 50)".format(READBUFSIZE), type=int, default=READBUFSIZE) |
@@ -848,7 +850,8 @@ def choice_useragent(): |
848 | 850 | print(separation) |
849 | 851 | print(" Log Level set to [%s]" % LEVELNAME) |
850 | 852 |
|
851 | | - USERAGENT = choice_useragent() |
| 853 | + USERAGENT = choice_useragent() |
| 854 | + PHPSERVER = args.php |
852 | 855 | PHPTIMEOUT = args.php_connect_timeout |
853 | 856 |
|
854 | 857 | urls = args.url |
|
0 commit comments