Thursday, March 14, 2013

Wireless Adapter TL-WN7200ND with Kismet and OpenWRT Router TL-WDR4300

Hi,

I bought a wireless adapter TP-Link TL-WN7200ND today.



Features:

1. I'm able to run it in Backtrack with injection mode and monitor mode just fine.

2. I can also use it as another wifi-interface on my router TP-Link TL-WDR4300, set it to monitor mode and use it to transmit packets that the kismet drone captured, parallely with the built in 2.4GHz band interface.

3. It can be used as another attached AP as well with a very high Tx transmitting power 500mW, creating semi-trio band router for TL-WDR4300 (opposed to the original dual bands 5 GHz and 2.4 GHz, now we have two 2.4 GHz and one 5GHz). Thus, We will cover these below.

Technical Infos:
  • Wireless Standards: IEEE 802.11n, IEEE 802.11g, IEEE 802.11b
  • Frequency: 2.400-2.4835GHz
  • 20dBm (EIRP, For countries using CE Standards) 100mW
  • 27dBm (EIRP, For countries using FCC Standards) 500mW
  • kismet drone ncsource type=rt2870sta (/etc/kismet/kismet_drone.conf)
  • Chipset: Ralink RT3070

A. How to get it to work with Backtrack

I won't say much but just have a look at this page. Search on that page for the word 'Bolivia'. ;)

B. How to get it to work with an OpenWRT router

So after plugging it in to the robust TL-WDR4300 router running Attitude Adjustment 12.09rc1 (Yours could be a different router, or a different version of OpenWRT firmware), you should install these packages.

opkg update
opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb

Now use the command 'wifi detect' to let the router know the existence of your new adapter.

Please test to see what the command prints first, because we are going to merge the result with our existing /etc/config/wireless

cd ~
wifi detect > newwifi
cat newifi

it should display:

config wifi-device  radio2
    option type     mac80211
    option channel  11
    option macaddr    6F:79:AA:BB:CC:D2
    option hwmode    11ng
    option htmode    HT20
    list ht_capab    GF
    list ht_capab    SHORT-GI-20
    list ht_capab    SHORT-GI-40
    list ht_capab    RX-STBC1
    # REMOVE THIS LINE TO ENABLE WIFI:
    option disabled 1 #(You might want to put this to 0)

config wifi-iface
    option device   radio2
    option network  lan
    option mode     ap
    option ssid     OpenWrt
    option encryption none


If so you are good to go, so type in these commands to merge the result with the existing /etc/config/wireless:

wifi detect >> /etc/config/wireless


Next, reboot your router, and you should have another Wifi AP running, you can double check with the LuCI web UI in the wifi section.

Now you have got yourself a Trio bands router :D !!




C. How to use it to pass captured packets from Kismet Drone.
If you haven't a clue yet what this is, please check this page: here.
(It will tell you what Kismet is, and how to edit the .conf files in general)

So go to the /etc/kismet/kismet_drone.conf

The only line you need to add or change is this:

ncsource=wlan2:type=rt2870sta

Notice the type=rt2870sta 
(Look at this from the Documentation page at Kismet for other types section 7)

You can also run 2 ncsources with a kismet drone at once, I have tested and I think it works together. (If somehow one source fails, the other would still continue to work, no worries.)

So after running this command it should show something this:

kismet_drone





Notes:

Thanks for reading, I'm happy that the traffic to my blog increases alot, although no one's ever commented :( haha. I'm not driven to get attention but if you think some of these posts are useful to you, please comment or +1 for me, it would mean so much....

And if I ever make any mistake, please kindly correct, or positively criticize at will :)


Coming next: Integration of OpenWRT + Kismet + Snort

References:

https://gpuhash.com/?menu=en-articles-view-2
(To help fix the low Tx power issue)

http://www.sans.org/reading_room/whitepapers/wireless/remote-access-point-ids_33914
(Best paper yet for my research)

http://www.andrewklau.com/openwrt-and-a-4-usb-wifi-adapter/
(OpenWRT and kmod-2800-usb)

10 comments:

  1. Thanks to you, I succeeded in connecting a wireless adapter (a TL-WN821N with a Atheros AR9170 chipset) to a wr703 router, but it is working at very slow bit rates. I'm seeing only 300Kb/s even though it says it's connected at 300 Mb/S. The logs are filled with these sections: http://pastie.org/7212064#3-4.

    I would be grateful for any insights into what is going wrong. What do you make of it?

    ReplyDelete
  2. Hey, glad it connects.

    Well I'm not quite qualified to help you with your problem.
    I think you'd better take it to the openwrt forums.
    Cheers,

    ReplyDelete
  3. Two things I could think of off the surface:

    1. Could it be slow because of your country policy?

    2. Maybe double check your packages/driver, it could be different than mine since we have different models. Please kindly ask this in the forums as well.

    Hope it works, please then tell :)

    ReplyDelete
  4. Thanks for responding. I did try the openwrt forum (and irc) but I got no response. I'm guessing this is not a very typical user scenario.

    When i did the wifi detect step. It added:

    option path 'platform/ehci-platform/usb1/1-1/1-1:1.0'

    to the config of radio1.

    A "path" variable is not even something that is mentioned in the openwrt wiki, so I feel that I'm in uncharted waters here.

    I am using a different driver: kmod-carl9170 which I as far I know should be used with the chipset in my usb adapter. Every package installed without complaining.

    I don't think it's a country policy thing, since the inbuilt radio is working at full speed.

    ReplyDelete
  5. Then I still think it's a device-driver problem. Maybe kmod-carl9170 doesn't fully cover your device.

    What's the speed when you connect the adapter to your PC/Laptop?

    As you said, it's an uncharted water, i'm sorry.

    Maybe try switching to some other kmods? Or if you can, rewrite a new driver from source?

    It's beyond my knowledge, but I wish you all the best.

    ReplyDelete
  6. Also, maybe try other OpenWRT router firmware versions.

    ReplyDelete
  7. I'm already using trunk and the HW version of the router doesn't support earlier versions.

    I think I'll admit defeat (for now at least) at this point, but thanks for your help all the same.

    ReplyDelete
  8. Como lograste hacer funcionar con bt? estoy intentarlo correrlo en VirtualBox con Kali... pero no lo he logrado

    ReplyDelete
    Replies
    1. A mi también me sucedía lo mismo. Era un problema de haber instalado mal la compatibilidad de virtualización y las Guest Addiotions. Te recomiendo ver este post: https://www.quora.com/How-do-I-enable-a-wireless-adapter-on-VirtualBox

      Delete