Building a packet sniffer using Python 🐍 that extracts visited URLs and user credentials.

Image for post


This is part 2 of Man In The Middle (MITM) attack. If you haven’t read part 1 then I strongly suggest you read that before reading part 2. You can find the link to Part 1 in the next section.


What is a Packet Sniffer?

A packet sniffer is a tool that is used to monitor networks and to diagnose any network problems. It is commonly used by network technicians. Hackers often use this to spy on user’s network traffic and for extracting passwords.

Packet sniffers log network traffic on a network interface that they have access to. It can see every packet that flows to and from an interface.

You’d be wondering that we are designing a packet sniffer but the title says Man In The Middle Attack. This is because in Part 1 we wrote a Python script (ARP Spoofing) that allows us to become a Man In The Middle. The purpose of the packet sniffer is to capture the victim’s (the user which has been attacked using ARP Spoofing) network traffic and extract visited URLs and credentials.

#python #programming #packet-sniffing #cybersecurity #man-in-the-middle-attack

Man In The Middle Attack (MITM) Part 2 

levelup.gitconnected.com

Man In The Middle Attack (MITM) Part 2 

Building a packet sniffer using Python 🐍 that extracts visited URLs and user credentials. Welcome to the first post in this series of blogs on extracting features from images using OpenCV and Python. Feature extraction from images and videos is a common problem in the field of Computer Vision. In this post, we will consider the task of identifying balls and table edges on a pool table. Consider the example image below from an online pool game. ![Image for post](https://miro.medium.com/max/1452/1*qGtvGr1VsNNg7QJyVNsxFA.png) Screenshot from an online game of pool (image source author) Let's say we want to mark the positions of every ball in this image and also the four inner edges of the table. There are multiple ways in which this can be done and some methods work better than others for a given image. However, a useful approach is to try and separate out the contents of an image based on their color composition. For example, in the above image, we can see that the tabletop, the balls and the image background all have different colors. Hence if we can separate out the colors in the image, we would be closer to solving our problem. An easy way to do this is to convert the RBG image into HSV format and then find out the range of H, S and V values corresponding to the object of interest. For details on this step refer to my blog (coming soon) on HSV based extraction. Once we have the HSV color map for the table top, we can use the OpenCV **“inRange()”** function to obtain a visualization of the extracted mask as below.

1.20 GEEK