mirror of https://github.com/hak5/shark-files.git
add extension support
parent
3f7825b03a
commit
93a23d1eb9
|
@ -0,0 +1,11 @@
|
||||||
|
## Extensions folder
|
||||||
|
#
|
||||||
|
# This 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
|
|
@ -106,6 +106,14 @@ function wait_for_link() {
|
||||||
LED SETUP
|
LED SETUP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function source_extensions() {
|
||||||
|
if [ -d "/root/payload/extensions" ] && [ -n "$(ls -A /root/payload/extensions/)" ]; then
|
||||||
|
for extension in /root/payloads/extensions/*; do
|
||||||
|
source "${extension}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function execute_payload() {
|
function execute_payload() {
|
||||||
$LOG "Executing PAYLOAD"
|
$LOG "Executing PAYLOAD"
|
||||||
|
|
||||||
|
@ -116,6 +124,7 @@ function execute_payload() {
|
||||||
payload_path="/root/payload"
|
payload_path="/root/payload"
|
||||||
payload=$(ls $payload_path/payload* 2>/dev/null | tail -n1)
|
payload=$(ls $payload_path/payload* 2>/dev/null | tail -n1)
|
||||||
|
|
||||||
|
source_extensions
|
||||||
case $(basename $payload) in
|
case $(basename $payload) in
|
||||||
"payload.py")
|
"payload.py")
|
||||||
echo "python $payload &> /dev/null" | at now
|
echo "python $payload &> /dev/null" | at now
|
||||||
|
@ -134,7 +143,7 @@ function execute_payload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_network() {
|
function configure_network() {
|
||||||
cp /usr/lib/hak5/shark/config/${SWITCH_POSITION}/network /etc/config/network
|
cp "/usr/lib/hak5/shark/config/${SWITCH_POSITION}/network" /etc/config/network
|
||||||
/etc/init.d/network restart
|
/etc/init.d/network restart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue