# Jenkins

## Enumeration

### Avec Metasploit

```
msf> use auxiliary/scanner/http/jenkins_enum
msf> use auxiliary/scanner/http/jenkins_command
```

### Sans Metasploit

Checker les endpoints:

```
/people
/asynchPeople
/securityRealm/user/admin/search/index?q={username}
/oops
/error
```

## Auth misconfig

Les problèmes de configuration fréquents pour les instances Jenkins sont les suivants:

* Droits guest ou admin par défaut
* Possibilité de créer un compte en tant qu'anonyme
* SSO Github/Bitbucket sans restriction d'entreprise (possibilité de se connecter avec un compte perso)
* Absence de protection anti-bruteforce
  * `msf> use auxiliary/scanner/http/jenkins_login`

## Authenticated attacks

### Recherche de secrets via builds dumping

```
$ git clone https://github.com/gquere/pwn_jenkins.git
$ cd dump_builds
$ python3 jenkins_dump_builds.py -u {username} -p {password} https://target.xyz:8080/ -o build_dumps
$ gitleaks detect --no-git -v
```

## RCE

## Outils

{% embed url="<https://github.com/gquere/pwn_jenkins>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.s1rn3tz.ovh/pentest-web/autre/jenkins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
