Ir al contenido

📕 FIELD MANUAL 11.1: AUTOMATION & CI/CD (SCALED ARMAMENT)

Classification: RED TEAM EYES ONLY

0views

Classification: RED TEAM EYES ONLY

Objective: We will implement continuous attack capabilities and integrate advanced offensive tools into automated workflows.

MITRE ATT&CK: T1558, T1595 (Active Scanning).

The old sqlmap manual is slow to scan thousands of assets. We need speed and evasion.

Template-based YAML scanner. Allows defining the exact vulnerability and launching it against 10,000 hosts in minutes.

YAML Template for Error-Based SQLi:

id: error-based-sqli
info:
name: Error Based SQL Injection
severity: critical
requests:
- method: GET
path:
- "{{BaseURL}}/product?id=1'"
matchers:
- type: word
words:
- "You have an error in your SQL syntax"
part: body

A modern alternative to SQLMap written in Python.

  • Advantage: It is specifically optimized for WAF Evasion and handling complex HTTP headers.
  • Usage: It is similar to SQLMap but with better heuristics to detect difficult injections. ghauri -u "http://target.com/?id=1" --dbs

We won't run SQLMap from the terminal. We'll run it as a REST service so our own scripts can orchestrate attacks.

  1. Start Server: sqlmapapi -s
  2. Create Task: POST /task/new
  3. Launch Scan: POST /scan/<task_id>/start
  4. Read Data: GET /scan/<task_id>/data

We will transform the attack into a development phase (“Purple Teaming Pipeline”).

GitHub Actions Workflow (Example): Every time the development team performs a “Push” to staging, we will attack.

name: Offensive Pipeline
on: [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) --dbs
  • Feedback Loop: If Nuclei finds a flaw in the pipeline, the “Build” must fail automatically.
  • False Positives: We will adjust the matchers of the Nuclei templates to reduce noise based on the specific error messages from our technology stack.