From 3c72f68554ecfe494c922ec81538d9496e44b230 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 27 Jul 2019 13:48:44 +0200 Subject: [PATCH 1/3] add ssl support for TCP_fuzz --- patator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patator.py b/patator.py index 1f3bb66..eab7bba 100755 --- a/patator.py +++ b/patator.py @@ -4787,13 +4787,17 @@ class TCP_fuzz: ('host', 'target host'), ('port', 'target port'), ('timeout', 'seconds to wait for a response [10]'), + ('ssl', 'use SSL/TLS [0|1]'), ) available_actions = () Response = Response_Base - def execute(self, host, port, data='', timeout='2'): + def execute(self, host, port, data='', timeout='2',ssl='0'): fp = socket.create_connection((host, port), int(timeout)) + if ssl!='0': + from ssl import wrap_socket + fp = wrap_socket(fp) fp.send(data.decode('hex')) with Timing() as timing: resp = fp.recv(1024) From 988d21101499e037e9d2ddd5bbfc4fffbd481d12 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 27 Jul 2019 13:52:42 +0200 Subject: [PATCH 2/3] adding port in example command --- patator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patator.py b/patator.py index eab7bba..a3cfc21 100755 --- a/patator.py +++ b/patator.py @@ -4780,7 +4780,7 @@ class TCP_fuzz: '''Fuzz TCP services''' usage_hints = ( - '''%prog host=10.0.0.1 data=RANGE0 0=hex:0x00-0xffffff''', + '''%prog host=10.0.0.1 port=10000 data=RANGE0 0=hex:0x00-0xffffff''', ) available_options = ( From 03fdb3cce08d8cebf6a3ca49f4b2179bdd659ac2 Mon Sep 17 00:00:00 2001 From: lanjelot Date: Sun, 13 Oct 2019 17:12:46 +1000 Subject: [PATCH 3/3] Add ssl option to tcp_fuzz --- patator.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/patator.py b/patator.py index a3cfc21..5f8adc4 100755 --- a/patator.py +++ b/patator.py @@ -899,6 +899,7 @@ import signal import ctypes import glob from xml.sax.saxutils import escape as xmlescape, quoteattr as xmlquoteattr +from ssl import wrap_socket try: # python3+ from queue import Empty, Full @@ -3112,8 +3113,6 @@ class Rlogin_login(TCP_Cache): # }}} # VMauthd {{{ -from ssl import wrap_socket - class LineReceiver_Error(Exception): pass @@ -4793,10 +4792,9 @@ class TCP_fuzz: Response = Response_Base - def execute(self, host, port, data='', timeout='2',ssl='0'): + def execute(self, host, port, data='', timeout='2', ssl='0'): fp = socket.create_connection((host, port), int(timeout)) - if ssl!='0': - from ssl import wrap_socket + if ssl != '0': fp = wrap_socket(fp) fp.send(data.decode('hex')) with Timing() as timing: