Kit-1 Lite
A small, fast model that reads a URL path and says whether it looks like an attack.
It sorts each request into one of four labels:
| label | what it means |
|---|---|
safe |
a normal request |
traversal |
path traversal (../../etc/passwd and friends) |
xss |
cross-site scripting |
sqli |
SQL injection |
- Tiny: 115,716 parameters, 466 KB of weights
- No GPU, no PyTorch: runs on NumPy alone, about 30 MB of RAM*
- Open: MIT licence, free to use, test, break and improve
*Measured on our own machine. Actual memory use depends on your system, Python and NumPy version.
Made by WardenFox.
Quick start
pip install numpy
python3 infer.py "/../../etc/passwd" "/index.html" "/search?q=<script>alert(1)</script>"
traversal (conf=1.0000 ...) '/../../etc/passwd'
safe (conf=0.9941 ...) '/index.html'
xss (conf=1.0000 ...) '/search?q=<script>alert(1)</script>'
It also reads a file (python3 infer.py -f urls.txt) or stdin.
From Python:
from infer import logits_one, softmax, LABELS
p = softmax(logits_one("/item?id=1' OR '1'='1"))
print(LABELS[p.argmax()], p.max()) # sqli 1.0
Files
| file | what |
|---|---|
kit1_lite.npz |
the weights |
kit1_lite_vocab.json |
character vocabulary, max_len (200), label names |
infer.py |
NumPy-only inference |
LICENSE, NOTICE, LICENSES/ |
licence and training-data attributions |
How it works
A character-level CNN: each character is embedded, four convolution widths (2–5 characters) scan the string, each is max-pooled, and one linear layer picks the label. Input is cut or padded to 200 characters.
Results
On a held-out test set made of attack families the model never saw in training (whole families were kept out, so it can't just memorise near-duplicates):
| metric | score |
|---|---|
| accuracy | 0.9989 |
| macro F1 | 0.996 |
| safe requests wrongly flagged | 0.08% |
These numbers are from our own test set. Real traffic is different on every site, so check it on your own data before relying on it. Your results may not match ours.
Benign inputs that often fool simple filters, like names with apostrophes (O'Brien) and harmless HTML formatting tags (<em>, <blockquote>), were added to training as safe examples.
Limits
- Decode first. It is trained on plain text. URL-decode / normalise the request before passing it in. Encoded attacks like
%2e%2e%2fcan slip through by design. - Four classes only. It doesn't know about command injection, SSRF, file inclusion or anything else outside the labels above.
- Edge cases. Maths with bare
</>and a lone'can get low-confidence wrong answers. Use the confidence score. - Not a firewall on its own. Use it as one signal alongside your normal security, for example to see what kinds of requests are reaching your server.
Disclaimer
Use at your own risk. Kit-1 Lite is provided "as is", with no warranty of any kind, express or implied, including any warranty that it is fit for a particular purpose, that it will catch every attack, or that it won't flag harmless requests.
It is a research tool, not a security product, and it is not a replacement for a firewall, security audit or professional advice. You are responsible for how you use it and for testing it before relying on it. WardenFox and its authors are not liable for any damage, data loss, breach, downtime or other harm that comes from using it or relying on its output.
Full terms are in the MIT licence (LICENSE).
Training data
Normal requests are real-world data: about 10,000 URL paths from ordinary websites, plus hand-written harmless cases that trip up simple filters (names with apostrophes, HTML formatting tags, maths symbols).
Attack examples come from real-life attack traffic, plus public payload collections wrapped into realistic URL paths:
- SecLists (MIT)
- PayloadsAllTheThings (MIT)
- fuzzdb (CC BY 3.0)
See NOTICE and LICENSES/. These projects don't endorse WardenFox.
Licence
MIT. See LICENSE.