Ask Your Question
0

GUI required? Use on headless Ubuntu Server via SSH?

asked 2022-06-09 21:42:17 +0000

brec gravatar image

My initial use would be determining what, if anything, is coming in to the server on one of its ethernet interfaces from my Mac on the same LAN subnet. There's a router and a switch between the Mac and the server. I'm trying to set up the server as a web proxy for the Mac.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-09 21:57:25 +0000

grahamb gravatar image

Use tshark, the command line client.

edit flag offensive delete link more

Comments

(If I shouldn't turn this into a "newbie's questions" thread beyond the scope of my original question, please let me know.)

What's the most expedient way to access/read the pcapng files that tshark writes?

brec gravatar imagebrec ( 2022-06-09 23:24:19 +0000 )edit

Got it -- tcpdump

brec gravatar imagebrec ( 2022-06-09 23:32:55 +0000 )edit

tcpdump is also useful but doesn't have some of the filtering capabilities that tshark has. Use whatever's appropriate for you.

To examine the captures, transfer them to another host that can run Wireshark.

grahamb gravatar imagegrahamb ( 2022-06-10 05:55:33 +0000 )edit

I meant tcpdump only for examining the tshark pcapng file output, after Ctrl-C-ing out of tshark.

brec gravatar imagebrec ( 2022-06-10 11:07:17 +0000 )edit

tcpdump dissects much less traffic than tshark, but if it meets your needs it's good enough. Arguably you could also use tcpdump to make the captures.

grahamb gravatar imagegrahamb ( 2022-06-10 11:42:28 +0000 )edit

Not sure what you mean by "dissects." To expand my previous: I'm capturing with tshark -w to generate a pcapng file, then using tcpdump -r to open the file with standard output redirected to a text file, which I then view in an editor.

I could, as you suggest, copy tshark's output file to my Mac and use Wireshark there to open/read the file. Would that provide any additional useful info?

brec gravatar imagebrec ( 2022-06-10 11:52:50 +0000 )edit

tcpdump (and tshark and wireshark and dumpcap) can all capture all the traffic, but their filtering capabilities differ.

Similarly, their output capabilities all differ when attempting to display the contents of the captured traffic, generally least output to most is dumpcap (doesn't show packet details) <- tcpdump <- tshark <- wireshark

grahamb gravatar imagegrahamb ( 2022-06-10 13:41:35 +0000 )edit

(Thanks for bearing with me!)

Since tcpdump -> tshark for display capabilities, might it be better to use--

tshark [filtering options] > output.txt
Ctrl-C # interested for now only in 1st few seconds

than what I've done so far:

tshark [filtering options] -w file.pcapng
Ctrl-C
tcpdump -r file.pcapng > output.txt
brec gravatar imagebrec ( 2022-06-10 13:54:06 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-06-09 21:42:17 +0000

Seen: 830 times

Last updated: Jun 09 '22