How sensepost/regeorg works
The Client-Side Component
• The core Python script “reGeorgSocksProxy.py” is used as a SOCKS proxy server.
• It accepts command-line options for setting the listening address and port, a local read buffer size, and (critically) the URL of the tunnel script that is running on the remote host.
• It depends on Python 2.7 and uses the urllib3 module for HTTP connections among other tasks.
The Server-Side Component
• There are multiple “tunnel” files in different languages/formats (e.g., tunnel.ashx, tunnel.aspx, tunnel.jsp, tunnel.php, tunnel.js, tunnel.nosocket.php, tunnel.tomcat.5.jsp).
• These are designed to be uploaded to a target web server—this script acts as a tunnel endpoint that listens for HTTP requests from the reGeorg socks proxy.
• The remote "tunnel" script receives the HTTP/S uplink from the proxy client and forwards the traffic to the internal network as needed.
a. Client (Attacker Machine) – include “reGeorgSocksProxy.py” component.
b. Remote Web Server – this represents where the tunnel script is deployed (any one of the provided tunnel files will be used).
c. (Optionally) External tools (like proxychains) in case the local tool does not support SOCKS natively.
d. Communication Channel – the HTTP(S) communication link between the two components.
Interactions
• That the SOCKS proxy intercepts and directs local TCP/UDP connections into encapsulated HTTP(s) requests.
• Optionally, illustrate feedback from the tunnel script back to the Python script for proper tunnel communication.
Architectural Patterns and Technologies
• That this system uses an HTTP tunnelling pattern where the client proxies traffic over an HTTP channel.
• Decoupling of the client component (running on the attacker’s machine) from the server component (the web-based tunnel script).
• Point out that the design accommodates multiple languages/script formats for the tunnel on the server side, increasing deployment flexibility.
• That the project is built in Python 2.7 and leverages urllib3 for thread-safe HTTP communication.
Additional Advice
• Since this project isn’t a full-scale application with multiple microservices but rather a focused tool with just two main interacting parts, detail each element clearly and relate its role in the tunnelling process.
• Being as detailed as possible is beneficial. Break down both the local proxy’s functionality (handling incoming connection requests and forwarding them through HTTP(s)) and the server-side tunnel’s role in receiving these requests and bridging them back to local network access (e.g., “hacking the planet” as the README humorously puts it).
Happy diagramming!