Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send pcap file packets on NIC? [duplicate]

I have some network traffic captured pcap file and want to send its packets on NIC; is it possible? Is there any application to do this?

like image 612
salman Avatar asked Dec 23 '09 15:12

salman


People also ask

Can tcpdump send packets?

Tcpdump can dump UDP packets as well. We will use a netcat (nc) tool to send a UDP packet and then dump it. In the above-given command, we send a UDP packet consisting of the string “tcpdumper” to the UDP port 1337 via localhost. Tcpdump captures the packet being sent over UDP port 1337 and will display it.

Can you inject packets with Tcpreplay?

Generally speaking no. When tcpreplay sends packets, it injects them between the TCP/IP stack of the system and the device driver of the network card. The result is the TCP/IP stack system running tcpreplay never sees the packets.

Can I use Wireshark to send packets?

Wireshark is not a packet generator, it captures and decodes packets. Look at other tools like Ostinato or scapy to replay captured packets or generate new packets.

Can we split pcap file?

Pcap-splitter allows you to split a pcap file into subsets of pcap files based on sessions, flows, ip addresses, number of bytes, number of network packets...


2 Answers

You should be able to use some kind of replay application like tcpreplay.

like image 145
Mark Wilkins Avatar answered Sep 17 '22 05:09

Mark Wilkins


bit-twist can do this.

just install it and inject your packet like this :

# bittwist -i eth0 pcap-file.pcap 
like image 27
Zskdan Avatar answered Sep 18 '22 05:09

Zskdan