streamlit gui with a title,description, input box for blog url, loading bar for results and when results are ready show found keywords (tags), questions and answers, and found IOCs
To upload files, please first save the app
import streamlit as st
import time
import random
def analyze_blog(url):
"""Simulate blog analysis - in a real app this would do actual analysis"""
# Simulate processing time
progress_bar = st.progress(0)
for i in range(100):
time.sleep(0.05)
progress_bar.progress(i + 1)
# Sample results - in real app these would be actual analysis results
tags = ["security", "malware", "ransomware", "threat-actor", "vulnerability"]
qa_pairs = [
{"question": "What is the main topic?", "answer": "Cyber security incident analysis"},
{"question": "When did the attack occur?", "answer": "March 15, 2023"},
{"question": "What was the attack vector?", "answer": "Phishing email with malicious attachment"}
]
iocs = [
{"type": "IP", "value": "192.168.1.100", "description": "C2 server"},
{"type": "Hash", "value": "a1b2c3d4e5f6", "description": "Malware hash"},
{"type": "Domain", "value": "evil.example.com", "description": "Malicious domain"}
]
return tags, qa_pairs, iocs
# Page config
st.set_page_config(page_title="Blog Analyzer", layout="wide")
# Title and description
st.title("🔍 Blog Analysis Tool")
st.markdown("""
This tool analyzes blog posts to extract relevant information:
- Keywords/Tags
- Questions & Answers
- Indicators of Compromise (IOCs)
""")
# Input
url = st.text_input("Enter blog URL", placeholder="https://example.com/blog-post")
if url:
with st.spinner("Analyzing blog content..."):
tags, qa_pairs, iocs = analyze_blog(url)
# Display results in columns
col1, col2, col3 = st.columns(3)
with col1:
st.subheader("🏷️ Keywords/Tags")
for tag in tags:
st.markdown(f"- {tag}")
with col2:
st.subheader("❓ Q&A")
for qa in qa_pairs:
st.markdown(f"**Q:** {qa['question']}")
st.markdown(f"**A:** {qa['answer']}")
st.markdown("---")
with col3:
st.subheader("🎯 IOCs")
for ioc in iocs:
st.markdown(f"**Type:** {ioc['type']}")
st.markdown(f"**Value:** `{ioc['value']}`")
st.markdown(f"**Description:** {ioc['description']}")
st.markdown("---")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?