Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
urllib3
pyminizip
pyzipper
pyzipper
streamlit
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ install_requires =
urllib3
pyminizip
pyzipper
streamlit

[options.entry_points]
console_scripts =
theZoo = theZoo:main
theZoo-gui = theZoo_gui:run
theZoo-streamlit = theZoo_streamlit:main
89 changes: 89 additions & 0 deletions theZoo_streamlit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import streamlit as st
from typing import List, Tuple

from imports.db_handler import DBHandler


def _load_partial() -> List[Tuple]:
db = DBHandler()
return db.get_partial_details()


def _load_details(mal_id: int) -> List[Tuple]:
db = DBHandler()
return db.get_mal_info(mal_id)


def main() -> None:
st.set_page_config(page_title="theZoo Streamlit", layout="wide")

st.title("theZoo – Malware DB (Streamlit)")

search = st.text_input("Filter by any field")

rows = _load_partial()
if search:
q = search.lower().strip()
if q:
rows = [
row for row in rows
if any(q in str(value).lower() for value in row)
]

if not rows:
st.info("No results.")
return

table_rows = [
{
"ID": row[0],
"Type": row[1],
"Language": row[2],
"Architecture": row[3],
"Platform": row[4],
"Name": row[5],
}
for row in rows
]

st.dataframe(table_rows, hide_index=True, use_container_width=True)

ids = [row["ID"] for row in table_rows]
selected_id = st.selectbox("Select malware ID for details", ids)

if selected_id is None:
return

details = _load_details(int(selected_id))
if not details:
st.warning("No additional metadata found for this entry.")
return

(
mal_type,
name,
version,
author,
language,
date,
architecture,
platform,
tags,
) = details[0]

st.subheader("Details")
st.write({
"Name": name,
"Type": mal_type,
"Version": version,
"Author": author,
"Language": language,
"Date": date,
"Architecture": architecture,
"Platform": platform,
"Tags": tags,
})


if __name__ == "__main__":
main()