From e19c0fe521cc1819114c9002f32c017a9afdbcf6 Mon Sep 17 00:00:00 2001 From: Richard Ash Date: Fri, 26 Jun 2020 15:20:10 +0100 Subject: [PATCH] Change the option for setting maximum line length Realised that this does not really relate to the underlying MSS of the TCP connection. Change the name of the option to reflect this. Increase the default because it works for me on my test server at 1500. --- nxbender/__init__.py | 2 +- nxbender/sslconn.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nxbender/__init__.py b/nxbender/__init__.py index 9e950fe..12153d6 100644 --- a/nxbender/__init__.py +++ b/nxbender/__init__.py @@ -18,7 +18,7 @@ parser.add_argument('-d', '--domain', required=True) parser.add_argument('-f', '--fingerprint', help='Verify server\'s SSL certificate has this fingerprint. Overrides all other certificate verification.') -parser.add_argument('-m', '--mtu', type=int, default=1280, help='Connection Maximum Transmission Unit (MTU), used to determine size of packets sent to server.') +parser.add_argument('-m', '--max-line', type=int, default=1514, help='Maximum length of a single line of PPP data sent to the server') parser.add_argument('--debug', action='store_true', help='Show debugging information') parser.add_argument('-q', '--quiet', action='store_true', help='Don\'t output basic info whilst running') diff --git a/nxbender/sslconn.py b/nxbender/sslconn.py index d972a06..273cda8 100644 --- a/nxbender/sslconn.py +++ b/nxbender/sslconn.py @@ -56,9 +56,6 @@ def __init__(self, session_id, *args, **kwargs): self.buf = b'' self.wbuf = b'' - # Set the length of lines over the TLS connection to ensure result fits in one packet. - # Overhead is 2 bytes at start, 2 bytes line ending - self.line_length = self.options.mtu - 4 def fileno(self): return self.s.fileno() @@ -111,7 +108,7 @@ def writes_pending(self): def write_pump(self): while len(self.wbuf): - packet = self.wbuf[:self.line_length] + packet = self.wbuf[:self.options.max_line] buf = struct.pack('>L', len(packet)) + packet self.s.sendall(buf) self.wbuf = self.wbuf[len(packet):]