Uploaded Default Switch 3 Payload

pull/34/head
cyrus104 2020-07-09 13:40:49 +07:00 committed by GitHub
parent 14da80aa0d
commit 93dd64b292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 10 deletions

View File

@ -0,0 +1 @@
Replace with valid .ovpn config.

View File

@ -1,12 +1,52 @@
#!/bin/bash
#
# Title: Default Payload
# Description: Sets the NETMODE to NAT, then sets the LED to ATTACK
# Author: Hak5
# Version: 1.0
# Category: default
# Target: Any
# Net Mode: NAT
# OpenVPN payload
NETMODE NAT
LED ATTACK
# Set to 1 to allow clients to use the VPN
FOR_CLIENTS=0
DNS_SERVER="8.8.8.8"
# Cheap hack to set the DNS server
function setdns() {
while true
do
[[ ! $(grep -q "$DNS_SERVER" /tmp/resolv.conf) ]] && {
echo -e "search lan\nnameserver $DNS_SERVER" > /tmp/resolv.conf
}
sleep 5
done
}
function start() {
LED SETUP
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Set NETMODE to BRIDGE and wait 3 seconds
# to ensure that things can settle
[[ "$FOR_CLIENTS" == "1" ]] && {
/usr/bin/NETMODE VPN
} || {
/usr/bin/NETMODE BRIDGE
}
sleep 3
# Make OpenVPN use the local configuration
uci set openvpn.vpn.config="${DIR}/config.ovpn"
uci commit
# Start the OpenVPN server in the background
/etc/init.d/openvpn start
# Start SSH Server
/etc/init.d/sshd start &
# Set DNS server
setdns &
LED ATTACK
}
# Start the payload
start &