Skip to content

Instantly share code, notes, and snippets.

@tcpdump-examples
Last active December 13, 2024 07:41
Show Gist options
  • Save tcpdump-examples/82cc8a9e7a19fa40cb9f1aff97c2a438 to your computer and use it in GitHub Desktop.
Save tcpdump-examples/82cc8a9e7a19fa40cb9f1aff97c2a438 to your computer and use it in GitHub Desktop.

Revisions

  1. tcpdump-examples renamed this gist Dec 13, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. tcpdump-examples revised this gist Dec 9, 2024. 1 changed file with 14 additions and 10 deletions.
    24 changes: 14 additions & 10 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,13 +8,17 @@ To capture all UDP packets, you can use the following command:

    sudo tcpdump udp

    Summary of Useful tcpdump Flags for UDP:
    udp: Capture all UDP traffic.
    -i <interface>: Specify the network interface to listen on.
    port <port_number>: Filter by a specific UDP port.
    host <ip_address>: Capture traffic from/to a specific IP.
    src/dst host <ip_address>: Capture UDP packets from/to a specific source/destination IP.
    -X: Show detailed packet content in hexadecimal and ASCII.
    -w <file_name>: Write captured packets to a file.
    -c <count>: Limit the number of packets captured.
    By using these commands and filters, you can effectively capture and analyze UDP traffic using tcpdump.
    Here's the information converted to Markdown format:

    ### Summary of Useful `tcpdump` Flags for UDP:

    - **`udp`**: Capture all UDP traffic.
    - **`-i <interface>`**: Specify the network interface to listen on.
    - **`port <port_number>`**: Filter by a specific UDP port.
    - **`host <ip_address>`**: Capture traffic from/to a specific IP.
    - **`src/dst host <ip_address>`**: Capture UDP packets from/to a specific source/destination IP.
    - **`-X`**: Show detailed packet content in hexadecimal and ASCII.
    - **`-w <file_name>`**: Write captured packets to a file.
    - **`-c <count>`**: Limit the number of packets captured.

    By using these commands and filters, you can effectively capture and analyze UDP traffic using `tcpdump`.
  3. tcpdump-examples revised this gist Dec 9, 2024. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,3 @@ src/dst host <ip_address>: Capture UDP packets from/to a specific source/destina
    -w <file_name>: Write captured packets to a file.
    -c <count>: Limit the number of packets captured.
    By using these commands and filters, you can effectively capture and analyze UDP traffic using tcpdump.

  4. tcpdump-examples renamed this gist Dec 9, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. tcpdump-examples created this gist Dec 9, 2024.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    https://www.howtouselinux.com/post/tcpdump-udp

    tcpdump is a powerful command-line network packet analyzer used for network troubleshooting and analysis.
    To capture UDP packets using tcpdump, you can use specific filtering options to narrow down the traffic you want to capture.

    Capture all UDP traffic
    To capture all UDP packets, you can use the following command:

    sudo tcpdump udp

    Summary of Useful tcpdump Flags for UDP:
    udp: Capture all UDP traffic.
    -i <interface>: Specify the network interface to listen on.
    port <port_number>: Filter by a specific UDP port.
    host <ip_address>: Capture traffic from/to a specific IP.
    src/dst host <ip_address>: Capture UDP packets from/to a specific source/destination IP.
    -X: Show detailed packet content in hexadecimal and ASCII.
    -w <file_name>: Write captured packets to a file.
    -c <count>: Limit the number of packets captured.
    By using these commands and filters, you can effectively capture and analyze UDP traffic using tcpdump.