Jenkins

Introduction

Jenkins is a free and open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.

Jenkins Login.

Enumeration

We can obtain a some valuable information without necessarily log in on the server.

Jenkins Version

Visit the following route to obtain the Jenkins version on the footer page.

Users

Without credentials it is possible to obtain some users.

Credentials

There are no default credentials but some times these works.

In new versions the password is randomized at installation. We can find the initial password here:

  • Linux

  • Windows

From Admin to Reverse Shell

There are multiple ways in which from administrative privileges in Jenkins you can get a reverse shell.

Script Console

To obtain a Reverse shell we need to execute Manage Jenkins on Script Console.

Jenking Script Console.

Windows Reverse Shell

Linux Reverse Shell

First we need to craft the payload.

And introduce inside the Grovvy script.

Freestyle Project

Go on New Item tab.

Jenkins Dashboard

Introduce a name such as Access and select Freestyle Project .

Jenkins Creating a New Item.

Scroll down until you find the Build section and add a Execute Windows batch command as build step.

Jenkins Execute Windows Batch Command.

Introduce the reverse shell on the Command window and click Save.

Go to Build Now section.

Jenkins Build Now section.

When the build is executed a new item will be displayed under the Build History.

Jenkins Build History.

At that moment a reverse shell is obtained.

We can also check the console output selecting the Built Item #1 and going to Console Output section.

Jenkins Console Output.

Last updated

Was this helpful?