- makejail.sh and mountjail.sh scripts added.
These scripts are used to prepare chroot jail for client to be sniffed.
They are prepared with GoogleDesktop in mind. - Added some comments in the code.
- The socksniff script was corrected: The -n option didn't work for server traffic.
Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts
Sunday, October 21, 2007
SockSniffer v.0.2
New version of SockSniffer (v0.2):
Saturday, October 20, 2007
Unix socket sniffer
There are a lot of tools for peeking into communication that is performed using the network sockets:
to just name a few.
But I didn't find any program that could perform this treat for the unix sockets. I found only one comment on some mailing list that someone hacked the Linux kernel to perform this (most probably altered the read syscall) but no code whatsoever.
I didn't want to start hacking the kernel as my only experience with it was compiling it during short time when I run Gentoo on my desktop. Then it occurred to me: Why not use the chroot?
Idea is quite simple. A Server and a client communicate via the unix socket, which is a named socket and is located somewhere in the file system. We run the server in standard way. For the client we create a chroot environment. We run the client in the chroot jail. Our sniffer program connects two sockets: the standard one with the one in chroot jail. While transferring the traffic it can dump it into a log file :-D.
So I wrote an app that performs this: SockSniffer ;-).
In the packet there are four files:
In coming days I will post a guide how to sniff traffic generated by the GoogleDesktop for Linux.
to just name a few.
But I didn't find any program that could perform this treat for the unix sockets. I found only one comment on some mailing list that someone hacked the Linux kernel to perform this (most probably altered the read syscall) but no code whatsoever.
I didn't want to start hacking the kernel as my only experience with it was compiling it during short time when I run Gentoo on my desktop. Then it occurred to me: Why not use the chroot?
Idea is quite simple. A Server and a client communicate via the unix socket, which is a named socket and is located somewhere in the file system. We run the server in standard way. For the client we create a chroot environment. We run the client in the chroot jail. Our sniffer program connects two sockets: the standard one with the one in chroot jail. While transferring the traffic it can dump it into a log file :-D.
So I wrote an app that performs this: SockSniffer ;-).
In the packet there are four files:
- socksniff - the sniffer, it will output the log files into $PWD/dumps directory.
- sockmerge - this program will merge log files in $PWD/dumps directory and output it in libpcap format which is readable for wireshark.
- client.pl and server.pl - client and server scripts to test the sniffer.
In coming days I will post a guide how to sniff traffic generated by the GoogleDesktop for Linux.
Subscribe to:
Posts (Atom)
