This commit is contained in:
writer 2024-10-15 10:29:29 +09:00
parent f5a0f7393a
commit e9b6619dcc
10 changed files with 13 additions and 15 deletions

View file

@ -2,7 +2,7 @@
When it comes to the reconnaissance of some target network, the start point is undoubtedly on host discovering. This task might come together with the ability to sniff and parse the packets flying in the network.
A few weeks ago, I talked about [how to use Wireshark](http://https://singularity-sh.vercel.app/wiresharking-for-fun-or-profit.html) for packet sniffing, but what if you don't have Wireshark available to monitor a network traffic?
What if you don't have Wireshark available to monitor a network traffic?
Again, Python comes with several solutions and today I'm going through the steps to build a **UDP Host discovery tool**. First, we are going to see how we deal with [raw sockets](http://en.wikipedia.org/wiki/Raw_socket) to write a simple sniffer, which is able to view and decode network packets. Then we are going to multithread this process within a subnet, which will result in our scanner.
@ -15,7 +15,7 @@ The cool thing about using **UDP datagrams** is that, differently from TCP, they
## Writing a Packet Sniffing
We start with a very simple task: with Python's [socket](http://https://singularity-sh.vercel.app/black-hat-python-networking-the-socket-module.html) library, we will write a very simple packet sniffer.
We start with a very simple task: with Python's socket library, we will write a very simple packet sniffer.
In this sniffer we create a raw socket and then we bind it to the public interface. The interface should be in **promiscuous mode**, which means that every packet that the network card sees are captured, even those that are not destined to the host.