Source code for the book "Black Hat Python" by Justin Seitz. The code has been fully converted to Python 3, reformatted to comply with PEP8 standards and refactored to eliminate dependency issues involving the implementation of deprecated libraries.
When I run pic_carver.py the packet[TCP].payload returns a byte object, like b'\r\n' and so on. str(packet[TCP].payload) becomes '\\r\\n' and thus the following if-conditions evaluate to False.
Also, if the pictures and faces directories do not exists the output fails.
I have made some changes so it runs for me, but I'm a junior python coder so there might be some un-pythonic things going on. Please have a look.
When I run pic_carver.py the packet[TCP].payload returns a byte object, like b'\r\n' and so on. str(packet[TCP].payload) becomes '\\r\\n' and thus the following if-conditions evaluate to False.
Also, if the pictures and faces directories do not exists the output fails.
I have made some changes so it runs for me, but I'm a junior python coder so there might be some un-pythonic things going on. Please have a look.
And Thank you for the nice upload. pic_carver.py.gz