Книга: Black Hat Python: Python Programming for Hackers and Pentesters
Назад: 3. The Network: Raw Sockets and Sniffing
Дальше: 5. Web Hackery

] but for the purpose of this chapter I will assume you are using your Kali VM that has a fully functioning Scapy installation. If you don’t have Scapy, head on over to to install it.

] a computer vision tool, to attempt to detect images that contain human faces so that we can narrow down images that might be interesting. We can use our previous ARP poisoning script to generate the PCAP files or you could extend the ARP poisoning sniffer to do on-thefly facial detection of images while the target is browsing. Let’s get started by dropping in the code necessary to perform the PCAP analysis. Open pic_carver.py and enter the following code:

with slight modifications by yours truly. Using the OpenCV Python bindings, we can read in the image ➊ and then apply a classifier ➋ that is trained in advance for detecting faces in a front-facing orientation. There are classifiers for profile (sideways) face detection, hands, fruit, and a whole host of other objects that you can try out for yourself. After the detection has been run, it will return rectangle coordinates that correspond to where the face was detected in the image. We then draw an actual green rectangle over that area ➌ and write out the resulting image ➍. Now let’s take this all for a spin inside your Kali VM.

]

[] Check out OpenCV here: .

© RuTLib.com 2015-2018