📕 MANUALE DA CAMPO 11.1: AUTOMAZIONE & CI/CD (ARMAMENTO SU LARGA SCALA)
Classificazione: SOLO PER OCCHI DEL TEAM ROSSO
Classificazione: SOLO PER OCCHI DEL TEAM ROSSO
Obiettivo: Implementeremo capacità di attacco continuo e integreremo strumenti offensivi avanzati in flussi di lavoro automatizzati.
MITRE ATT&CK: T1558, T1595 (Active Scanning).
1. INTEL & RECON: ARSENALE MODERNO
Sección titulada «1. INTEL & RECON: ARSENAL MODERNO»Il vecchio sqlmap manuale è troppo lento per scansionare migliaia di asset. Abbiamo bisogno di velocità ed evasione.
STRUMENTO: NUCLEI (La Velocità)
Sección titulada «HERRAMIENTA: NUCLEI (La Velocidad)»Scanner basato su template YAML. Consente di definire la vulnerabilità esatta e lanciarla contro 10.000 host in pochi minuti.
Template YAML per SQLi Error-Based:
id: error-based-sqliinfo: name: Error Based SQL Injection severity: criticalrequests: - method: GET path: - "{{BaseURL}}/product?id=1'" matchers: - type: word words: - "You have an error in your SQL syntax" part: bodySTRUMENTO: GHAURI (L'Evasione)
Sección titulada «HERRAMIENTA: GHAURI (La Evasión)»Un'alternativa moderna a SQLMap scritta in Python.
- Vantaggio: È ottimizzato specificamente per la WAF Evasion e la gestione di header HTTP complessi.
- Uso: È simile a SQLMap ma con euristica migliore per rilevare iniezioni difficili.
ghauri -u "http://target.com/?id=1" --dbs
STRUMENTO: SQLMap API (L'Integrazione)
Sección titulada «HERRAMIENTA: SQLMap API (La Integración)»Non eseguiremo SQLMap dalla terminale. Lo eseguiremo come servizio REST in modo che i nostri script possano orchestrare gli attacchi.
- Avviare il server:
sqlmapapi -s - Creare task:
POST /task/new - Lanciare Scan:
POST /scan/<task_id>/start - Leggere Dati:
GET /scan/<task_id>/data
2. ARMAMENTO: INTEGRAZIONE CI/CD
Sección titulada «2. ARMAMENTO: INTEGRACIÓN CI/CD»Trasformeremo l'attacco in una fase dello sviluppo (“Purple Teaming Pipeline”).
GitHub Actions Workflow (Esempio):
Ogni volta che il team di sviluppo fa 'Push' su staging, attaccheremo.
name: Offensive Pipelineon: [push]jobs: security-test: runs-on: ubuntu-latest steps: - name: Deploy App run: ./deploy_staging.sh
- name: Nuclei Scan run: nuclei -u [https://staging-app.com](https://staging-app.com) -t sqli-templates/ -o vulnerabilities.txt
- name: Ghauri Deep Scan if: steps.nuclei.outputs.found == 'true' run: ghauri -u [https://staging-app.com/vuln-endpoint](https://staging-app.com/vuln-endpoint) --dbs3. VISIONE DEL TEAM PURPLE (DIFESA)
Sección titulada «3. VISIÓN DEL EQUIPO PURPLE (DEFENSA)»- Feedback Loop: Se Nuclei trova un errore nel pipeline, la “Build” deve fallire automaticamente.
- Falsi Positivi: Regoleremo i
matchersdei template di Nuclei per ridurre il rumore, basandoci sui messaggi di errore specifici del nostro stack tecnologico.

