| name | socmint-automation-framework |
| description | SOCMINT — framework d'automatisation d'enquêtes, orchestration multi-outils, pipelines de collecte, gestion de preuves, rapports automatisés et chaîne de traçabilité. |
| category | cybersecurite |
| author | EVA |
| version | 1 |
| tags | ["socmint","automation","framework","orchestration","pipeline","reporting","forensics","chain-of-custody"] |
SOCMINT : Framework d'Automatisation
🎯 Description
Framework complet pour automatiser les enquêtes SOCMINT de bout en bout : orchestration des outils OSINT, pipelines de collecte parallélisés, gestion de preuves avec chaîne de traçabilité, rapports automatisés, et déploiement d'agents de surveillance persistants.
Ce skill transforme l'approche artisanale (outil par outil, copier-coller manuel) en pipeline industrialisé reproductible et scalable.
🏗️ Architecture du Framework
[Phase 1 : Ciblage] [Phase 2 : Collecte] [Phase 3 : Analyse] [Phase 4 : Rapport]
│ │ │ │
▼ ▼ ▼ ▼
┌──────────┐ ┌──────────────────┐ ┌──────────────┐ ┌──────────────┐
│ Identifier │ │ Scraper parallele │ │Analyse Graphe │ │ Rapport PDF │
│ cible │──▶ │ + API + OSINT tools │──▶ │ + NLP + │──▶ │ + Dashboard │
│ (username,│ │ (multi-thread) │ │Corrélation │ │ + Archive │
│ email, ID)│ └──────────────────┘ └──────────────┘ └──────────────┘
└──────────┘ │ │ │
▼ ▼ ▼
┌──────────────────┐ ┌──────────────┐ ┌──────────────┐
│ Cache SQLite + │ │ Evidence │ │ Wayback + │
│ Screenshots PNG │ │ DB (forensic)│ │ Blockchain │
└──────────────────┘ └──────────────┘ └──────────────┘
📦 Socle : socmint-core.py
Structure du Framework
import json
import sqlite3
import hashlib
from datetime import datetime
from typing import Dict, List, Optional
from pathlib import Path
class SOCMINTCase:
"""Gestion de cas d'enquête SOCMINT avec chaîne de traçabilité"""
def __init__(self, case_name: str, investigator: str):
self.case_name = case_name
self.investigator = investigator
self.case_dir = Path(f"cases/{case_name}_{datetime.now():%Y%m%d_%H%M%S}")
self.case_dir.mkdir(parents=True, exist_ok=True)
self.db_path = self.case_dir / "evidence.db"
self.init_db()
self.log_file = self.case_dir / "audit_log.json"
self.actions = []
def init_db(self):
"""Base de données forensique avec hash de chaque élément"""
conn = sqlite3.connect(self.db_path)
conn.execute()
conn.execute()
conn.commit()
conn.close()
() -> :
sha256 = hashlib.sha256(raw_data.encode()).hexdigest()
conn = sqlite3.connect(.db_path)
cur = conn.execute(, (source, platform, target, content_type, raw_data, sha256,
datetime.now().isoformat(), .investigator, notes))
evidence_id = cur.lastrowid
conn.commit()
conn.close()
.log_action(,
)
evidence_id
():
entry = {
: datetime.now().isoformat(),
: action,
: .investigator,
: description
}
.actions.append(entry)
(.log_file, ) f:
json.dump(.actions, f, indent=)
() -> :
{
: .case_name,
: .investigator,
: (.case_dir.name),
: (.actions),
: (.db_path),
: (.log_file)
}
🔧 Modules Automatisés
Module 1 : Collecte Automatique Multi-Plateforme
import asyncio
from concurrent.futures import ThreadPoolExecutor
class SOCMINTCollector:
def __init__(self, case: SOCMINTCase, target_config: Dict):
self.case = case
self.config = target_config
def collect_all(self):
"""Lance la collecte sur toutes les cibles en parallèle"""
targets = self.config.get("targets", [])
collectors = {
"username": self.collect_username,
"email": self.collect_email,
"phone": self.collect_phone,
"domain": self.collect_domain,
}
with ThreadPoolExecutor(max_workers=5) as executor:
futures = []
for target in targets:
collector = collectors.get(target["type"])
if collector:
futures.append(executor.submit(collector, target["value"]))
results = [f.result() for f in futures]
self.case.log_action("COLLECTION_COMPLETE",
f" targets collected")
results
():
subprocess run
result_m = run([, username, ,
, ],
capture_output=, timeout=)
..add_evidence(, , username, ,
result_m.stdout.decode())
result_b = run([, , username, , ,
, ],
capture_output=, timeout=)
..add_evidence(, , username, ,
result_b.stdout.decode())
{: username, : , : }
Module 2 : Screenshot Automatisé
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
class SOCMINTScreenshotter:
def __init__(self):
options = Options()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--window-size=1920x1080")
options.add_argument(
"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0"
)
self.driver = webdriver.Chrome(options=options)
def screenshot_profile(self, platform: str, username: str, save_path: Path):
urls = {
"twitter": f"https://x.com/{username}",
"instagram": f"https://instagram.com/{username}",
"reddit": f"https://reddit.com/u/{username}",
"tiktok": f"https://tiktok.com/@{username}",
"github": f"https://github.com/{username}",
}
url = urls.get(platform)
if not url:
return None
self.driver.get(url)
time.sleep(3)
screenshot_path = save_path /
.driver.save_screenshot((screenshot_path))
screenshot_path
():
.driver.quit()
Module 3 : Analyse Automatisée
import networkx as nx
import json
from datetime import datetime
class SOCMINTAnalyzer:
def __init__(self, case: SOCMINTCase):
self.case = case
def analyze_network(self, followers_data: List[Dict]):
"""Analyse du graphe social"""
G = nx.DiGraph()
for item in followers_data:
G.add_edge(item["follower"], item["target"])
return {
"density": nx.density(G),
"communities": len(list(nx.community.greedy_modularity_communities(
G.to_undirected()))),
"top_influencers": sorted(
nx.betweenness_centrality(G).items(),
key=lambda x: x[1], reverse=True
)[:10]
}
def analyze_temporal(self, posts: List[Dict]):
"""Analyse temporelle des posts"""
hours = [datetime.fromisoformat(p["created_at"]).hour for p in posts]
days = [datetime.fromisoformat(p["created_at"]).strftime() p posts]
collections Counter
{
: Counter(hours).most_common()[][],
: Counter(days).most_common()[][],
: (posts) / (, ((hours) - (hours)))
}
():
matrix = {}
a accounts:
signals =
a.get(): signals +=
a.get(): signals +=
a.get(): signals +=
a.get(): signals +=
a.get(): signals +=
confidence = signals >= \
signals >= \
signals >=
matrix[a[]] = confidence
matrix
📄 Générateur de Rapports Automatisé
class SOCMINTReport:
def __init__(self, case: SOCMINTCase, analyzer: SOCMINTAnalyzer):
self.case = case
self.analyzer = analyzer
def generate_markdown(self) -> str:
"""Génère un rapport Markdown complet"""
conn = sqlite3.connect(self.case.db_path)
evidence_count = conn.execute("SELECT COUNT(*) FROM evidence").fetchone()[0]
platforms = conn.execute(
"SELECT platform, COUNT(*) FROM evidence GROUP BY platform"
).fetchall()
conn.close()
import datetime
now = datetime.datetime.now()
report = f"""# Rapport SOCMINT : {self.case.case_name}
**Investigateur** : {self.case.investigator}
**Date** : {now.strftime('%Y-%m-%d %H:%M')}
**ID Cas** : {self.case.case_dir.name}
---
## Résumé
- **Preuves collectées** : {evidence_count}
- **Plateformes couvertes** : {len(platforms)}
"""
for p, c in platforms:
report += f" - {p}: {c} items\n"
report += """
## Chaîne de Traçabilité
| # | Plateforme | Type | Hash SHA256 | Horodatage |
|---|-----------|------|-------------|------------|
"""
conn = sqlite3.connect(self..db_path)
rows = conn.execute(
).fetchall()
r rows:
report +=
conn.close()
report +=
report
():
subprocess
subprocess.run([
, (markdown_path),
, (markdown_path.with_suffix()),
], check=)
🚀 Pipeline Complet
"""socmint_pipeline.py — Pipeline d'enquête automatisée"""
from socmint_core import SOCMINTCase
from socmint_collect import SOCMINTCollector
from socmint_analyze import SOCMINTAnalyzer
from socmint_report import SOCMINTReport
def run_full_investigation(target_config: Dict, investigator: str = "EVA"):
"""
Pipeline complet SOCMINT :
1. Initialisation du cas
2. Collecte multi-cible
3. Analyse des données
4. Génération du rapport
"""
case = SOCMINTCase(
case_name=target_config.get("name", "anonymous"),
investigator=investigator
)
case.log_action("CASE_CREATED", f"Target: {target_config.get('name')}")
collector = SOCMINTCollector(case, target_config)
collector.collect_all()
analyzer = SOCMINTAnalyzer(case)
report = SOCMINTReport(case, analyzer)
md = report.generate_markdown()
report_path = case.case_dir / "report.md"
report_path.write_text(md)
print(f"✅ Enquête terminée : {case.case_dir}")
print(f"📄 Rapport : ")
()
📊 Templates de Rapports
Structure Standard
1. HEADER — Informations du cas
2. RÉSUMÉ EXÉCUTIF — Synthèse 1 page
3. MÉTHODOLOGIE — Outils et techniques utilisés
4. COLLECTE — Plateformes, cibles, données recueillies
5. ANALYSE — Corrélations, graphes, timelines
6. PREUVES — Tableau avec SHA256, source, timestamp
7. CHAÎNE DE TRAÇABILITÉ — Historique des actions
8. CONCLUSIONS — Certitudes, probabilités, lacunes
9. ANNEXES — Screenshots, exports bruts
Exemple Automatique
python3 socmint_pipeline.py --name "John Doe Investigation" \
--username johndoe \
--email john@example.com \
--phone "+33612345678" \
--output ~/cases/
🛠️ Orchestration avec Cron
0 6 * * * aza /usr/bin/python3 /home/aza/socmint/monitor_pipeline.py \
--target "@target_username" \
--webhook "https://discord.com/api/webhooks/..." \
--output /home/aza/cases/monitoring/
0 9 * * 1 aza /usr/bin/python3 /home/aza/socmint/weekly_report.py \
--case /home/aza/cases/monitoring/latest/
📁 Structure du Cas (Output)
cases/Enquete_X_20250722_143022/
├── evidence.db # Base SQLite forensique
├── audit_log.json # Journal d'audit complet
├── report.md # Rapport Markdown
├── report.pdf # Rapport PDF (via pandoc)
├── screenshots/ # Captures d'écran
│ ├── twitter_johndoe.png
│ ├── instagram_johndoe.png
│ └── reddit_johndoe.png
├── exports/ # Données brutes
│ ├── maigret_johndoe.json
│ ├── blackbird_johndoe.json
│ └── holehe_john@example.com.json
└── graph/ # Analyses
├── social_graph.html
├── timeline.png
└── correlation.json
⚠️ Pitfalls
- Dépendances fragiles : 15+ outils avec des APIs qui changent — tests réguliers nécessaires
- Rate limiting : la parallélisation agressive peut faire bannir les IPs
- Stockage : une enquête complète peut générer 50-500 Mo de screenshots + données
- Chaîne de traçabilité : toute modification manuelle des preuves casse la chaîne — toujours utiliser l'API
- Sécurité : les données d'enquête contiennent des informations sensibles — chiffrer le dossier case
- Pandoc : nécessaire pour la conversion PDF (sinon, Markdown uniquement)
- Évolutivité : pour 100+ cibles, passer à une queue Redis + workers Celery