Skip to content

elif-deniz-goztok/UDPNetworkCapturer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


UDP Network Capturer

A zero external dependency Windows-based UDP Network Capturer built in C++11 that captures UDP packets from specific source and destination IPs and ports, with a user-friendly GUI for configuration and recording.

With the capability of writing multiple MBs under a second, this project can work with high-speed UDP networks. It is ideal for high traffic network monitoring scenarios.


Features

  • UDP packet capture for up to 4 ports simultaneously.

  • Dual-port listening – when you enter ports (e.g., 5555 and 6666), the application also listens on their immediate next ports (5556 and 6667). This allows capturing paired UDP streams commonly used in network protocols.

  • Graphical user interface (GUI) with 3 scenes:

    1. Configuration Scene – enter source/destination IPs and ports.
    2. Test Scene – test UDP connectivity and port availability before recording.
    3. Recording Scene – capture UDP packets and save them to a chosen folder.
  • Buffered file writing for efficient storage of high-volume UDP traffic.

  • Threaded listeners to record multiple streams concurrently.

  • Automatic Ethernet IP detection for quick destination IP suggestions.

  • Input validation to prevent invalid IPs or ports.


Screenshots

Home screen:

Ekran görüntüsü 2025-08-28 093913 Ekran görüntüsü 2025-08-28 093927

Test results for each port:

Ekran görüntüsü 2025-08-28 094603 Ekran görüntüsü 2025-08-28 094033

While capturing:

Ekran görüntüsü 2025-08-28 094120

Prerequisites

  • Windows 10/11
  • Visual Studio or any C++ compiler supporting C++11
  • Windows SDK
  • Winsock2 library (ws2_32.lib)
  • IP Helper API (iphlpapi.lib)

Build & Run

You can either download the latest release or build from source.

Option 1 — Download Release (Recommended)

Head over to the Releases page and grab the latest prebuilt executable. No setup needed — just download and run!

Option 2 — Build from Source

If you prefer to build it yourself:

1 - Clone the repository git clone https://github.com/your-username/your-repo.git cd your-repo

2 - Create a build directory mkdir build && cd build

3 - Run CMake and build cmake .. cmake --build . --config Release

The compiled executable will be located in:

build/Release/

Run it from there, or move it somewhere more convenient.

Usage

  1. Scene 1 – Configuration:

    • Enter the UDP source IP, destination IP and ports.

      Note: For each port you enter, the application also checks and records traffic on the next sequential port (e.g., entering 5555 will also include 5556).

    • Click Test Connections to validate inputs and check port availability.
  2. Scene 2 – Test:

    • The application performs UDP port tests and displays results.
    • If tests fail, you can either Go Back to correct inputs or Start Capturing Anyway.
  3. Scene 3 – Recording:

    • Choose an output folder for storing captured files.
    • The application starts recording UDP packets in binary format, buffering for efficiency.
    • Click Stop Capturing to end the recording session.

Output Files

  • Files are stored in the selected folder with the naming convention:
<PortName>_YYYY_MM_DD_HH_MM.bin

Example:

Port1_2025_08_27_16_30.bin

Code Structure

  • WinMain – Initializes WinSock, creates the main window, and runs the message loop.
  • WindowProc – Handles GUI events and scene switching.
  • udpListener – Threaded function to capture UDP packets and write to binary files.
  • testUdpCommunication – Tests UDP connectivity and port collisions.
  • findEthernetAddress – Detects the Ethernet IP address of the host machine.
  • ChooseOutputFolder – Opens a folder picker dialog for selecting output location.
  • GUI scenes managed via ShowScene1, ShowScene2, ShowScene3.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/YourFeature.
  3. Commit your changes: git commit -m "Add your feature".
  4. Push to the branch: git push origin feature/YourFeature.
  5. Open a pull request.

License

This project is licensed under the MIT License – see the LICENSE file for details.


About

An application which captures the incoming UDP/IP package traffic to 4 ports of an IPv4 address.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors