init commit
This commit is contained in:
15
lab5/test_xss.py
Normal file
15
lab5/test_xss.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import joblib
|
||||
|
||||
vectorizer = joblib.load("xss_vectorizer.joblib")
|
||||
clf = joblib.load("xss_classifier.joblib")
|
||||
|
||||
print("Type text to classify. Ctrl+C or empty line to quit.\n")
|
||||
while True:
|
||||
text = input("> ").strip()
|
||||
if not text:
|
||||
break
|
||||
X = vectorizer.transform([text])
|
||||
pred = clf.predict(X)[0]
|
||||
verdict = "MALICIOUS" if pred == 1 else "benign"
|
||||
print(f"[{verdict}] {text}\n")
|
||||
|
||||
Reference in New Issue
Block a user