-
Notifications
You must be signed in to change notification settings - Fork 5
/
Pi-Pwner.sh
executable file
·271 lines (223 loc) · 7.98 KB
/
Pi-Pwner.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#!/bin/bash
# Pi-Pwner 1.0 : A Raspberry Pi Pentesting Suite Deployer by Jason Soto
# jasonsoto.com
# jsitech-sec.com
##############################################################################################################
f_banner(){
echo
echo "
██████╗ ██╗ ██████╗ ██╗ ██╗███╗ ██╗███████╗██████╗
██╔══██╗██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██╔══██╗
██████╔╝██║█████╗██████╔╝██║ █╗ ██║██╔██╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║╚════╝██╔═══╝ ██║███╗██║██║╚██╗██║██╔══╝ ██╔══██╗
██║ ██║ ██║ ╚███╔███╔╝██║ ╚████║███████╗██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝
Pentesting Suite Deployer for Raspbian Stretch
Developed By Jason Soto @Jsitech"
echo
echo
}
pipwner_home=$(pwd)
##############################################################################################################
# Check if running with root User
clear
f_banner
check_root() {
if [ "$USER" != "root" ]; then
echo "Permission Denied"
echo "Can only be run by root"
exit
else
clear
cat templates/texts/pi-pwner_initial
echo "Press Enter to continue, CTRL+C to abort"
read INPUT
echo ""
#Setting Pi_Pwner motd
cp templates/motd /etc/motd
fi
}
##############################################################################################################
# Update Rasbian
clear
f_banner
update_raspbian(){
echo "[+] Updating Raspbian......."
apt -y update
apt -y upgrade
echo ""
echo "[+] Raspbian Updated"
}
##############################################################################################################
# Install some dependencies and Pentesting tools
clear
f_banner
install_dep_tools(){
echo "[+] Installing some Dependencies and Base Pentesting tools......"
apt install -y kismet aircrack-ng proxychains hping3 git nmap dsniff python3-pip netcat medusa nbtscan john libncurses5-dev yersinia smbclient sslstrip python-pip telnet macchanger openvpn hydra sqlmap wifite nikto python-scapy btscanner p0f dnswalk mitmproxy dnstracer dmitry libffi-dev libssl-dev libcap-dev python-dev
mkdir /opt/pentest
echo ""
echo "[+] Dependencies and Base Pentesting tools installed....."
echo ""
}
##############################################################################################################
# Install Pentesting tools and Script on /opt/pentest
clear
f_banner
install_pentest_tools(){
cd /opt/pentest/
echo "[+] Installing Pentesting tools and Scripts to /opt/pentest......"
echo ""
echo "[+] Installing theHarvester to /opt/pentest......"
git clone https://github.com/laramies/theHarvester /opt/pentest/theHarvester
pip install requests
ln -s /opt/pentest/theHarvester/theHarvester.py /usr/sbin/theHarvester
echo "[+] theHarvester installed"
clear
f_banner
echo "[+] Installing Exploit-Database to /opt/pentest......"
echo ""
git clone https://github.com/offensive-security/exploit-database /opt/pentest/exploit-database
ln -s /opt/pentest/exploit-database/searchsploit /usr/sbin/searchsploit
echo "[+] Exploit-Database installed"
clear
f_banner
echo "[+] Installing Metasploit......"
echo ""
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall
echo "[+] Metasploit installed"
clear
f_banner
echo "[+] Installing Responder to /opt/pentest......"
echo ""
git clone https://github.com/SpiderLabs/Responder /opt/pentest/responder
ln -s /opt/pentest/responder/Responder.py /usr/sbin/responder
echo "[+] Responder installed"
clear
f_banner
echo "[+] Cloning Impacket and Setting Up"
echo ""
git clone https://github.com/coresecurity/impacket /opt/pentest/impacket
pip install -r impacket/requirements.txt
cd impacket/
python setup.py install
cd ..
echo ""
echo "[+] Impacket installed"
clear
f_banner
echo "[+] Cloning Relayer to /opt/pentest......"
echo ""
echo "[+] Relayer is an Automated SMB Relay Attack Script"
echo ""
git clone https://github.com/jsitech/relayer /opt/pentest/relayer
cd relayer/
./install_req.sh
cd ..
echo "[+] Relayer installed"
clear
f_banner
echo "[+] Setting up GO and installing Bettercap...."
echo ""
wget https://storage.googleapis.com/golang/go1.8.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.8.linux-armv6l.tar.gz
apt upgrade -y libpcap-dev
export GOPATH=/usr/local/go/bin
export PATH=$PATH:$GOPATH
echo "export GOPATH=/usr/local/go/bin" >> /etc/profile
echo "export PATH=$PATH:$GOPATH" >> /etc/profile
go get github.com/bettercap/bettercap
ln -s /usr/local/go/bin/bin/bettercap /usr/sbin/bettercap
echo ""
echo "[+] Bettercap installed"
clear
f_banner
echo "[+] Installing Golismero....."
echo ""
git clone https://github.com/golismero/golismero.git /opt/pentest/golismero
cd golismero
pip install -r requirements.txt
pip install -r requirements_unix.txt
cd ..
ln -s /opt/golismero/golismero.py /usr/bin/golismero
echo ""
echo "[+] Golismero installed"
clear
f_banner
echo "[+] Installing RouterSploit..."
echo ""
git clone https://www.github.com/threat9/routersploit /opt/pentest/routersploit
cd routersploit
python3 -m pip install -r requirements.txt
pip3 install future
cd ..
ln -s /opt/pentest/routersploit/rsf.py /usr/sbin/rsf
echo ""
echo "[+] RouterSploit Installed"
clear
f_banner
echo "[+] Installing One-Lin3r...."
echo ""
git clone https://github.com/D4Vinci/One-Lin3r
cd One-Lin3r/
python setup.py install
cd ..
echo ""
echo "[+] One-Lin3r installed"
clear
f_banner
echo "[+] Installing Social Engineer Toolkit...."
echo ""
git clone https://github.com/trustedsec/social-engineer-toolkit /opt/pentest/social-engineer-toolkit
cd social-engineer-toolkit/
python setup.py install
cd ..
echo ""
echo "[+] Social Engineer Toolkit Installed"
}
##############################################################################################################
#Setup Pi-Pwner Wifi Access Point
clear
f_banner
setup_wifiap(){
cd $pipwner_home
echo "[+] Setting up Pi-Pwner Wifi AP......"
apt install hostapd dnsmasq
echo ""
echo "[+] Setting up Hostapd..."
echo ""
echo "[?] Please type in a Passphrase (Length 8 or longer) for the WiFi AP: " ; read wifiappass
sed -i s/PASS/$wifiappass/g templates/hostapd.conf
cp templates/hostapd.conf /etc/hostapd/hostapd.conf
cp templates/hostapd /etc/default/hostapd
echo "[+] Setting up Dnsmasq...."
echo "interface wlan0" >> /etc/dhcpcd.conf
echo "static ip_address=192.168.1.1" >> /etc/dhcpcd.conf
echo "static routers=192.168.1.1" >> /etc/dhcpcd.conf
echo "static domain_name_servers=8.8.8.8" >> /etc/dhcpcd.conf
echo "interface=wlan0" >> /etc/dnsmasq.conf
echo "domain-needed" >> /etc/dnsmasq.conf
echo "bogus-priv" >> /etc/dnsmasq.conf
echo "dhcp-range=192.168.1.8,192.168.1.15,12h" >> /etc/dnsmasq.conf
echo ""
echo "[+] Done setting up Pi-Pwner Wifi AP, Will show up after reboot......"
sleep 1
}
##############################################################################################################
# Final Steps
final_steps(){
clear
cat templates/texts/pi-pwner_finish
echo -n "[+] We will now Reboot......."
echo -n "Press Enter to continue, CTRL+C to abort"
read INPUT
reboot
}
check_root # Check for Root User
update_raspbian # Update Raspbian
install_dep_tools # Install Dependencies and Base Pentesting tools
install_pentest_tools # Install Pentesting Tools to /opt/pentest
setup_wifiap # Setup Pi-Pwner Wifi AP
final_steps # Final Steps