mirror of
https://github.com/hak5/bashbunny-payloads.git
synced 2025-10-29 16:58:25 +00:00
Remove bunny_helpers.sh and add the new 1.1 extensions
This commit is contained in:
8
payloads/library/extensions/ducky_lang.sh
Executable file
8
payloads/library/extensions/ducky_lang.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
function DUCKY_LANG() {
|
||||
[[ -z "$1" ]] && exit 1 # parameter must be set
|
||||
|
||||
export DUCKY_LANG="$1"
|
||||
}
|
||||
export -f DUCKY_LANG
|
||||
23
payloads/library/extensions/get.sh
Executable file
23
payloads/library/extensions/get.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
function GET() {
|
||||
case $1 in
|
||||
"TARGET_IP")
|
||||
export TARGET_IP=$(cat /var/lib/dhcp/dhcpd.leases | grep ^lease | awk '{ print $2 }' | sort | uniq)
|
||||
;;
|
||||
"TARGET_HOSTNAME")
|
||||
export TARGET_HOSTNAME=$(cat /var/lib/dhcp/dhcpd.leases | grep hostname | awk '{print $2 }' | sort | uniq | tail -n1 | sed "s/^[ \t]*//" | sed 's/\"//g' | sed 's/;//')
|
||||
;;
|
||||
"HOST_IP")
|
||||
export HOST_IP=$(cat /etc/network/interfaces.d/usb0 | grep address | awk {'print $2'})
|
||||
;;
|
||||
"SWITCH_POSITION")
|
||||
[[ "$(cat /sys/class/gpio_sw/PA8/data)" == "0" ]] && export SWITCH_POSITION="switch1" && return
|
||||
[[ "$(cat /sys/class/gpio_sw/PL4/data)" == "0" ]] && export SWITCH_POSITION="switch2" && return
|
||||
[[ "$(cat /sys/class/gpio_sw/PL3/data)" == "0" ]] && export SWITCH_POSITION="switch3" && return
|
||||
export SWITCH_POSITION="invalid"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
export -f GET
|
||||
18
payloads/library/extensions/requiretool.sh
Executable file
18
payloads/library/extensions/requiretool.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# REQUIRETOOL v1 by @Hak5Darren
|
||||
# Checks for specified directory in /tools, exits with LED FAIL if not found
|
||||
# Usage: REQUIRETOOL directory
|
||||
#
|
||||
# Examples:
|
||||
# REQUIRETOOL impacket
|
||||
|
||||
function REQUIRETOOL() {
|
||||
[[ -z "$1" ]] && exit 1 # parameter must be set
|
||||
|
||||
if [ ! -d /tools/$1/ ]; then
|
||||
LED FAIL
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
export -f REQUIRETOOL
|
||||
47
payloads/library/extensions/run.sh
Executable file
47
payloads/library/extensions/run.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# RUN v1 by @Hak5Darren
|
||||
# Simplifies executing commands from HID attacks for various targets
|
||||
# Usage: RUN [OS] [Command to execute]
|
||||
#
|
||||
# Examples:
|
||||
# RUN WIN notepad.exe
|
||||
# RUN WIN "powershell -Exec Bypass \"tree c:\\ > tree.txt; type tree.txt\"
|
||||
# RUN OSX http://www.example.com
|
||||
# RUN UNITY xterm
|
||||
|
||||
function RUN() {
|
||||
local os=$1
|
||||
shift
|
||||
|
||||
[[ -z "$os" || -z "$*" ]] && exit 1 # Both OS and Command parameter must be set
|
||||
|
||||
case "$os" in
|
||||
WIN)
|
||||
QUACK GUI r
|
||||
QUACK DELAY 500
|
||||
QUACK STRING "$@"
|
||||
QUACK ENTER
|
||||
;;
|
||||
OSX)
|
||||
QUACK GUI SPACE
|
||||
QUACK DELAY 500
|
||||
QUACK STRING "$@"
|
||||
QUACK DELAY 500
|
||||
QUACK ENTER
|
||||
;;
|
||||
UNITY)
|
||||
QUACK ALT F2
|
||||
QUACK DELAY 500
|
||||
QUACK STRING "$@"
|
||||
QUACK DELAY 500
|
||||
QUACK ENTER
|
||||
;;
|
||||
*)
|
||||
# OS parameter must be one of the above
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
export -f RUN
|
||||
Reference in New Issue
Block a user