Hi guys, I was running a capture and instead of saving the pcap, I exported it to text, now I can't open it in Wireshark. I tried using text2pcap and importing it back into Wireshark using various options (oct,dec,hex), but it doesn't show properly. I am using windows. asked 08 Nov '11, 15:25 WatchFan |
One Answer:
The conversion is possible only if you used File/Export/File ... menu with "Packet Bytes" checkbox marked. otherwise only few bytes of each packet would present in the text file, which makes them useless of course. The text2pcap utility will only convert raw frames of data, but unfortunately your text file is full of dissected information. And what's more sad, it has reassembled frames (and, possibly some other conversions, like HTTP de-chunking, GZIP de-compression) mixed with the original bytes from the wire. However if you'd manage to strip all this information, leaving only frame data, e.g.
then result would be convertable and openable in wireshark as well any other .pcap reading program. I’m not sure of handful tools to automate that process in Windows, you should try installing Cygwin - GNU awk + sed will do text transformations just fine. May be it is just simplier to install testbed and capture data once more. answered 08 Nov ‘11, 21:09 ShomeaX edited 08 Nov ‘11, 21:11 I will give them a go. Any in Linux that would be better? I could copy the file across if need be. Replicating this on a testbed is a difficult one, as this is to catch an error that occurs every two weeks that makes the SIP phones drop out. (an even we are trying to make sure doesn’t happen again) (08 Nov ‘11, 21:20) WatchFan well, gawk is Linux utility actually, cygwin is just it’s Windows port. basically it’s just a matter of writting the script, you can use your favourite tool, Perl, Python, even Wscript will do just fine. unfortunately, googling around does not show up ready made script, probably because your issue is not very usual, so you’d have to write it on your own or may be throw some bucks @ freelance.com ;) (08 Nov ‘11, 21:51) ShomeaX |
Can you post one or two packets from your text file into your original question or as a new comment? I'd like to see what the output looks like.
Managed to open it with 010 editor. 5gb maxed out most other ones.
Seems to be a size limitation on the number of characters.
No. Time Source Destination Protocol Length Info 1 0.000000 192.168.x.x 192.168.x.x SIP 534 Request: SUBSCRIBE sip:[email protected];transport=udp, in-dialog
Frame 1: 534 bytes on wire (4272 bits), 534 bytes captured (4272 bits) Arrival Time: Nov 4, 2011 22:23:34.993951000 AUS Eastern Daylight Time Epoch Time: 1320405814.993951000 seconds