commit 4bbc916282aa96ab964cd9f84190c2abab40636b Author: CyberL1 Date: Sat Jul 27 21:49:09 2024 +0200 upload diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c6915e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.api-key diff --git a/shell.sh b/shell.sh new file mode 100644 index 0000000..bbeba0d --- /dev/null +++ b/shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +API_HOST="https://api.ssh.surf" +API_KEY=$(cat .api-key) + +[ -z $API_KEY ] && echo "API key not found" && exit 1 + +hello=$(curl -w %{http_code} -sH "x-ssh-auth: $API_KEY" $API_HOST/hello -o /dev/null) + +if [[ hello -ne 200 ]]; then + echo "token not valid, exiting" + exit 1 +fi + +CONNECTOR=$(curl -sH "x-ssh-auth: $API_KEY" -X POST -H "content-type: application/json" $API_HOST/exec --data '{ "cmd": "con --list | grep ssh - Port: 22", "pwd": "/root" }' | grep -o 'Connector: [^"]*' | sed 's/Connector: //' | sed 's/\\n//') + +npx holesail $CONNECTOR