EDIT: I have created a script to install everything, except the DD-WRT configuration. Link is at the bottom of the post. I hope somebody will find it useful.
It took me a while to get everything to compile, whew. But it works. I tested it with magic jack connected to a completely different computer on the same subnet.
Requirements:
1. DD-WRT-enabled router
2. Installed Build essentials
[Install with pacman -S kernel26-headers file base-devel abs]
The idea:
The idea is to have orkaudio, the pocket sniffer, record VoIp calls. Since most networks nowadays don't have hubs (if you don't know the difference hub vs switch, google it), it's required to have DD-WRT router to copy the traffic to our sniffer (OpenWRT, Tomato etc. may work, but I haven't tested them)
orkaudio lists the foollowing deps:
* log4cxx 0.9.7 - It is important to use this precise version for now
* ACE 5.4.2
* libpcap 0.7.2 (only needed if you want to do VoIP recording)
* boost 1.31.0
* xerces-c 2.6
* libsndfile 1.0.10
* portaudio v18 (only needed if you want to do sound device recording)
Installation:
=========LIBRARIES=============
--IN REPO---
$this->bbcode_second_pass_code('', 'pacman -Sy libpcap
pacman -Sy boost
pacman -Sy libsndfile')
--NOT IN REPO--
---log4cxx--
$this->bbcode_second_pass_code('', 'cd ~
wget http://archive.apache.org/dist/logging/log4cxx/log4cxx-0.9.7.tar.gz
tar xvzf log4cxx-0.9.7.tar.gz
cd log4cxx-0.9.7
chmod 777 autogen.sh
./autogen.sh
./configure --prefix=/usr')
Use nano to edit the file, or use WinSCP
in file : ~/log4cxx-0.9.7/src/socketoutputstream.cpp
add #include <cstring>
just below all the other include lines (line 20?)
in file: ~/log4cxx-0.9.7/src/stringtokenizer.cpp
add #include <string.h>
at line 18
in file ~/log4cxx-0.9.7/src/timezone.cpp
add #include <string.h>
at line 19
in file ~/log4cxx-0.9.7/src/xmlsocketappender.cpp
add #include <string.h>
at line 25
$this->bbcode_second_pass_code('', 'make
make install')
--ACE--
$this->bbcode_second_pass_code('', 'cd ~
wget http://download.dre.vanderbilt.edu/previous_versions/ACE-6.0.2.tar.gz
tar xvzf ACE-6.0.2.tar.gz
cd ACE_wrappers
mkdir build
cd build
../configure --disable-ssl --prefix=/usr
make
make install')
--xerces-c-2.8--
$this->bbcode_second_pass_code('', 'cd ~
wget http://apache.mirror.nexicom.net/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz
tar xvzf xerces-c-src_2_8_0.tar.gz
cd xerces-c-src_2_8_0/src/xercesc
export XERCESCROOT='~/xerces-c-src_2_8_0'
./runConfigure -p linux -c gcc -x g++ -P '/usr'
make
make install')
=========ORKAUDIO========
$this->bbcode_second_pass_code('', 'cd ~
mkdir oreka
cd oreka
wget http://sourceforge.net/projects/oreka/files/oreka/oreka-1.2/Source%20Code/oreka-1.2-675.tar.gz/download
mv download oreka.tar.gz
tar xvzf oreka.tar.gz
cd orkbasecxx
libtoolize --force
automake -a #<= you may have to run this command 2 times
automake -a #running it second time, just in case...
make -f Makefile.cvs
./configure --prefix=/usr
make
make install
cd ../orkaudio
libtoolize --force
automake -a #<= you may have to run this command 2 times
automake -a #running it second time, just in case...
make -f Makefile.cvs
./configure --prefix=/usr
make
make install')
========DD-WRT CONFIG=========
Put these 2 line in firewall script
This will copy all the driver that goes through the router, to our sniffer-plug. Router's have switches built-in, not hubs, remember? <sniffer ip> = your plug ip (setup static DHCP for your plug?)
iptables -A PREROUTING -t mangle -j ROUTE --gw <sniffer ip> --tee
iptables -A POSTROUTING -t mangle -j ROUTE --gw <sniffer ip> --tee
EDIT: To reduce load on the plug (orkaudio processees everything that comes to its LAN port), instead of the 2 lines above, add these 4. Now dd-wrt will only "copy" rtp and sip traffic to the plug, not all the traffic.
iptables -A PREROUTING -t mangle -m layer7 --l7proto rtp -j ROUTE --gw <sniffer ip> --tee
iptables -A POSTROUTING -t mangle -m layer7 --l7proto rtp -j ROUTE --gw <sniffer ip> --tee
iptables -A PREROUTING -t mangle -m layer7 --l7proto sip -j ROUTE --gw <sniffer ip> --tee
iptables -A POSTROUTING -t mangle -m layer7 --l7proto sip -j ROUTE --gw <sniffer ip> --tee
========RUNNING ORKAUDIO=========
orkaudio
config.xml is here => /etc/orkaudio/config.xml
records and logs =>/var/log/orkaudio/
To run at boot:
add "/usr/sbin/orkaudio" to /etc/rc.local
SIMPLE INSTALLATION USING SCRIPT
get it here: http://members.shaw.ca/shareme/instork.sh
OR
do
$this->bbcode_second_pass_code('', 'cd ~
wget http://members.shaw.ca/shareme/instork.sh
perl -pi -e 's/\r\n/\n/g' instork.sh #convert DOS to UNIX format (my hosting does UNIX->DOS) :(
chmod 777 instork.sh
./instork.sh')
and go for a coffee, it'll take a while.
The script does all the steps except the DD-WRT CONFIG.