Hacking-factory / scripts /analyzer.py
1Egyb's picture
Create scripts/analyzer.py
bc67076 verified
import sqlite3
import json
import os
# import malwoverview (افتراضي)
DB_PATH = "/app/data/factory.db"
def connect_db():
return sqlite3.connect(DB_PATH)
def fetch_intel(malware_family):
"""
يقوم بجلب معلومات عن فيروس معين وتخزينها في القاعدة
لكي يستخدمها Qwen كمرجع.
"""
print(f"[*] Fetching intel for: {malware_family}")
# محاكاة جلب بيانات (هنا تضع كود malwoverview الحقيقي)
fake_intel = {
"family": malware_family,
"technique": "Process Hollowing via syscalls",
"yara_rule": "rule detection { strings: $a = \"kernel32\" ... }"
}
conn = connect_db()
cursor = conn.cursor()
cursor.execute("""
INSERT INTO malware_refs (family_name, technique, detection_rules)
VALUES (?, ?, ?)
""", (fake_intel['family'], fake_intel['technique'], fake_intel['yara_rule']))
conn.commit()
conn.close()
print("[+] Intel stored in database.")
if __name__ == "__main__":
# مثال للاستخدام
fetch_intel("AgentTesla")