From 4e4cbe74191a3e143de09b44f7317db1b17416f2 Mon Sep 17 00:00:00 2001 From: L Date: Sun, 18 Apr 2021 16:17:04 +0800 Subject: [PATCH] push v3.0.0 --- CHANGELOG-en.md | 20 ++++++++++++-------- CHANGELOG.md | 6 +++++- README-en.md | 5 +++-- README.md | 7 +++---- neoreg.py | 37 +++++++++++++++++++------------------ 5 files changed, 42 insertions(+), 33 deletions(-) diff --git a/CHANGELOG-en.md b/CHANGELOG-en.md index 2038e69..ac46dc1 100644 --- a/CHANGELOG-en.md +++ b/CHANGELOG-en.md @@ -1,5 +1,9 @@ # Change Log +### v3.0.0: + Client: Client: Only verify php cookies + Server: aspx/ashx/jsp/jspx Use global variables to replace `Session`, and no longer rely on Cookie (Special thanks to @c0ny1 for the solution) + ### v2.6.0 Client: Add the `--write-interval` parameter to adjust the FORWARD request interval Client: Readjust `--read-interval` default value is 300 @@ -46,14 +50,14 @@ Fix `-H` setting bug ### v2.0.0 - Realize single-session multiple TCP sessions, and solve the unavailability caused by only supporting single-session HTTP communication in some environments - Support multiple URL request paths of the same server to avoid excessive single-path access frequency - Support custom server HTTP response code - Modified some commands to GET, which is closer to normal requests - Remove blank lines and remove some features - Support DNS resolution on the server, and use (local DNS resolution with `--local-dns`) to optimize the output of error messages. Modify the directory name scripts / => templates / and neoreg_server / => neoreg_servers / - Support for removing socks 4 - Removable javascript tunnel support + Realize single-session multiple TCP sessions, and solve the unavailability caused by only supporting single-session HTTP communication in some environments + Support multiple URL request paths of the same server to avoid excessive single-path access frequency + Support custom server HTTP response code + Modified some commands to GET, which is closer to normal requests + Remove blank lines and remove some features + Support DNS resolution on the server, and use (local DNS resolution with `--local-dns`) to optimize the output of error messages. Modify the directory name scripts / => templates / and neoreg_server / => neoreg_servers / + Support for removing socks 4 + Removable javascript tunnel support ### v1.5.0 Fix the problem that php>= 7.1 version cannot be used normally diff --git a/CHANGELOG.md b/CHANGELOG.md index f72e258..96dcb9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +### v3.0.0: + Client: 仅对 php 的 Cookie 进行验证 + Server: aspx/ashx/jsp/jspx 使用全局变量替代了 Session, 已不再依赖 Cookie (特别感谢 @c0ny1 的解决方案) + ### v2.6.0 Client: 增加 `--write-interval` 参数,可调整 FORWARD 请求间隔 Client: 重新调整 `--read-interval` 默认值为 300 @@ -55,7 +59,7 @@ 优化了错误信息输出 修改了目录名称 scripts/ => templates/ 和 neoreg_server/ => neoreg_servers/ 移除 socks4 的支持 - 移除 javascript tunnel 支持 + 移除 javascript tunnel 支持 ### v1.5.0 修复 php >= 7.1 版本,无法正常使用的问题 diff --git a/README-en.md b/README-en.md index 4af8690..053b23c 100644 --- a/README-en.md +++ b/README-en.md @@ -13,7 +13,7 @@ ## Version -2.6.0 - [Change Log](CHANGELOG-en.md) +3.0.0 - [Change Log](CHANGELOG-en.md) ## Features @@ -27,7 +27,8 @@ * Server-node DNS resolution * Compatible with python2 / python3 * High compatibility of the server environment -* Refer to [pivotnacci](https://github.com/blackarrowsec/pivotnacci) to implement a single `SESSION` to create multiple TCP connections to deal with some load balancing scenarios +* (only php) Refer to [pivotnacci](https://github.com/blackarrowsec/pivotnacci) to implement a single `SESSION` to create multiple TCP connections to deal with some load balancing scenarios +* aspx/ashx/jsp/jspx no longer relies on Session, and can run normally in harsh environments such as cookie-free * Support HTTP forwarding, coping with load balancing environment diff --git a/README.md b/README.md index bd41b3e..e02fa3f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## Version -2.6.0 - [版本修改日志](CHANGELOG.md) +3.0.0 - [版本修改日志](CHANGELOG.md) @@ -29,7 +29,8 @@ * 服务端 DNS 解析 * 兼容 python2 / python3 * 服务端环境的高兼容性 -* 参考 [pivotnacci](https://github.com/blackarrowsec/pivotnacci) 实现单 Session 创建多 TCP 连接,应对部分负载均衡场景 +* (仅 php) 参考 [pivotnacci](https://github.com/blackarrowsec/pivotnacci) 实现单 Session 创建多 TCP 连接,应对部分负载均衡场景 +* aspx/ashx/jsp/jspx 已不再依赖 Session,可在无 Cookie 等恶劣环境正常运行 * 支持内网转发,应对负载均衡环境 @@ -179,8 +180,6 @@ $ python neoreg.py -h * 传输 Target 隐写 - * 解决无 cookie 支持环境下,reg 无法使用的情况 - ## License diff --git a/neoreg.py b/neoreg.py index c8abe04..4588671 100755 --- a/neoreg.py +++ b/neoreg.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- __author__ = 'L' -__version__ = '2.6.0' +__version__ = '3.0.0' import sys import os @@ -485,23 +485,24 @@ def askGeorg(conn, connectURLs, redirectURLs): need_exit = False try: response = conn.get(connectURLs[0], headers=headers, timeout=10) - if 'Expires' in response.headers: - expires = response.headers['Expires'] - try: - expires_date = datetime.strptime(expires, '%a, %d %b %Y %H:%M:%S %Z') - if mktime(expires_date.timetuple()) < time(): - log.warning('Server Session expired') - if 'Set-Cookie' in response.headers: - cookie = '' - for k, v in response.cookies.items(): - cookie += '{}={};'.format(k, v) - HEADERS.update({'Cookie' : cookie}) - log.warning("Automatically append Cookies: {}".format(cookie)) - else: - log.error('There is no valid cookie return') - need_exit = True - except ValueError: - log.warning('Expires wrong format: {}'.format(expires)) + if '.php' in connectURLs[0]: + if 'Expires' in response.headers: + expires = response.headers['Expires'] + try: + expires_date = datetime.strptime(expires, '%a, %d %b %Y %H:%M:%S %Z') + if mktime(expires_date.timetuple()) < time(): + log.warning('Server Session expired') + if 'Set-Cookie' in response.headers: + cookie = '' + for k, v in response.cookies.items(): + cookie += '{}={};'.format(k, v) + HEADERS.update({'Cookie' : cookie}) + log.warning("Automatically append Cookies: {}".format(cookie)) + else: + log.error('There is no valid cookie return') + need_exit = True + except ValueError: + log.warning('Expires wrong format: {}'.format(expires)) except: log.error("Georg is not ready, please check URL.") exit()