Skip to content

Commit

Permalink
set jsp(x) charset=utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
L-codes committed Nov 3, 2020
1 parent 9bb59fd commit bf0a33a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions neoreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion templates/tunnel.jsp
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion templates/tunnel.jspx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"><jsp:directive.page contentType="text/html"/><jsp:directive.page import="java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.io.*, java.net.*, java.util.*" trimDirectiveWhitespaces="true"/>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"><jsp:directive.page contentType="text/html"/><jsp:directive.page import="java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.io.*, java.net.*, java.util.*" pageEncoding="utf-8" trimDirectiveWhitespaces="true"/>
<jsp:declaration><![CDATA[
private static char[] en = "BASE64 CHARSLIST".toCharArray();
public static String b64en(byte[] data) {
Expand Down

0 comments on commit bf0a33a

Please sign in to comment.