This commit is contained in:
CyberL1 2024-07-27 21:49:09 +02:00
commit 4bbc916282
2 changed files with 18 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.api-key

17
shell.sh Normal file
View File

@ -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