First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Excercise for school regarding pcap

Hi,

i need to do an excercise for my school.

The excercise is as followed:

I need to create a pcap file that contains a certain ascii string in either the header or the payload. My wireshark knowledge is very limited so it would be helpful if someone could point me in the right direction.

frankenstein's avatar
3
frankenstein
asked 2018-06-08 16:03:02 +0000
edit flag offensive 0 remove flag close merge delete

Comments

Do you need to include some given ascii strings? Or do you just need to include some ascii strings in general in your pcap?

If the second is answered with yes, than you just need to capture a normal http session for example...

Christian_R's avatar Christian_R (2018-06-09 09:48:31 +0000) edit

Yeah i made it work with HTTP aswell as with nping. I just had a slight misunderstanding but it clicked for me now. Thanks for the answer.

frankenstein's avatar frankenstein (2018-06-09 14:03:44 +0000) edit
add a comment see more comments

2 Answers

0

You can start here finding out how you can do a capture. That's one.

Sending a packet with the defined payload can be done via various means, e.g. using the command line tool ping. By using the option -p you can define the payload in the packet.

Jaap's avatar
13.7k
Jaap
answered 2018-06-08 18:14:28 +0000
edit flag offensive 0 remove flag delete link

Comments

Using netcat is another easy way. Or you could create a file that text2pcap could read and convert to a pcap file. See also some of the Traffic generators listed on the Wireshark Tools wiki page.

cmaynard's avatar cmaynard (2018-06-08 18:58:02 +0000) edit

Thanks so much for the answer.

I should have added that the packet has to use TCP. Since ping uses ICMP its not suited for that or am I missing something?

frankenstein's avatar frankenstein (2018-06-09 01:39:04 +0000) edit

You left out a lot of details, so we're guessing here. But you are right, ping uses ICMP (echo), which is a different protocol than TCP.

Jaap's avatar Jaap (2018-06-09 07:11:38 +0000) edit
add a comment see more comments
0

The -p option for ping to set the packet contents is only valid on Linux and BSD (and possibly others), but not on Windows.

You can include any arbitrary string in a URL in your browser that will transmit it, so simply append it as a value to a URL, e.g. https://ask.wireshark.org/my-arbitrar...

grahamb's avatar
23.8k
grahamb
answered 2018-06-08 18:57:39 +0000
edit flag offensive 0 remove flag delete link

Comments

Thanks so much for the answer. Like I said in the other answer I forgot to mention that the packet has to use TCP. So when I do your tip with the URL it only comes up on HTTP unfortunately.

frankenstein's avatar frankenstein (2018-06-09 01:42:34 +0000) edit

Which is the application protocol, transported by..... TCP. So the TCP packet has a payload, which contains the HTTP message (Protocol Data Unit, or PDU for short) Wireshark tends to dissect as far up as it can, in this case it can see it's HTTP over TCP over IP over Ethernet, so it dissects up to the HTTP layer. Don't want that? Disable the HTTP dissector, it will stop at the TCP payload, where your string is.

Jaap's avatar Jaap (2018-06-09 07:14:33 +0000) edit

Thanks for explaining that to me. That makes things a lot clearer. I managed to do it by downloading nping. It has an option --tcp and an option --data <hex value>. I can then easily capture that with frame contains "MY_ASCII_STRING".

frankenstein's avatar frankenstein (2018-06-09 10:52:09 +0000) edit

I think you got it, awesome. Now try it with a webbrowser in the HTTP request URL.

Jaap's avatar Jaap (2018-06-09 13:24:11 +0000) edit

Done. It works of course, it just confused me that it said protocol HTTP but it makes sense now since the HTTP part is in the TCP Payload. If I search the string value with frame contains "MY_ASCII_STRING" the frame shows up with this method too. I mean it makes total sense because when I filtered for frame contains "MY_ASCII_STRING" && tcp, the frame naturally showed up aswell. Thank you very much for your answers it helped a ton.

frankenstein's avatar frankenstein (2018-06-09 13:57:54 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer