2

I'm trying to execute a Man in the Middle attack on my mobile phone, I have two wireless cards, one inbuilt in the laptop, running AR9285 atheros drivers, the 2nd is an Alfa AWUS036NHA card with an AR9271 driver. I'm using the alfa card (wlan1) to create a virtual router with the following commands:

$ airmon-ng start wlan1   
$ iwconfig wlan1 channel 5
$ iwconfig mon0 channel 5 
$ airbase-ng -e FreeWiFi -c 5 mon0

All this seems to work, an AP is created and I can attempt to connect to this with my phone, and it displays something along the lines of "Obtaining an IP address".

$ ifconfig at0 up

Above I bring up the at0 interface, I've tried this assigning an IP as well (0.0.0.0), also with a valid IP (e.g. x.x.x.next_available_number), and neither seems to work. I've also tried applying an address to wlan0, the wireless interface connected to the internet, this doesn't seem to work and also prevents me from getting internet connection.

$ brctl addbr m
$ brctl addif m at0
$ iw dev wlan0 set 4addr on
$ brctl addif m wlan0

Above I create the bridge and add both the interfaces, wlan0 is not usually usable in the bridge without the iw command. Next I bring up the bridge, at this point do I assign the bridge an IP address, the bridge interfaces, both, or neither? I've tried many variations and none seem to work:

$ ifconfig m up

OR

$ ifconfig m x.x.x.x up

The final step (as I understand it), is to run DHCP on the bridge. I try to do this with the following command:

n$ dhclient m

This program usually takes some time to run, and provides absolutely no output. At one point it asked me to install a package 'phonon-backend-gstreamer', which I did. But it still does not work.

If I look on the phone it says 'Obtaining IP address', in wireshark, on at0, I see a few DHCP requests and ARP broadcasts, however eventually the phone gives up and says something like 'Avoided bad internet connection'.

So, are there any obvious steps I have missed out, or perhaps something is being done in an incorrect order? Let me know if anything is not clear, thanks in advance!

1

1 Answer 1

1

The problem is clear! you don't have a DHCP server to provide an IP to the mobile phone.

You have two solutions:

  • Make sure that your Wlan0 is connected to a network with a DHCP server, 'for example: your home network', so when you make the bridge the phone will have an IP.
  • install a DHCP server apt-get install dhcp3-server and configure it to provide IPs.

Either ways, you forgot an important thing to do, make your system to re-forward the packets using the command: echo 1 > /proc/sys/net/ipv4/ip_forward

1
  • This problem was a while back, but I did often forget to enable IP forwarding, I just wrote a simple script to toggle it in the end. Thanks for the answer anyways!
    – dahui
    Commented Nov 3, 2015 at 10:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .