This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hello, How can we add/modify ip address of pcap that is generated by text2pcap? which switch/parameter to use ?

asked 10 Sep '13, 22:32

cbhatt's gravatar image

cbhatt
11112
accept rate: 0%


I'm not sure I understand your question correctly, but if you have a text file that you convert to pcap you can just edit the text file before converting it. If you already have the pcap file and want to modify an IP you can use trace editing tools like bittwiste, tcprewrite or TraceWrangler.

"Adding" an IP address is most likely not an option, unless you have a very specific (and realistic) place in the frame for this kind of thing.

permanent link

answered 11 Sep '13, 03:30

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

In other words, the IP addresses that text2pcap puts in (when you use -i) aren't configurable. If you want to specify the IP addresses, don't use -i but rather build a complete packet yourself (so you can specify the IP addresses yourself).

(11 Sep '13, 06:04) JeffMorriss ♦

replace the following bytes in the text2pcap binary with a Hex editor.

45 00 00 00 12 34 00 00 FF 00 00 00 0A 01 01 01 0A 02 02 02 00

Src: 192.168.1.1
Dst: 192.168.2.2

would be:

45 00 00 00 12 34 00 00 FF 00 00 00 C0 A8 01 01 C0 A8 02 02 00

:-))

(11 Sep '13, 09:39) Kurt Knochner ♦

You can prepend a dummy IP header using text2pcap's "-i <proto>" option. See IANA's Protocol Numbers page for the complete list of assigned internet protocol numbers.

(11 Sep '13, 10:20) cmaynard ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×178
×48
×19

question asked: 10 Sep '13, 22:32

question was seen: 2,414 times

last updated: 11 Sep '13, 10:29

p​o​w​e​r​e​d by O​S​Q​A