Skip to content

Commit

Permalink
push v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
L-codes committed Oct 15, 2021
1 parent c3feaac commit f0717a1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG-en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

### v3.7.0:
Client: Added `--cut-left/--cut-right` parameters to adjust the offset of the body according to the special environment (such as Confluence)

### v3.6.0:
Server: aspx/ashx added support for intranet forwarding function (reference -r)

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

### v3.7.0:
Client: 新增 `--cut-left/--cut-right` 参数,可根据特殊环境进行调整body的偏移 (如Confluence)

### v3.6.0:
Server: aspx/ashx 新增支持内网转发功能 (参考 -r)

Expand Down
13 changes: 9 additions & 4 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Version

3.6.0 - [Change Log](CHANGELOG-en.md)
3.7.0 - [Change Log](CHANGELOG-en.md)


## Features
Expand Down Expand Up @@ -130,9 +130,10 @@ $ python neoreg.py generate -h
# Connection server
$ python neoreg.py -h
usage: neoreg.py [-h] -u URI [-r URL] [-t IP:PORT] -k KEY [-l IP] [-p PORT]
[-s] [-H LINE] [-c LINE] [-x LINE] [--local-dns]
[--read-buff KB] [--read-interval MS] [--write-interval MS]
[--max-threads N] [-v]
[-s] [-H LINE] [-c LINE] [-x LINE] [--php-connect-timeout S]
[--local-dns] [--read-buff KB] [--read-interval MS]
[--write-interval MS] [--max-threads N] [--cut-left N]
[--cut-right N] [-v]

Socks server for Neoreg HTTP(s) tunneller. DEBUG MODE: -k
(debug_all|debug_base64|debug_headers_key|debug_headers_values)
Expand All @@ -158,12 +159,16 @@ $ python neoreg.py -h
Custom init cookies
-x LINE, --proxy LINE
Proto://host[:port] Use proxy on given port
--php-connect-timeout S
PHP connect timeout.(default: 0.5)
--local-dns Use local resolution DNS
--read-buff KB Local read buffer, max data to be sent per
POST.(default: 7, max: 50)
--read-interval MS Read data interval in milliseconds.(default: 300)
--write-interval MS Write data interval in milliseconds.(default: 200)
--max-threads N Proxy max threads.(default: 1000)
--cut-left N Truncate the left side of the response body
--cut-right N Truncate the right side of the response body
-v Increase verbosity level (use -vv or more for greater
effect)
```
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Version

3.6.0 - [版本修改日志](CHANGELOG.md)
3.7.0 - [版本修改日志](CHANGELOG.md)



Expand Down Expand Up @@ -132,9 +132,10 @@ $ python neoreg.py generate -h
# 连接服务端
$ python neoreg.py -h
usage: neoreg.py [-h] -u URI [-r URL] [-t IP:PORT] -k KEY [-l IP] [-p PORT]
[-s] [-H LINE] [-c LINE] [-x LINE] [--local-dns]
[--read-buff KB] [--read-interval MS] [--write-interval MS]
[--max-threads N] [-v]
[-s] [-H LINE] [-c LINE] [-x LINE] [--php-connect-timeout S]
[--local-dns] [--read-buff KB] [--read-interval MS]
[--write-interval MS] [--max-threads N] [--cut-left N]
[--cut-right N] [-v]

Socks server for Neoreg HTTP(s) tunneller. DEBUG MODE: -k
(debug_all|debug_base64|debug_headers_key|debug_headers_values)
Expand All @@ -160,12 +161,16 @@ $ python neoreg.py -h
Custom init cookies
-x LINE, --proxy LINE
Proto://host[:port] Use proxy on given port
--php-connect-timeout S
PHP connect timeout.(default: 0.5)
--local-dns Use local resolution DNS
--read-buff KB Local read buffer, max data to be sent per
POST.(default: 7, max: 50)
--read-interval MS Read data interval in milliseconds.(default: 300)
--write-interval MS Write data interval in milliseconds.(default: 200)
--max-threads N Proxy max threads.(default: 1000)
--cut-left N Truncate the left side of the response body
--cut-right N Truncate the right side of the response body
-v Increase verbosity level (use -vv or more for greater
effect)
```
Expand Down
18 changes: 15 additions & 3 deletions neoreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

__author__ = 'L'
__version__ = '3.6.0'
__version__ = '3.7.0'

import sys
import os
Expand Down Expand Up @@ -371,6 +371,10 @@ def reader(self):
status = rep_headers[K["X-STATUS"]]
if status == V["OK"]:
data = response.content
if args.cut_left > 0:
data = data[args.cut_left:]
if args.cut_right > 0:
data = data[:-args.cut_right]
if len(data) == 0:
sleep(READINTERVAL)
continue
Expand Down Expand Up @@ -517,7 +521,13 @@ def askGeorg(conn, connectURLs, redirectURLs):
if redirectURLs and response.status_code >= 400:
log.warning('Using redirection will affect performance when the response code >= 400')

if BASICCHECKSTRING == response.content.strip():
data = response.content
if args.cut_left > 0:
data = data[args.cut_left:]
if args.cut_right > 0:
data = data[:-args.cut_right]

if BASICCHECKSTRING == data.strip():
log.info("Georg says, 'All seems fine'")
return True
else:
Expand All @@ -532,7 +542,7 @@ def askGeorg(conn, connectURLs, redirectURLs):
log.error("Georg is not ready. Error message: %s" % message)
else:
log.warning('Expect Response: {}'.format(BASICCHECKSTRING[0:100]))
log.warning('Real Response: {}'.format(response.content.strip()[0:100]))
log.warning('Real Response: {}'.format(data.strip()[0:100]))
log.error("Georg is not ready, please check URL and KEY. rep: [{}] {}".format(response.status_code, response.reason))
log.error("You can set the `--skip` parameter to ignore errors")
exit()
Expand Down Expand Up @@ -644,6 +654,8 @@ def file_write(filename, data):
parser.add_argument("--read-interval", metavar="MS", help="Read data interval in milliseconds.(default: {})".format(READINTERVAL), type=int, default=READINTERVAL)
parser.add_argument("--write-interval", metavar="MS", help="Write data interval in milliseconds.(default: {})".format(WRITEINTERVAL), type=int, default=WRITEINTERVAL)
parser.add_argument("--max-threads", metavar="N", help="Proxy max threads.(default: 1000)", type=int, default=MAXTHERADS)
parser.add_argument("--cut-left", metavar="N", help="Truncate the left side of the response body", type=int, default=0)
parser.add_argument("--cut-right", metavar="N", help="Truncate the right side of the response body", type=int, default=0)
parser.add_argument("-v", help="Increase verbosity level (use -vv or more for greater effect)", action='count', default=0)
args = parser.parse_args()

Expand Down

0 comments on commit f0717a1

Please sign in to comment.