Skip to content

Instantly share code, notes, and snippets.

@RKursatV
Last active November 10, 2023 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RKursatV/67068b9be9691b0ac870b4bb93e5f8c7 to your computer and use it in GitHub Desktop.
Save RKursatV/67068b9be9691b0ac870b4bb93e5f8c7 to your computer and use it in GitHub Desktop.
Angell
#!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
def do_GET(self):
logging.info("GET request,\nPath: %s\nHeaders:\n%s\n", str(self.path), str(self.headers))
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write("OK".encode('utf-8'))
def run(server_class=HTTPServer, handler_class=S, port=1337):
logging.basicConfig(level=logging.INFO)
server_address = ('', port)
httpd = server_class(server_address, handler_class)
logging.info('Starting Angel...\n')
try:
httpd.serve_forever()
except KeyboardInterrupt:
pass
httpd.server_close()
logging.info('Stopping Angel...\n')
if __name__ == '__main__':
run()
#!/bin/bash
hostname inek31
iptables -t nat -A OUTPUT -p tcp -d 144.122.71.142 --dport 15214 -j DNAT --to-destination 127.0.0.1:1337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment