Sharing my github repo for: Black Hat Python (Seitz Book) source code re-edited, updated to Python3 and tested
I converted the code from "Black Hat Python" into Python 3, applied PEP8 and resolved dependency issues. It's available on GitHub.
For those of you trying to learn Python... (Black Hat Python)
Do you recommend ‘Black hat python’ for beginners?
Videos
https://github.com/carloocchiena/blackhat_python_book_code
I quite enjoyed the book, but as 2021 it looks quite outdated, not just for the choice of using Python 2.7.
Deliberately, as expressed by the author, the scripts are written raw & dirty to simulate the approach he uses during a penetration testing.
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
Improvement made from the book's code
Refactoring to Python 3 and code testing (unless otherwise specified)
Update to PEP8 standards
Upgraded readability (es. comments, indentation, variable names, file names)
Update of obsolete methods (es. print -s %)
Better context management (es. open with, server.close())
Disregard of unsupported libs
Minor tweaks and bugs found while testing the code
Search for additional files requested throughout the book and not provided, or provided at outdated links, and included in individual chapters
Additional information and resources that I searched for and found useful as I made my way through the book
If someone's going thru the same journey may find this resource somehow helpful
"Black Hat Python" is a great book, but the fact that it was written in Python 2 is a bit of a problem. Not only that but conflict resolution and plain bug fixing is necessary in practically every chapter.
I left some good amount of information on how to use the repository code right on the README.md file.
It was a lot of work but I think I did most of it. Enjoy.
https://github.com/EONRaider/blackhat-python3
Collaboration is welcome if you happen to find any bugs or dependency issues along the way. Just send a pull request!
EDIT: Thank you so much for all the comments and awards, guys!