Mastering the sendip Command: How to Setup, Execute, and Analyze Network Packets

Step 1: Install sendip tool

Code Language: JavaScriptCopy

sudo apt-get updatesudo apt-get install sendip

Code Language: JavaScriptCopy

man sendip   //You can view the usage of sendip

Step 2: Usage

Set up two virtual machines, execute the sendip command on one, and use the other to capture and analyze packets.

sendip command format: sendip network layer transport layer data domain sendip -v -p *** -is *** -id *** -p *** -f/-d ***** domain

Common command parameters: -v Print out the entire data packet being sent. -p Specify the network protocol to use. -is Source address -id Destination address domain The first hop route -d Data to be carried. Use parameter rN to generate N random bytes. -f Read the data to carry from a file.

“Use the sendip command to send a packet from the command line”

Code Language: JavaScriptCopy

sendip -v  -p ipv4 -is 192.168.163.128 -id 192.168.163.130 -p tcp -f message 192.168.163.130

You can also write a script:

Code Language: JavaScriptCopy

vim send.sh

Edit content:

Code Language: JavaScriptCopy

#!/bin/bashcd /home/lxm/Desktop/send_1(){while truedo        sendip -v  -p ipv4 -is 192.168.163.128 -id 192.168.163.130 -p tcp -f message 192.168.163.130        sleep 0.001done}send_2(){while truedo        sendip -v -p ipv4 -is 192.168.163.128 -id 192.168.163.130  -p udp -f message 192.168.163.130        sleep 0.01done}send_3(){while truedo        sendip -v -p ipv4 -is 192.168.163.128 -id 192.168.163.130 -p icmp -d data01234567 192.168.163.130        sleep 0.1done}send_1 & send_2 & send_3

Create a custom content file

Code Language: JavaScriptCopy

vim message

Execute the script:

Code Language: JavaScriptCopy

./send.sh

Use Wireshark on the receiving end virtual machine to intercept the following data packet:

sendip command >

Disclaimer: The contents of this article are contributed by internet users, and the views only represent the author. This site only provides information storage services and does not own all rights or assume related legal responsibilities. If you find any content violating rights/laws on this site, please send an email to report, and once confirmed, it will be immediately removed.