Jump to content

Broadcasting as WPA/WPA2 AP


esa

Recommended Posts

Took me a long time to figure out how to broadcast a WPA/WPA2 AP using Pineapple nano. This should work similarly on a tetra. 
 

Here is the step by step instruction on setting up your WPA2 AP with internet access:

1) SSH into your pineapple

ssh root@172.16.42.1 

2) Create a hostapd.conf file in a directory of your preference

vi /etc/hostapdwpa2.conf

3) input the following text into the config file

# Define interface  
interface=wlan1mon
driver=nl80211
# Select driver  
ssid=myhotspot
# Set access point name  
hw_mode=g
# Set access point harware mode to 802.11g  
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)  
# Set WIFI channel (can be easily changed)  
channel=6
wpa=2
wpa_passphrase=mypassword
bridge=br-lan
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

This configuration tells hostapd to use interface wlan1mon to create a WPA2 protected AP called "myhotspot" with the passphrase "mypassword". Run iwconfig to verify whether your interface is wlan1mon or wlan1 and change the config file accordingly. (General when pineapple is freshly rebooted the interface will be wlan1, it will change to wlan1mon once you run recon on the GUI)

4) Run hostapd

hostapd ./hostapdwpa2.conf

Expected output:

root@Pineapple:/sd/etc/mana-toolkit# hostapd ./hostapdwpa2.conf
Configuration file: ./hostapdedw.conf
Using interface wlan1mon with hwaddr 00:xx:xx:xx:xx:xx and ssid "myhotspot"
wlan1mon: interface state UNINITIALIZED->ENABLED
wlan1mon: AP-ENABLED

5) Refresh your mobile phone Wifi and find myhotspot.

 

Hope this is useful for the community. Do share if you are facing any difficulties setting up your own WPA2 network. 

Link to comment
Share on other sites

Wait a minute here. You are using wlan1mon in that config file.
If hostapd is to work it would need to set the interface to master mode. It cannot run in master-mode and monitor-mode at the same time.

I suggest to simply edit the /etc/config/wireless file to fit your needs.
If you need instructions it can be found in the link below:
https://wiki.openwrt.org/doc/uci/wireless

Link to comment
Share on other sites

17 hours ago, Zylla said:

Wait a minute here. You are using wlan1mon in that config file.
If hostapd is to work it would need to set the interface to master mode. It cannot run in master-mode and monitor-mode at the same time.

I suggest to simply edit the /etc/config/wireless file to fit your needs.
If you need instructions it can be found in the link below:
https://wiki.openwrt.org/doc/uci/wireless

I have investigated, apparently the reason it works when i tested it is because hostapd will force the interface to master-mode regardless of it existing state. 

The catch is that i will have to manually set the interface back to monitor mode after i am done with broadcasting.

root@Pineapple:/etc# ifconfig wlan1mon down
root@Pineapple:/etc# iwconfig wlan1mon mode monitor
root@Pineapple:/etc# ifconfig wlan1mon up
root@Pineapple:/etc# iwconfig

Anyway thanks for highlighting another option i could use. Will go explore what UCI is all about. 

Link to comment
Share on other sites

I'm just curious as to why you chose to use the interface-name: wlan1mon in the "hostapd.config" file.
As it's normally called wlan1, you would need to use airmon-ng to set it to monitor mode for hostapd to recognize the interface-name.

Another thing is that it's not "persistent". You would need to run hostapd manually each time the device starts, or by creating a init-script to launch it at boot.
(Also, do you dhcp-server listen on wlan1mon?)

Anyways, as UCI is a part of OpenWRT i would highly suggest to use it. It's also persistent between reboots.
And it takes care of pretty much everything itself, as long as the config file is setup correct.

Link to comment
Share on other sites

On 06/04/2017 at 10:20 PM, Zylla said:

I'm just curious as to why you chose to use the interface-name: wlan1mon in the "hostapd.config" file.
As it's normally called wlan1, you would need to use airmon-ng to set it to monitor mode for hostapd to recognize the interface-name.

Another thing is that it's not "persistent". You would need to run hostapd manually each time the device starts, or by creating a init-script to launch it at boot.
(Also, do you dhcp-server listen on wlan1mon?)

Anyways, as UCI is a part of OpenWRT i would highly suggest to use it. It's also persistent between reboots.
And it takes care of pretty much everything itself, as long as the config file is setup correct.

General when pineapple is freshly rebooted the interface will be wlan1, it will change to wlan1mon once i run recon using the GUI. Before running hostapd, i will run a iwconfig to verify the interface name. 

Actually i do not need WPA2 broadcast to be persistent. My initial goal is to perform a Evil Twin attack and eventually to create a Evil Twin module.
Unfortunately i am new to angularjs so it might take awhile for me to learn the basic first. 

 

Link to comment
Share on other sites

  • 2 years later...

I have added this to the /etc/config/wireless.

 bjS13jp.png

The pineapple doesnt broadcast the ssid however. The other ifaces using wlan1 are disabled i tried doing iwconfig wlan1 down and up, to restart it, but it still doesnt broadcast it

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...