How can i find a Jenkins dashboard and ended up with Reverse Shell on shodan
An exposed Jenkins dashboard allowed unauthenticated users to modify a pipeline job that ran as root, enabling arbitrary command execution. The attacker used this to establish a reverse shell with root access.
Published on medium.com
Security misconfigurations in Jenkins dashboards can lead to devastating consequences. While exploring Shodan, I discovered an exposed Jenkins instance in Indonesia that allowed me to execute arbitrary commands — ultimately leading to a reverse shell with root access.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Jenkins instance was publicly accessible without authentication and its pipeline jobs ran with root privileges, allowing unauthenticated users to modify and execute commands.
Impact
An attacker could execute arbitrary commands as root and gain a reverse shell, leading to full system compromise.
What the attacker needed
Exposed Jenkins instance; No authentication required; Pipeline job running as root
The fix
The Jenkins instance should be protected with authentication, pipeline commands should be restricted, and it should not run as root or be publicly exposed.
How it was found
- Search Shodan for Jenkins dashboards using a specific query.
- Identify an exposed Jenkins instance running a pipeline job.
- Modify the pipeline command to run 'whoami' and observe the output.
- Test outbound connectivity by pinging an external address.
- Set up a Netcat listener and execute a reverse shell command via SSH.
- Receive a reverse shell connection with root access.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Jenkins is a tool that automates software building and testing. If it is left open to the internet without a password, anyone can change the jobs it runs. Because those jobs run with high privileges, an attacker can make the server run their own commands and take control.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.