Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- app.py +26 -0
- model.h5 +3 -0
- requirements.txt +3 -0
- xss_detection_model-3.h5 +3 -0
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import tensorflow as tf
|
| 3 |
+
import pickle
|
| 4 |
+
|
| 5 |
+
# Model ve Vectorizer'ı yükleme
|
| 6 |
+
model = tf.keras.models.load_model("xss_detection_model-3.h5")
|
| 7 |
+
|
| 8 |
+
with open("vectorizer.pkl", "rb") as file:
|
| 9 |
+
vectorizer = pickle.load(file)
|
| 10 |
+
|
| 11 |
+
# Streamlit başlığı
|
| 12 |
+
st.title("XSS Detector")
|
| 13 |
+
|
| 14 |
+
# Kullanıcı girdisi
|
| 15 |
+
user_input = st.text_area("XSS payload'ınızı buraya girin", height=100)
|
| 16 |
+
|
| 17 |
+
# Tespit butonu
|
| 18 |
+
if st.button("Tespit Et"):
|
| 19 |
+
transformed_input = vectorizer.transform([user_input]).toarray()
|
| 20 |
+
prediction = model.predict(transformed_input)
|
| 21 |
+
|
| 22 |
+
# Sonucu ekranda gösterme
|
| 23 |
+
if prediction[0] > 0.5:
|
| 24 |
+
st.write("Bu bir XSS payload!")
|
| 25 |
+
else:
|
| 26 |
+
st.write("Bu bir XSS payload DEĞİL!")
|
model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:774888e42c2f547fef2cab476fe86ae4ba004441540e3c3bec32543ee395803a
|
| 3 |
+
size 20314872
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
tensorflow
|
| 3 |
+
pickle-mixin
|
xss_detection_model-3.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f132cd032e4a7163d1ee98b5db4beb6578cef6e42a95e3b9c7a5160d7069f29c
|
| 3 |
+
size 306960
|