Other online diaries:
Fri, 29 Apr 2005
tcpdump into remote ethereal? - 21:32
I think that is a bit of a pain in the arse to do, so I was thinking it would be neat to be able to run ethereal directly on the output coming back over a network link.
My initial thought to try this was to use netcat and output tcpdump over the wire that way. Something like "tcpdump -w - -s 1500 -i ethN not port 22 and not port 3000 | nc otherhost 3000" then on otherhost I could try typing "nc -l -p 3000 | ethereal -r -". So I tried that and ethereal balked at reading from stdin. The next one to try was a fifo, so using "mkfifo etherealdata ; nc -l -p 3000 > etherealdata" and running ethereal and telling it to open that file. However though I have not looked closely it appears ethereal probably tries to mmap files or read them all in at once or similar, thus opening a fifo just wont work.
Looking at the start capture option in ethereal there is currently no way to capture actively on anything but an ethernet device. I am thinking maybe ethereal needs a patch to be able to start and stop captures on some given file handle, ignoring the data on that filehandle at other times, and thus make it easy to capture on stdin or similar.
Of course there may be another solution to this I have not thought about yet. I notice over the last year or so I really have not done much in the way of cool or fun geeky stuff, I think maybe I should do some more fun geeky things again. Maybe this can be a gentle start back into it.