How to display live capturing packets? - networking

While operating and manipulating Wireshark using cmd I used the command "cd:\....Wireshark" then "Wireshark -D" lastly " Wireshark -i 4 -k " to choose the interface I am using and to immediately start capturing packets but I couldn't display live capturing packet in my cmd from Wireshark tempo while the capturing is still running. It just shows the temporary file path. Does anyone know how to display or ? Note: "What I want is live capturing not file."

Related

capturing raw syslog messages with tcpdump

i am currently collecting logs from a cloud platform which i would like to keep anonymous. while trying to create a custom parser for the syslogs that i am collecting i am trying to capture the raw syslog by using tcpdump.exe for windows. the syntax that i am using to capture the raw syslog messages are: tcpdump.exe -s 0 -A udp port 514
the issue that i am having is that at the beginning of each syslog message it starts with:
..s....#._<133>
and ends with:
E..T..#.#..C#.?O
does anyone know what that means and/or how i can capture the raw syslog messages with tcpdump without the beginning and ending garbage?

executing a batch or script of commands using Putty

Currently I dial in to a site with putty and copy all 100 commands using notepad++ and paste them into putty using right click and they all give me the expected results.
I don't want to have to copy and paste each time I connect.
I am trying to use putty to load a saved session and then execute a series of commands.
can this be done with a serial connection ??
this is as far as I can get
my batch file looks like this
plink -load session1 < commands.cmd > output.txt
for testing my commands.cmd looks like this
ATDT5551212
functionally this is fine for dialing and executing a single line as my output.txt file looks like this
ATDT5551212
CONNECT 1200
so I know I can grab a command from a file and send the output of the session to another file...
if I add another command after the ATDT line then it fails to work properly however my output file shows it sent all the commands
The problem is after dialing and connecting I want to be able to send another set of about 100 commands to get programming data out of a serial device and record it to text.
How can I set this up as a batch to wait for the CONNECT 1200 and then execute another 100 different commands
I tried as Martin suggested to change the EOL
I added STXcommandETX and also separately tried an EOT and ESC and nothing changes its just dumping the entire command file and only executing the first line. the modem gets bombarded with all the other lines or commands, it is attempting to execute the first line and then subsequently trying to give a response meanwhile plink just took the entire commands.cmd and dumps it at the modem and the modem is not expecting the dump.
My guess is that plink can open and send my commands but cant interact with the Serial putty window once it is open.
I am trying another program called ScriptCommunicator but am still testing plink/putty

tshark not able to read icmp6 fields

I am able to read/replay all the headers and fields with tshark until hitting IPv6 header (ethernet header & IPv6 header), but when I am trying to replay the pcap files to read icmpv6 fields, nothing is being displayed of those fields.
Is this a bug of tshark? Is there any alternative tool to read all the fields in all headers of a packet?
The version of tshark I am using is 1.2.11
Bro is a network traffic analysis tool with full IPv6 support, whereas tshark seems to struggle with IPv6. In Bro, you can get connection summaries by running it on a trace as follows:
bro -C -r trace.pcap
and inspect the resulting file conn.log in the same directory. You may find the accompanying tool bro-cut helpful to extract only a subset of the columns, e.g.,
bro-cut id.orig_h id.resp_h id.orig_p id.resp_p proto < conn.log
would extract the connection 5-tuple and print it to STDOUT, so that you can continue processing it with your favorite text munching tool.

How can I "telnet" with the STDIO of another process?

Normally CouchDB communicates with a view server over STDIO via a simple line-based protocol.
What I want to do is, instead of a view server, have it read and write to some sort of pipe or pseudo terminal, to which I then connect, and play the view server.
I think one way to do it is with a lot of complicated use of cat and FIFO's.
But I found out that on my Mac echo "hi" > /dev/ttys000 comes back to my terminal, so I was thinking it should be possible to establish a connection this way, but I can't tell from manpages how to do it for real.
[update] I found write, which sends message from couch to my terminal, but couch is not attached, so I can't send messages in return.
nc -l 12345
And then a regular netcat to connect to it.

TCP flow extraction

I need to extract TCP Flows with their content from dump file and then save their flow into other file each flow separately
You definitely want to use Bro, more specifically, its contents.bro policy. For example, given a trace that contains HTTP requests, running the following ...
bro -r http.trace -f 'tcp and port 80' contents
... produces files
contents.[senderIP].[senderPort]-[destIP].[destPort]
contents.[destIP].[destPort]-[senderIP].[senderPort]
for each connection, each containing the unidirectional content of the flow.
The flow reassembly is highly robust, the process scales to very large files, and everything is customizable to your needs.
If you're only doing a few, Wireshark can do this.
Steps:
Open up the capture in Wireshark.
Click on a packet from the TCP connection you're interested in
Analyze -> Follow TCP Stream
Click 'Raw'
Select (from the popup menu) one of 'Entire Conversation' or one of the two directions.
Click 'Save As'
Alternate steps, for HTTP only:
Open up the capture
Select File -> Export -> Objects -> HTTP
A dialog will open showing all the HTTP objects in the capture. You can save some or all of them.
This is with Wireshark 1.2.1 on Linux/GTK. The 'follow TCP stream' option has been moved around between versions, so it may be somewhere else if you have an older version. But its always been called Follow TCP Stream so you should be able to find it.
Quick searching also reveals several other options if Wireshark doesn't work for you: ngrep, tcpick, chaosreader, and tcpflow.
tcpflow -r my_dump_file.pcap -o output_dir/
It will extract each tcp flow, separately, into a file under output_dir. Each flow in its own file.
Here's the manpage with more options
Wire shark maybe? It can be used to filter sessions and I think you can then save them seperatly.
You could also have a look at NetFlow and related tools.

Resources