Code and exercises from the book "Black Hat Python: Python Programming for Hackers and Pentesters", refactored and ported to Python 3
Examples, source code and exercises from the book "Black Hat Python" by Justin Seitz.

About the book
The book is a milestone for pentesting with Python.<br> Although its publication is quite recent (2014), it is all written in Python 2.7.<br>
You can find the book on <a href="https://www.amazon.it/Black-Hat-Python-Programming-Pentesters-ebook/dp/B00QL616DW#customerReviews">Amazon</a>, while the official book page is on <a href="https://nostarch.com/black-hat-python2E#updates">No Starch Press</a> website.<br>
You should be able to download the book's source code from here http://www.nostarch.com/download/BHP-Code.zip, but apparently the link is broken or the file has been deleted (checked October 2021).<br> Please note that I did the whole job straight from book pages with no codes available (and believe me, my nearsightedness did not appreciate XD).<br>
No Starch Press is offering also an Errata Corrige on the book code, but at the moment (November 2021) this section is actually 3 rows long :).
Reason for this repo
I quite enjoyed the book, but as 2021 it looks quite outdated, not just for the choice of using Python 2.7.<br>
Deliberately, as expressed by the author, the scripts are written rought & dirty to simulate the approach he uses during a penetration testing.<br> However, this sometimes leads to code that is not very understandable, and not very efficient.<br>
Since I had to convert all the source codes anyway, to run them on my machine (Kali Linux VM + Win10 OS + Win10 VM + Python 3.9) I decided to go extra-mile and save them in a repo, in the meantime trying to optimize the code and making it a little more elegant (see below).