A simple SQL-injection detector based on ML
Project description
sqlidps
SQL Injection - Detection and Prevention System
SQLIDPS is a tool designed to detect and prevent SQL injection attacks in web applications. SQL injection is a common attack vector that allows attackers to execute arbitrary SQL code on a database, potentially leading to data breaches and other security issues. This project aims to provide a robust solution for identifying and mitigating such vulnerabilities.
Flow Chart
The data flow in SQLIDPS illustrates how user inputs are processed to detect and prevent SQL injection attacks.
Below is a detailed visualization of the flow:
📚 For more detailed documentation, visit deepwiki docs.
🚀 Performance Benchmark
🛡️ SQL Injection Check Time: 0.8ms per input
Usage
SQLi.check(data)
Checks if the provided data contains potential SQLi payloads. Raises PotentialSQLiPayload if a malicious input is detected.
-
Arguments:
data(str | list | dict): Input to be checked.
-
Example:
from sqlidps import SQLi
try:
SQLi.check("SELECT * FROM users WHERE '1'='1' --")
except PotentialSQLiPayload as e:
print("Blocked:", e)
SQLi.parse(data: dict, error="potential payload") → dict
Parses a dictionary and replaces any malicious values with a safe error string instead of raising an exception.
-
Arguments:
data(dict): Dictionary to scan.error(str): Replacement string for detected payloads (default:"potential payload").
-
Returns:
- A cleaned dictionary with malicious values replaced.
-
Example:
data = {
"username": "admin",
"password": "' OR '1'='1"
}
cleaned = SQLi.parse(data)
print(cleaned)
# Output: {'username': 'admin', 'password': 'potential payload'}
Installing
pip install sqlidps
Build from Source
cd sqlidps
pip install -r requirements.txt
flex -o sqlidps/lex.yy.c sqlidps/lexer.l
make sqlidps && make sqlidps clean
python sqlidps/train.py
pip install .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlidps-1.2.2.tar.gz.
File metadata
- Download URL: sqlidps-1.2.2.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fae16e70e5fc7b7d28bb985a51abf1c79fa02284cd6955d1401b985f832359a7
|
|
| MD5 |
3ab26c1a02cd32092616d9692c289eba
|
|
| BLAKE2b-256 |
813bb8db03d109777b6a38ef32e743191946fcc3ae4bd80785f81a135be23f61
|
File details
Details for the file sqlidps-1.2.2-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cfbf164c602ff863ca6d4c5ac73af9b41f99c478436ff40a6a836640fb7ca7a
|
|
| MD5 |
3301a32f9b773ea91a347ea3add02852
|
|
| BLAKE2b-256 |
ef622de57fadd4d28817905ae2cf9702e28f852c1381f2d7a65f4c7e5843dc4a
|
File details
Details for the file sqlidps-1.2.2-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.14, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cd73bd035ebacb61f476cca0d521b47a5030a627f1ae6b23813e1dd2493f051
|
|
| MD5 |
e5e70f4f340642fd3ce0f0e48af08fd6
|
|
| BLAKE2b-256 |
62d6e3f96fcbc2fc16218f4a164255478c1502c0e3dba754a14cd41583f4c03b
|
File details
Details for the file sqlidps-1.2.2-cp314-cp314-macosx_11_0_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp314-cp314-macosx_11_0_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.14, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d48a56a862d3dc888211e6820820f53ab4f216ba28ce38a8921e126e1b6e8861
|
|
| MD5 |
85b60b06baf0683fb1536e075f2a1f22
|
|
| BLAKE2b-256 |
28e281039f503ccc58706b854b9f91cf3938b1e2bebedca6e0e5580fd4634b12
|
File details
Details for the file sqlidps-1.2.2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
563340cd5631d6fb1fac290b595a8976d6912d7e6c65b2561b7e1cfb71823f20
|
|
| MD5 |
4e80ef20ba011b2996d6dfa23c573771
|
|
| BLAKE2b-256 |
00c6561b03f2ad1818769049daab2227022ae009be9e5cb96b0bf69ba007ecd1
|
File details
Details for the file sqlidps-1.2.2-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.13, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4256441e4d997f9b27dfd92b011f7cd2d91cb4b90bf8afec61898d6c80a0f8e8
|
|
| MD5 |
f6b0619766aab60ea52fdbcc6b7855e4
|
|
| BLAKE2b-256 |
d00567032eedf68384f42a5658ac0a44d41bc6e76c339aa2841c4294e88b7c04
|
File details
Details for the file sqlidps-1.2.2-cp313-cp313-macosx_10_13_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a45acc18971ed9b9e2307b0ba73128d26e5bb1b7b8f4f626efc4474144d2192
|
|
| MD5 |
8bdad595b819cbd9d3d38fab92acb9ff
|
|
| BLAKE2b-256 |
f97cec3058dc28883fa36a81f3bfd4a34849cd776a80fd2ec4442622a7550fe0
|
File details
Details for the file sqlidps-1.2.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c97520367ed178a48053dd299d7025715fbd4ea2022a2386274425b59337531f
|
|
| MD5 |
e3ff7837203cbc5868cd2edab038fd12
|
|
| BLAKE2b-256 |
aacb1da94e99a23b76ef483d705845055ec3a11fcd789b71fa888d2d730fe48c
|
File details
Details for the file sqlidps-1.2.2-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76b970fa6450c3e429d4e1475af9987d1e614117c04b33d1e4686d7393390167
|
|
| MD5 |
4ce83e11911014e5a0e28703a2ef976b
|
|
| BLAKE2b-256 |
55deafb90a272b8a6c0099a6eaf351e657c7310a33d334ecfd5fd6a0152e2b0e
|
File details
Details for the file sqlidps-1.2.2-cp312-cp312-macosx_10_13_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fef6b777faac9d86260a56a1cc6eb30f982ab3fa1092f0eede79cd2d081d512c
|
|
| MD5 |
87bc682b3240ba2b1605c8675cf22d89
|
|
| BLAKE2b-256 |
f36d9adbc9667f4186415150a70bfd3e84056bf66d80902090669295c142934b
|
File details
Details for the file sqlidps-1.2.2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d1edc24fabbf61948ef943caedb4819160cd0e33ad3e92212ea2e0db60e96ef
|
|
| MD5 |
a799453472211d4f40dc30d88f233803
|
|
| BLAKE2b-256 |
db7840bf12ada09ae7500e9618dd4caa6d2b143067e473e1dabc4bd7bc56b8c6
|
File details
Details for the file sqlidps-1.2.2-cp311-cp311-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp311-cp311-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38379aba46ef688cb519d292b4050604f5e3fb133bfa3f853b0cb64120577ffe
|
|
| MD5 |
eb436241cdcf78b9c1c2984991a6e363
|
|
| BLAKE2b-256 |
80403afe44d37f68e2fdecbefb7e5428b74693eae7d56ed91c2c5cd3b80d6dba
|
File details
Details for the file sqlidps-1.2.2-cp311-cp311-macosx_10_9_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e36f4c29a56d8efe01e4cf37034479ef0a5396acce85e9a5307acf447381eeb
|
|
| MD5 |
35db74b22a6f85ee3da7ff40156dad3d
|
|
| BLAKE2b-256 |
891d912167deb43cf7d5fcb8e3d9686dfacb7e8812bc64f57f8e10e5cd039633
|
File details
Details for the file sqlidps-1.2.2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98f5fbe97ec8ae2898bc677873643bbc5b3d99ddfa4e2aa996aef4f57a9a5563
|
|
| MD5 |
ad70f1a1a45390bc2c8a055c0fb95b1f
|
|
| BLAKE2b-256 |
fe4cca0948556c659560fe8e2b1db1c1f5fcdd97cafcbdf991c25825d4cdd35e
|
File details
Details for the file sqlidps-1.2.2-cp310-cp310-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp310-cp310-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f58b32a71c54f9596d8e2e9826830756bf7dd0a60f0b19d068263caf0ea668b6
|
|
| MD5 |
138961d884d4b7dcb8cc54a3788d38f5
|
|
| BLAKE2b-256 |
3e155bf0536d16c4d420af8e023f3259b23f63b94dddbf4d65fe5dab044bdcd8
|
File details
Details for the file sqlidps-1.2.2-cp310-cp310-macosx_10_9_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85182d9be72f6cb0bf51014870f1ad85bb82df1a67303b34b275f7005b7430f3
|
|
| MD5 |
793c6229963f4e9891d8519ba5672292
|
|
| BLAKE2b-256 |
023f5db452f291c960c5a3cbd576182df1b0e58fee5e17c522c9cab04187720e
|
File details
Details for the file sqlidps-1.2.2-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
937db1cbae654a2c6627051d684b4ba87df5e1878d82faec47a427dcd2ef76d5
|
|
| MD5 |
e6051659e5358ec035244a33f576fc76
|
|
| BLAKE2b-256 |
8b63e275a06f7a15e06d4903c29d206ea0fa913611f2c251cad53b95f2e124eb
|
File details
Details for the file sqlidps-1.2.2-cp39-cp39-manylinux1_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp39-cp39-manylinux1_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0907ccc4c88f88d9869886062a6f7d252721296e102aca3fc1726ea8d56a001a
|
|
| MD5 |
8242fc7f9691f360abaa18e7daac389f
|
|
| BLAKE2b-256 |
e76aa2cb5d6c32c5568efff34a84ef62b51312510b2025aa92443d8a1291e9e9
|
File details
Details for the file sqlidps-1.2.2-cp39-cp39-macosx_10_9_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f7fcce989a46eb9f6c7c1011974e7d3cf52d0654089f9a5f356e72ffcf04b0
|
|
| MD5 |
ba7fe5c19b036311e828dc644dca5c15
|
|
| BLAKE2b-256 |
311f9681667ffe62a7554a2449bccf71f976072c4d97f8ea558b80b875aa691d
|
File details
Details for the file sqlidps-1.2.2-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e5bc241c51fc7214a8940a9c21f90d3b0c01ee907555d1c88ff4377f97e6386
|
|
| MD5 |
72dca55edb03bf89c343db9b23acc85e
|
|
| BLAKE2b-256 |
bdefeb28dea3aa1b4836bf5efaa12f6b1f20e8c5959dbc9599c587c6b8d70cfd
|
File details
Details for the file sqlidps-1.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a9385e66eba162fcd0cc9c4039f816491e2073bb8c3908ed6888e8c35d60c38
|
|
| MD5 |
d37b77f4ca11263e6bcb77690466c5ad
|
|
| BLAKE2b-256 |
fd49e93afd10cf363328c5754efcdd52796f1a425a329a0e6b0c821e5845e8b7
|
File details
Details for the file sqlidps-1.2.2-cp38-cp38-macosx_11_0_universal2.whl.
File metadata
- Download URL: sqlidps-1.2.2-cp38-cp38-macosx_11_0_universal2.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
160b3cc4f366b4664b5fe806e7332546d6f119b2d43d2cc912cddb4a028bc2bd
|
|
| MD5 |
b3b454eb12129379979d8633e765e8c9
|
|
| BLAKE2b-256 |
3aa71a4c91a53430a00961a2a68e8e7c6b77b87a8d3fee6f67964eacfc756a10
|