Views
No views yet
benign or malicious.https://huggingface.co/netgoat-ai/koda-waf-2koda_waf_2_advanced.joblib1method
2path
3query
4headers
5bodyDataFrame with those columns.pip install huggingface_hub joblib pandas scikit-learn1import joblib
2import pandas as pd
3from huggingface_hub import hf_hub_download
4
5
6model_path = hf_hub_download(
7 repo_id="netgoat-ai/koda-waf-2",
8 filename="koda_waf_2_advanced.joblib",
9)
10
11payload = joblib.load(model_path)
12model = payload["model"]
13
14request = pd.DataFrame(
15 [
16 {
17 "method": "GET",
18 "path": "/api/search",
19 "query": "q=' OR '1'='1",
20 "headers": "user-agent:test-client",
21 "body": "",
22 }
23 ]
24)
25
26label = model.predict(request)[0]
27classes = list(model.classes_)
28probabilities = model.predict_proba(request)[0]
29
30print("label:", label)
31print(dict(zip(classes, probabilities)))1{
2 "method": "GET",
3 "path": "/api/search",
4 "query": "q=laptop&page=1",
5 "headers": "user-agent:browser accept:application/json",
6 "body": "",
7}1{
2 "method": "GET",
3 "path": "/api/search",
4 "query": "q=' OR '1'='1",
5 "headers": "user-agent:test-client",
6 "body": "",
7}koda_waf_2_advanced.joblib:1accuracy: 0.9853
2
3benign precision 1.00 recall 0.98 f1 0.99
4malicious precision 0.97 recall 1.00 f1 0.98115,000 rows
28,801 benign
36,199 malicious.joblib model artifact. Joblib uses Python pickle under the hood, and pickle files can execute code when loaded. Only load this model if you trust the repository and artifact.