mirror of https://github.com/hak5/shark-files.git
commit
6cb3073db3
|
@ -0,0 +1,11 @@
|
|||
## Extensions folder
|
||||
#
|
||||
# The files in this folder are sourced just before payload execution.
|
||||
# Users can add helper functions in here and use those functions in their payloads if desired.
|
||||
# Example which allows you to call "example" from payload script:
|
||||
#
|
||||
# function example() {
|
||||
# printf 'I am an example!\n'
|
||||
# }
|
||||
#
|
||||
# export -f example
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
LOG="logger -t Shark [*]"
|
||||
$LOG "Executing PAYLOAD"
|
||||
|
||||
if [ ! -d /root/loot ]; then
|
||||
mkdir -p /root/loot;
|
||||
fi
|
||||
|
||||
payload_path="/root/payload"
|
||||
payload=$(ls $payload_path/payload* 2>/dev/null | tail -n1)
|
||||
|
||||
extension_path="/root/payload/extensions/"
|
||||
if [ -d "${extension_path}" ] && [ -n "$(ls -A ${extension_path})" ]; then
|
||||
for extension in ${extension_path}*; do
|
||||
source "${extension}"
|
||||
done
|
||||
eval "$(declare -F | sed -e 's/-f /-fx /')"
|
||||
fi
|
||||
|
||||
case $(basename "${payload}") in
|
||||
"payload.py")
|
||||
python "${payload}" &> /dev/null
|
||||
;;
|
||||
"payload.php")
|
||||
php-cli "${payload}" &> /dev/null
|
||||
;;
|
||||
"payload" | "payload.sh" | "payload.txt")
|
||||
sed -i 's/\r//g' $payload
|
||||
bash -C "${payload}" &> /dev/null
|
||||
;;
|
||||
*)
|
||||
/usr/bin/LED FAIL
|
||||
;;
|
||||
esac
|
|
@ -106,35 +106,8 @@ function wait_for_link() {
|
|||
LED SETUP
|
||||
}
|
||||
|
||||
function execute_payload() {
|
||||
$LOG "Executing PAYLOAD"
|
||||
|
||||
if [ ! -d /root/loot ]; then
|
||||
mkdir -p /root/loot;
|
||||
fi
|
||||
|
||||
payload_path="/root/payload"
|
||||
payload=$(ls $payload_path/payload* 2>/dev/null | tail -n1)
|
||||
|
||||
case $(basename $payload) in
|
||||
"payload.py")
|
||||
echo "python $payload &> /dev/null" | at now
|
||||
;;
|
||||
"payload.php")
|
||||
echo "php-cli $payload &> /dev/null" | at now
|
||||
;;
|
||||
"payload" | "payload.sh" | "payload.txt")
|
||||
sed -i 's/\r//g' $payload
|
||||
echo "bash -C '$payload'" | at now
|
||||
;;
|
||||
*)
|
||||
/usr/bin/LED FAIL
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function configure_network() {
|
||||
cp /usr/lib/config/${SWITCH_POSITION}/network /etc/config/network
|
||||
cp "/usr/lib/hak5/shark/config/${SWITCH_POSITION}/network" /etc/config/network
|
||||
/etc/init.d/network restart
|
||||
}
|
||||
|
||||
|
@ -164,7 +137,7 @@ function enter_attack_mode() {
|
|||
stop_ssh
|
||||
|
||||
wait_for_link
|
||||
execute_payload
|
||||
echo "execute_payload" | at now
|
||||
|
||||
enter_idle_mode
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue