Skip to content

Commit 797024c

Browse files
committed
add --php && release v5.2.0
1 parent 015c557 commit 797024c

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

CHANGELOG-en.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
### v5.2.0:
4+
##### New Features
5+
1. Added `--php` parameter. By default, it is judged based on the URL set by --url whether the .php suffix uses the PHP connection method. In special cases, you can manually use --php to specify the PHP connection method.
6+
37
### v5.1.0:
48
##### New Features
59
1. Add `--request-template` parameter to set request template to avoid traffic detection

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
### v5.2.0:
4+
##### 新特征
5+
1. 新增 `--php` 参数,默认根据 --url 设置的 URL 判断是否 .php 后缀使用 PHP 连接方式,特殊情况下可手工使用 --php 指定为 PHP 的连接方式
6+
37
### v5.1.0:
48
##### 新特征
59
1. 新增 `--request-template` 参数,用于设置请求模板,规避流量检测

README-en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ $ python neoreg.py generate -h
137137
# Connection server
138138
usage: neoreg.py [-h] -u URI [-r URL] [-R] [-t IP:PORT] -k KEY [-l IP]
139139
[-p PORT] [-s] [-H LINE] [-c LINE] [-x LINE]
140-
[--php-connect-timeout S] [--local-dns] [--read-buff KB]
140+
[--php] [--php-connect-timeout S] [--local-dns] [--read-buff KB]
141141
[--read-interval MS] [--write-interval MS] [--max-threads N]
142142
[--max-retry N] [--cut-left N] [--cut-right N]
143143
[--extract EXPR] [-v]
@@ -169,6 +169,7 @@ $ python neoreg.py generate -h
169169
-T STR/FILE, --request-template STR/FILE
170170
HTTP request template (eg:
171171
'img=data:image/png;base64,NEOREGBODY&save=ok')
172+
--php Use php connection method
172173
--php-connect-timeout S
173174
PHP connect timeout (default: 0.5)
174175
--local-dns Use local resolution DNS

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## Version
1616

17-
5.1.0 - [版本修改日志](CHANGELOG.md)
17+
5.2.0 - [版本修改日志](CHANGELOG.md)
1818

1919

2020
## Features
@@ -139,7 +139,7 @@ $ python neoreg.py generate -h
139139
$ python neoreg.py -h
140140
usage: neoreg.py [-h] -u URI [-r URL] [-R] [-t IP:PORT] -k KEY [-l IP]
141141
[-p PORT] [-s] [-H LINE] [-c LINE] [-x LINE]
142-
[--php-connect-timeout S] [--local-dns] [--read-buff KB]
142+
[--php] [--php-connect-timeout S] [--local-dns] [--read-buff KB]
143143
[--read-interval MS] [--write-interval MS] [--max-threads N]
144144
[--max-retry N] [--cut-left N] [--cut-right N]
145145
[--extract EXPR] [-v]
@@ -171,6 +171,7 @@ $ python neoreg.py -h
171171
-T STR/FILE, --request-template STR/FILE
172172
HTTP request template (eg:
173173
'img=data:image/png;base64,NEOREGBODY&save=ok')
174+
--php Use php connection method
174175
--php-connect-timeout S
175176
PHP connect timeout (default: 0.5)
176177
--local-dns Use local resolution DNS

neoreg.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
__author__ = 'L'
5-
__version__ = '5.1.0'
5+
__version__ = '5.2.0'
66

77
import sys
88
import os
@@ -49,6 +49,7 @@
4949
MAXRETRY = 10
5050
READINTERVAL = 300
5151
WRITEINTERVAL = 200
52+
PHPSERVER = False
5253
PHPTIMEOUT = 0.5
5354

5455
# Logging
@@ -459,7 +460,7 @@ def setupRemoteSession(self, target, port):
459460

460461
info = {'CMD': 'CONNECT', 'MARK': self.mark, 'IP': self.target, 'PORT': str(self.port)}
461462

462-
if '.php' in self.connectURLs[0]:
463+
if '.php' in self.connectURLs[0] or PHPSERVER:
463464
try:
464465
rinfo = self.neoreg_request(info, timeout=PHPTIMEOUT)
465466
except:
@@ -612,7 +613,7 @@ def askNeoGeorg(conn, connectURLs, redirectURLs, force_redirect):
612613
else:
613614
response = conn.get(connectURLs[0], headers=headers, timeout=10)
614615
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:
616617
if 'Expires' in response.headers:
617618
expires = response.headers['Expires']
618619
try:
@@ -775,6 +776,7 @@ def choice_useragent():
775776
parser.add_argument("-c", "--cookie", metavar="LINE", help="Custom init cookies")
776777
parser.add_argument("-x", "--proxy", metavar="LINE", help="Proto://host[:port] Use proxy on given port", default=None)
777778
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')
778780
parser.add_argument("--php-connect-timeout", metavar="S", help="PHP connect timeout (default: {})".format(PHPTIMEOUT), type=float, default=PHPTIMEOUT)
779781
parser.add_argument("--local-dns", help="Use local resolution DNS", action='store_true')
780782
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():
848850
print(separation)
849851
print(" Log Level set to [%s]" % LEVELNAME)
850852

851-
USERAGENT = choice_useragent()
853+
USERAGENT = choice_useragent()
854+
PHPSERVER = args.php
852855
PHPTIMEOUT = args.php_connect_timeout
853856

854857
urls = args.url

0 commit comments

Comments
 (0)