Jasager and BackTrack

The beautiful part of using Jasager as opposed to airbase-ng for KARMA, is that by running karma as its own seperate module, we can keep the clutter out of BackTrack. So all the dhcp and karma stuff is taken care by Jasager running on fon, while BT can freely be used for sslstrip, hamster, middler and metasploit. The setup runs smooth and works great. So here is how you set it up:

Once you got Jasager running on fon, edit the /etc/config/dhcp and /etc/config/network files like this

dhcp:

config dnsmasq
option domainneeded     1
option boguspriv        1
option filterwin2k      '0'  #enable for dial on demand
option localise_queries 1
option local    'lan'
option domain   'lan'
option expandhosts      1
option nonegcache       0
option authoritative    1
option readethers       1
option leasefile        '/tmp/dhcp.leases'
option resolvfile       '/tmp/resolv.conf.auto'

config dhcp lan
option interface        lan
option start    100
option limit    150
option leasetime        12h
option ignore 0
list dhcp_option 3,192.168.0.1
list dhcp_option 6,192.168.0.2,208.67.222.222
list dhcp_option 6,192.168.0.2,8.8.8.8

config dhcp wan
option interface        wan
option start 100
option limit 150
option leasetime 12h
option ignore 1
list dhcp_option 3,192.168.0.1
list dhcp_option 6,192.168.0.2,208.67.222.222
list dhcp_option 6,192.168.0.2,8.8.8.8

Where 192.168.0.1 is the ip address of eth0 on backtrack. and 192.168.0.2 will be the ip address of fonera

Configure accordingly.

network:

config interface loopback
option ifname   lo
option proto    static
option ipaddr   127.0.0.1
option netmask  255.0.0.0

config interface lan
option ifname   eth0
option type bridge
option netmask 255.255.255.0
option proto    static
option ipaddr   192.168.0.2
option gateway 192.168.0.1
option dns 8.8.8.8

Again, 192.168.0.1 is the ip address of eth0 on backtrack, while 192.168.0.2 is ip address of fonera
Once you have configured dhcp and network files, restart the networking on fonera or reboot it.
Now, we should configure backtrack machine to forward traffic to and from fonera

Issue these commands in backtrack.

ifconfig eth0 192.168.0.1 netmask 255.255.255.0
echo '1' > /proc/sys/net/ipv4/ip_forward
iptables -X
iptables -F
iptables -A FORWARD -i wlan0 -o eth0 -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
route del default
route add default gw 192.168.1.254 wlan0

Where wlan0 is the interface that is connected to internet.
192.168.1.254 is the gateway for the interface connected to internet. Change it accordingly
If you are using your phone’s internet connection tethered to BT, then replace the above interface wlan0 with ppp0.
Gateway in that case will be the ip address of ppp0 , which can be found by ifconfig. Change accordingly.
Fon should now have internet and so are the clients connected to it. Now we can start our favorite tools on BT.
You can troubleshoot by pinging your way bottom up.
SSH into fonera, and ping

ping 192.168.0.1
ping (The wlan0 IP address)
ping (The GW address)
ping 8.8.8.8
ping google.com

Tags: , , ,