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

Coding the HTTP reverse shell

In this section, we'll cover the coding part for an HTTP reverse shell. On the client side, we'll be using a very high-level library to send our GET and POST requests. 

The library called Requests, which is available at https://pypi.python.org/pypi/requests/2.7.0#downloads, will make it much easier to do a GET or POST request in only a single line. Requests is a third-party library, so let's start by installing it. All you have to do is navigate through the Command Prompt to the folder that contains its setup file and issue python setup.py install.

To verify that the library has been installed successfully, open the Python interpreter, like we did earlier for  py2exe , and enter import requests. If no exceptions ...

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