tcpdump capture files analysis - analysis

I generated some communications between client/server and captured the packets using tcpdump. Now I want to analyze those packets to measure latencies and some other information, like any packet lost or acks lost. Is there any way to do this. I was trying to write scripts in perl to analyze it. There is a perl implementation call net::tcpdump. But the documentation is not very detailed. I don't event know how to extract the time stamps.
Any idea would be appreciated.

If you are willing to switch to Python, I have found impacket useful for writing some custom .pcap analysis scripts. The tcptrace tool also has some analysis features not available in Wireshark

Wireshark has some packet statistical tools - and can read the capture files produced by tcpdump.

Related

How to use wireshark dissectors in own application without wireshark at all?

Im using libpcap and want to be able to analyze packets but without wireshark at all. However, I want to use the wireshark dissectors. Has anybody done this and can give me an explanation for the needed steps?
First of all see this answer about the dangers of using epan and linking to libwireshark. You're basically alone trying to make it work, it is not meant to work that way and a new version may break your code. It is always suggested to write a dissector instead since that API is not going to change.
If that did not scare you please read forward.
I have not performed it but i'm more-or-less familiar with the wireshark code tree. I believe that what you're after is the #include <epan/packet.h>, #include <epan/frame_data.h> and #include <epan/tvbuff.h> (Testy Virtual Buffer), these header files are distributed together with wireshark since are needed to write plugin dissectors.
Since one protocol often contains another protocol as the payload wireshark's way to deal with is the tvbuff_t. One dissector returns a tvbuff_t which can then be used by another dissector. You need to perform the entire decoding of the packet, (for example, starting from Ethernet) since wireshark is not there to do it for you.
The code in the epan directory is documented in the doc directory, notably the section 1.7 of doc/README.dissectors (Calling Other Dissectors) has information on how to use tvbuff_t and find_dissector().
It is a very hacky way of doing things, therefore i'll warn again: if you can get away with writing a dissector and use it within wireshark, do it.
I found the following Project on Github:
https://github.com/gnychis/android-wmon
One has to do some modifications in order to get it work, but much much easier than starting from the beginning.

How can one export the wireshark gui commands as a tshark commandline program?

If you repeat the same routines again and again it would be practical to export them as an equivalent tshark commandline program.
Thanks for the clarification on your question.
And then my answer is:
No, there is no way.
tshark is not scriptable / does not have a macro language or such.
What you could do through is pipe its output to a script/program of your own that would to the job, but that's a whole different project.
Very important EDIT:
I was wrong, there is a way of "scripting" wireshark / tshark.
(I've heard of it, but never used it myself, so it did not pop in my head immediately, sorry)
Both wireshark an tshark do have scripting capabilities using the lua language. Not sure this may suit your needs but have a look at:
https://wiki.wireshark.org/Lua
https://wiki.wireshark.org/Lua/Examples
As I understand it, most of the time it's intended to be used as dissector prototyping, but it can go beyond that.
Hope this help.

Wireshark sms Plugin Install

How do I add isi-wireshark-plugin Link Here to the wireshark software. I'm quite new to wireshark and its interface. Also i would like to know on how can i analyse GSM packets which show as SLL in wireshark is there a separate tool to analyse GSM packets. I'm unable to find proper documents maybe i'm using a wrong keyword to search, looking for guidance help much appreciated
Also wireshark platform I have is in windows and Kali Linux

Data transfer from one file to other in Xilinx

I haven't worked with block memories concept in Xilinx before. I want to put some simple numbers in a text file and save it. Then take those numbers and multiply by 2 and save in another file. I have written VHDL code but this is involving I/O so i have to use block RAM. But I have no clue about it. I have read tutorials and datasheet but still can't figure out how to do my task using BRAM. I am pasting my code with this question. Please let me know if we have to do some sort of programming for BRAM. when I am trying to compile the code, it is showing error that inFIle does not exist.
VHDL is not a programming language.
There are some programming-language-like features in VHDL (for example file IO), but these are only there to help write testbench code for simulation. When writing VHDL, don't think about coding software. Think about the hardware structure that you want to describe.
In hardware, there is no such thing as a "file". There is a hardware interface consisting of fixed signals (address, data, enables) to, e.g., a block RAM. You can read a word of data from the memory by specifying an address, but this will always be raw data.
To get the raw data into the block RAM, there will pretty much always be some software process running on an embedded or external CPU. The software running on the CPU can interpret the file system, and pass the relevant information for hardware-assisted processing to the hardware core (e.g., starting address in memory of data to be processed, length of data, parameterization of algorithm, etc.). Alternatively, there may be streaming data sources and sinks that pass through the hardware for processing.
This is what hardware is best at: processing a continuous stream of data and performing the same set of calculations on each data word.

Tool for network traffic analysis of a custom protocol

The protocol is very simple and is developed on top of TCP. I need to analyze a big libpcap dump file to calculate the average value and standard deviation of the conversation time and of the number of packets per conversation.
Using Wireshark it's simple to analyze the TCP conversations between the endpoints, but the summary includes all of the TCP packets (lots of SYNs, ACKs and FINs), and this messes up the data.
Is there another tool to do this kind of analysis? Is there a way to EASILY extend Wireshark's functionality?
You can check out the Argos custom protocol analyzer.
It is a commercial tool and it has a powerful and easy to use XML protocol definition language.
Additionally it can monitor Ethernet and IP traffic as Wireshark does and open Libcap files
Not sure I understand exactly what you need, but if you're looking to analyze only the packets with application data in them you can ask Wireshark to display only those packets with the PSH ("push to application") flag set.
What exactly this protocol contains? Is there any specific header for its own usage? Wireshark provides many complex filtering options that you can explore.
If you want to do it using program, you can try PCAP or PF_SOCK. You may need to write your own filtering criteria then.
Is there another tool to do this kind of analysis? Is there a way to
EASILY extend Wireshark's functionality?
You can try Scapy ( http://www.secdev.org/projects/scapy/ ), with Scapy it is very easy to add new protocols: http://www.secdev.org/projects/scapy/doc/build_dissect.html .
Scapy is not as Wireshark, but I think it will solve your problem.

Resources