jehanzada's picture
Update app.py
2102b5f verified
import gradio as gr
from utils import analyze_url, password_strength
from phishing_model import detect_phishing
from ai_advisor import ai_advisor
with gr.Blocks(title="AI Cyber Security Tool") as app:
gr.Markdown("# πŸ” AI Cyber Security Tool")
# URL Analyzer
with gr.Tab("πŸ”— URL & Domain Analyzer"):
url_input = gr.Textbox(label="Enter URL")
url_output = gr.Textbox(label="Result")
gr.Button("Scan").click(analyze_url, inputs=url_input, outputs=url_output)
# Password Analyzer
with gr.Tab("πŸ”‘ Password Analyzer"):
pass_input = gr.Textbox(label="Enter Password", type="password")
pass_output = gr.Textbox(label="Result")
gr.Button("Check").click(password_strength, inputs=pass_input, outputs=pass_output)
# Phishing Detector
with gr.Tab("πŸ“§ Phishing Detector"):
phishing_input = gr.Textbox(label="Enter URL or Email Text")
phishing_output = gr.Textbox(label="Result")
gr.Button("Analyze").click(detect_phishing, inputs=phishing_input, outputs=phishing_output)
# AI Security Advisor
with gr.Tab("πŸ€– AI Security Advisor"):
q_input = gr.Textbox(label="Ask Security Question")
q_output = gr.Textbox(label="Answer")
gr.Button("Ask").click(ai_advisor, inputs=q_input, outputs=q_output)
app.launch()