Getting started with nmap
ittavern.com
ittavern.com
What does it do?
It can reassemble TCP packets back into the FULL body of the original message sent. e.g. if you make a HTTP GET request, it will show you the full text in a file stamped with the time, source and dest ips and port.
Things I've found it REALLY useful for:
- migrating a data center
- for some reason, connection works fine on the old DC but seems to time out in weird ways in the new DC
- No one can figure it out
- I suggest using tcpflow
- Turn out there was a setting in the new DC network hardware that was truncating larger packets and the authorization message was just over the threshold
People always say "yeah, but Wireshark" which is true, that's a good tool too. That being said, there is just something about seeing the "raw" text of a message sent by a machine over the wire and being able to see it in text from the command line.
I wonder if tcpflow would make this easier, or maybe just different, by effectively pre-slicing the capture into sessions.
By example:
$ tshark -i lo -l -q -Y http -T fields -e frame.time -e _ws.col.Info -e http.file_data
Running as user "root" and group "root". This could be dangerous.
Capturing on 'Loopback: lo'
Dec 19, 2022 04:07:12.419196072 UTC GET / HTTP/1.0
Dec 19, 2022 04:07:12.420560079 UTC HTTP/1.1 200 OK (text/plain) Hello World!\n
Dec 19, 2022 04:07:12.504444583 UTC GET /favicon.ico HTTP/1.0
Dec 19, 2022 04:07:12.505691738 UTC HTTP/1.1 404 Not Found
Because -l (flush every line to stdout) and -q (suppress packet counts) you can pipe the command to grep. $ tshark -i lo -l -q -Y http -T fields -e frame.time -e _ws.col.Info -e http.file_data 2>&1 | grep 404
Dec 19, 2022 04:09:46.361304160 UTC HTTP/1.1 404 Not Found
More examples:https://hackertarget.com/tshark-tutorial-and-filter-examples...
Stuff like this is why I can't take people who argue against systemd because of the Unix philosophy seriously.
The idea of this mythical program which does exactly one thing is just that, mythical. Yeah, modularity is important, but these programs are also made for real people who'd rather just use a command flag than figure out how to chain 50 different programs together in a brittle Rube Goldberg machine to get the result they want. Just look at how many command flags GNU ls has!
The Unix philosophy is a good one, but I'd rather judge program's based on their actual usability.
The unix philosophy is merely an explanation of a preference in building things. It can be ignored by yourself where appropriate, be a minor concern or be considered the key guiding and crucial principle in your decision making.
Whatever you think of systemd its criteria for whether you think it good, bad or indifferent design in principle is likely to be pretty different to emacs.
Rob Pike once said the unix philosophy is dead with Perl reading the Euology. (...and didn't Plan 9 exploit that to world dominance? YMMV)
May everyone enjoy using the systems that they use or at least be getting closer to that ideal.
Nmap doesn’t adhere to the Unix Philosophy, and is bloated as fuck.
Not sure why you wanted to insert your political rhetoric - but consider it a fail?!...
Thanks Fyodor & team!
nmap is one tool to prove things. You will also want wireshark. Also a decent multimeter and a decent network L1/2 tester.
All of its myriad output formats are just "skins" on top of the pretty-printed textual UI output, making nmap very difficult to use as a component of a larger system.
It could be that it’s looking that up from /etc/services. Services defined there are usually in lowercase.