Chuyển đến nội dung chính

Fake WiFi Access Point

Evil Twin Methodology

Step 1: We will first scan the air for a target access point. Then create an access point using airbase-ng with the same name and channel of the target access point, hence Evil-TWIN.
Step 2:The client is now disconnected repeatedly from the  original access point and as most modern system’s setting says… “Connect back to same ESSID(AP name) if disconnects”.
This also happens because when the client disconnects from any access point it starts sending probe requests in the air with the name of the access point it connected to earlier. Hence BSSID isn’t a barrier, you just need ESSID to spoof the AP
Step 3: Clients is now connected to the Fake WiFi access point and now client may start browsing Internet.
Step 4: Client will see a web administrator warning saying “Enter WPA password to download and upgrade the router firmware”
Step 5: The moment client enters the password, s/he will be redirected to a loading page and the password will be stored in the MySQL database of the attacker machine.
Scanning the air for clien’t probe requests can lead you to crack WPA2-PSK passphrase without any existing Access point or sometimes without any handshake.

Hardware used:

Software Used:

Installing required tools

So far we have aircrack-ng suite of tools, apache, mysql, iptables pre-installed in our Kali Linux virtual machine.
We just need to install isc-dhcp-server for IP address allocation to the client.

Install isc-dhcp-server in Kali Linux 2 – Sana

Type in terminal:
This will update the cache and install latest version of dhcp server in your Kali Linux box.
install-dhcp-server-kali-linux-2-sana

Now all the required tools are installed. We need to configure apache and the dhcp server so that the access point will allocate IP address to the client/victim and client would be able to access our webpage remotely.

Enable “public_html” remote access in apache2

By default apache doesn’t allow public access for the running web services and also in Kali Linux apache’s default web directory there is no public_html directory. So we need to create one.
Open terminal and type:
Now you’ll need to enable remote access to the public_html directory
Type in terminal:
and edit the outlined portion and make sure your file looks like the below image:
enable-remote-public-html-access-apache

Now we will define the IP range and the subnet mask for the dhcp server.

Configure isc-dhcp-server

Type in terminal:
and type this in the beginning of the file
Your dhcpd.conf file will look like this
configure-isc-dhcp-server-dhcpd.conf

Resolve airmon-ng and Network Manager Conflict

Before enabling monitor mode on the wireless card let’s fix the airmon-ng and network-manager conflict forever.
So that we don’t need to kill the network-manager or disconnect tany network connection before putting wireless adapter into monitor mode as we used to run airmon-ng check kill every time we need to start wifi pentest.
Open terminal and type:
Now add the following at the end of the file
Output should look like this
Edit NewtorkManager.conf to prevent conflicts with airmon-ng (no check kill)
Now that you have edited the NetworkManager.conf file you should have no conflicts with airmon-ng in Kali Linux 2.0
We are ready to begin now.

Bring up the wireless interface

Put wireless adapter into monitor mode

Putting the card in monitor mode will show a similar output
airmon-ng-start-wlan1-no-error

Now our card is in monitor mode without any issues with network manager. You can simply start monitoring the air with command
airodump-ng-scan-target-output

As soon your target AP appears in the airodump-ng output window press CTRL-C and note these three things in a text editor(Gedit, in case)
save-access-point-info

Set tx-power of alfa card to max: 1000mW

tx-power stands for transmission power. By default it is set to 20dBm(Decibel metre) or 100mW.
tx-power in mW increases 10 times with every 10 dBm. See the dBm to mW table.
If your country is set to US while installation. most probably your card should operate on 30 dBm(1000 mW)
In Kali Linux 2.0 (Codename: Sana) You might face issue while powering up your card.
As in earlier versions if you set country(region) to Bolivia, you are able to operate card at 30 dBm. But in Kali Sana is not working. So we’ll be using US as our region. Here is how
If you are thinking why we need to change region to operate our card at 1000mW. Here is why
because different countries have different legal allowance of Wireless devices at certain power and frequecy. That is why Linux distribution have this information built in and you need to change your region to allow yourself to operate at that frequency and power.

Motive of powering up the card is that when creating the hotspot you do not have any need to be near to the victim. victim device will automatically connect to the device with higher signal strength even if it isn’t physically near.

Start Fake WiFi Access Point

Now we will create the fake WiFi access point using airbase-ng:
fake wifi access point using airbase-ng

by default airbase-ng creates a tap interface(at0) as the wired interface for bridging/routing the network traffic via the rogue access point. you can see it using ifconfig at0 command.

ifconfig at0

For the at0 to allocate IP address we need to assign an IP range to itself first.

Allocate IP and Subnet Mask

allocate ip range to at0 tap interface
Here we have allocated Class-C IP address to the at0 interface.
route command had set 192.168.1.0 as the network address, 255.255.255.0 as Subnet Mask and 192.168.1.1 as default gateway i.e at0’s IP
Do not confuse between Network address and default gateway. Network address is also called the network node. Nodes are the reserved IP address of any specific range. “X.X.X.0” and “X.X.X.255” are always reserved that is why IP range always varies from X.X.X.1-254
An address that ends in “.255” is also called broadcast address: all devices in the same network should handle packets addressed to the broadcast address.
Now as we have allocated IP address and subnet mask to the at0 interface we will use our default ethernet interface i.e eth0, through which we access the network connection or the Internet inside the virtual machine to route all the traffic from the client through it.
In short allowing victim to access the internet and allowing ourselves(attacker) to sniff the victim traffic.
For that we will use IPtables utility to set a firewall rule to route all the traffic through this specific interface.
first you need to check the IP address of the routing interface. check it using
you will get a similar output, if using VM
ip route command
In this case IP address of the default interface is 192.168.2.129, yours may be different

Set Firewall rules in Iptables

Note the eth0 IP and enter the following commands
Make sure you enter your etho IP address in the thord command after “–to-destination“. Rest if fine
Don’t worry we will discuss the meaning of the above commands in the coming chapter in detail. Till then just test it 😉
After entering the above command if you are willing to provide Internet access to the victim just enable routing using the command below

Enable forwarding

Entering “1” in the ip_forward file will tell the system to enable the rules defined in the IPtables and start forwarding traffic(if any). 0 stand for disable. Although rules will remain defined until next reboot.
We will put it 0 for this attack, as we are not providing internet access before we get the WPA password.

Fake wifi access point is now up and rules has been enabled, now we will start the dhcp server to allow fake AP to allocate IP address to the clients.
First we need to tell dhcp server the location of the file we created earlier, which defines IP class, subnet mask and range of the network.

Start dhcpd Listener

Type this in terminal:
Here -cf stands for Configuration file and -pf stands for PID file
You should see a similar output
tell configuration file to dhcpd

Start the Services

Now start the dhcp server, apache and mysql inline
We have our fake wifi access point up and working perfectly. Now we need to setup our fake webpage in action so that victim will see the webpage while browsing and enter the passphrase which s/he uses for his/her access point.
Download the rogue_AP.zip file here and extract it on your desktop
and simply enter the following command in Terminal
This command will extract the contents of rogue_AP.zip file and copy them to the apache’s public_html directory so that when the victim opens the browser s/he will automatically be redirected to the default index.html webpage.
Now to store the credentials entered by the victim in the html page, we need an SQL database.
you will see a dbconnect.php file for that, but to be in effect you need a database created already so that thedbconnect.php will reflect the changes in the DB.
Open terminal and type:
now create database and table as defined in the dbconnect.php. Simply type
it should go like this:
create-mysql-database and table for credential harvest
now you may test inserting a test value in the table
Type:
insert values in table
Note that both the values are same here, that means password and confirmation password should be the same.
Our attack is now ready just wait for the client to connect and see the credential coming.
In some cases your client might already be connected to the original AP. You need to disconnect the client as we did in the previous chapters using aireplay-ng utility.
open the notepad in which you saved the AP info and type:
  • aireplay-ng –deauth 0  -a <BSSID> wlan1mon
–deauth 0 stands for unlimited de-authentication requests you can also limit the request by entering any +ve integer
We are using 0 so that every client will disconnect from that specific BSSID and connect to our AP as it is of the same name as of real AP and also open.
aireplay-ng deauthenticate the client

As soon a client connects to your AP you will see an activity in the airbase-ng terminal window like this
client connects to airbase-ng fake access point
Now to simulate the client side I am using Ubuntu machine connected via WiFi and using a Firefox web browser to illustrate the attack.
When victim tries to access any website(google.com in this case), s/he will see this page which tell the victim to enter the password to download and upgrade the firmware
evil twin web administrator login page
Here i am entering “iamrootsh3ll” as the password that I (Victim) think is his/her AP’s password.
As soon as the victim presses [ENTER] s/he will see this
web administrator loading

Now coming back to attacker side. You need to check in the mySQL database for the stored passwords.
Just type the previously used command in the mySQL terminal window and see whether a new update is there or not.
After simulating I checked the mySQL DB and here is the output
check harvested wpa password
Voila! you have successfully harvested the WPA passphrase right from the victim in plain text.
now close all the terminal windows and connect back to the real AP to check whether the password is correct or victim was him/herself was a hacker and tricked you. haha
Although you don’t need to name any AP similar to an existing AP you can also create a random free open WiFi type name to gather the client on your AP and start pentesting.
That’s a free machines for you for penetration testing.
There are hell lot of possibilities of attacks and techniques using fake wifi access point that we will surely discuss in upcoming posts. till then keep testing and
Keep Learning.


Nhận xét

Bài đăng phổ biến từ blog này

13 dấu hiệu lãng phí cuộc đời

Khi còn là 1 đứa trẻ, bạn luôn mong muốn khi lớn lên có thể trở thành phi hành gia, ca sĩ hay kĩ sư? Nếu đúng vậy thì bây giờ bạn đang làm gì? Hy vọng rằng mọi thứ diễn ra đúng như bạn mơ ước. Nhưng tiếc rằng, với hầu hết mọi người, câu trả lời là không. Dưới đây là 13 dấu hiệu cho thấy bạn đang lãng phí cuộc đời của mình. Sẽ rất khó để thừa nhận nhưng hãy thành thực với bản thân mình. 1. Bạn dành thời gian làm những điều mà mình không nên làm Chơi game. Xem các chương trình truyền hình thực tế. Lướt web. Ăn quá nhiều. Uống quá nhiều. Với mỗi người vấn đề lại khác nhau nhưng danh sách này còn kéo dài. Hãy nhìn nhận cuộc sống của mình 1 cách nghiêm túc hơn. Phần lớn thời gian bạn dành để làm gì? Nó có xứng đáng hay không? Nó có giúp mang tới cuộc sống tốt đẹp hơn hay không? Nó có làm nền tảng cho 1 tương lai tươi sáng hay không? Nếu câu trả lời là không thì bạn cần đánh giá lại những hoạt động hàng ngày của mình và thay đổi ngay. 2. Bạn phàn nàn quá nhiều Có những người t

How to Fix Windows Error 0x00000709

add a share printer error 0x00000709. Follow this step by step guide to learn how to fix this error: In this tutorial, we will teach you how to fix the Blue Screen of Death Stop Error 0x00000709. The error "0x00000709" occurs when you try to connect a shared printer over the network. The printer exists but you are unable to connect and you will get this error. Step 1 -- Open RUN type: \\192.168.1.111  Enter Step 2 -- Open the shared printer When the network path window opens up, double click on the printer. A pop-up window will appear and will show you the error: "Operation could not be completed error 0x00000709". Click on the Ok button and close all the windows. Step 3 -- Go to Devices & Printers Now let's resolve the error and properly add the shared printer. First of all, open the start menu and click on Devices and Printers. Step 4 -- Add a printer In the Devices and Printers window, click on the Add a Printer tab. Choose to add a lo