From bf0a33a9a8575275780575758767823e11c066ea Mon Sep 17 00:00:00 2001 From: L Date: Tue, 3 Nov 2020 15:41:05 +0800 Subject: [PATCH] set jsp(x) charset=utf-8 --- neoreg.py | 11 ++++++----- templates/tunnel.jsp | 2 +- templates/tunnel.jspx | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/neoreg.py b/neoreg.py index f0db586..21ce8dd 100755 --- a/neoreg.py +++ b/neoreg.py @@ -361,8 +361,10 @@ def reader(self): else: log.error("[READ] [%s:%d] HTTP [%d]: Shutting down" % (self.target, self.port, response.status_code)) break - transferLog.info("[%s:%d] <<<< [%d]" % (self.target, self.port, len(data))) - self.pSocket.send(data) + + if len(data) > 0: + transferLog.info("[%s:%d] <<<< [%d]" % (self.target, self.port, len(data))) + self.pSocket.send(data) except error: # python2 socket.send error pass except Exception as ex: @@ -692,7 +694,6 @@ def file_write(filename, data): log.debug("Incomming connection") session(conn, sock, urls, redirect_urls).start() except KeyboardInterrupt as ex: - print('\r \n[Interrupt] Receive Ctrl+C to exit.') break except Exception as e: log.error(e) @@ -733,10 +734,10 @@ def file_write(filename, data): text = file_read(filepath) if args.file: - http_get_content = file_read(args.file).replace('"', '\\"').replace('\n', '') + http_get_content = file_read(args.file).replace('"', '\\"').replace('\n', '\\n') else: http_get_content = BASICCHECKSTRING.decode() - text = re.sub(r"Georg says, 'All seems fine'", http_get_content, text) + text = text.replace(r"Georg says, 'All seems fine'", http_get_content) text = re.sub(r"BASE64 CHARSLIST", M_BASE64CHARS, text) diff --git a/templates/tunnel.jsp b/templates/tunnel.jsp index 362a0b1..040eb43 100644 --- a/templates/tunnel.jsp +++ b/templates/tunnel.jsp @@ -1,4 +1,4 @@ -<%@page import="java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.io.*, java.net.*, java.util.*" trimDirectiveWhitespaces="true"%> +<%@page import="java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.io.*, java.net.*, java.util.*" pageEncoding="utf-8" trimDirectiveWhitespaces="true"%> <%! private static char[] en = "BASE64 CHARSLIST".toCharArray(); public static String b64en(byte[] data) { diff --git a/templates/tunnel.jspx b/templates/tunnel.jspx index 3f79cdc..04ff5cd 100644 --- a/templates/tunnel.jspx +++ b/templates/tunnel.jspx @@ -1,4 +1,4 @@ - +