From 2db697cd7a7cfa52e7d03bfb723ecfb30fb742a2 Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Wed, 21 Dec 2011 11:21:46 -0600 Subject: [PATCH] Fixup on checkpoint firewall module get() should get get_once() (intent is to get 4 bytes, not timeout after 4 seconds), no need to escape equals signs in regexes, no need to newline the unexpected responses. --- modules/auxiliary/gather/checkpoint_hostname.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auxiliary/gather/checkpoint_hostname.rb b/modules/auxiliary/gather/checkpoint_hostname.rb index 17ad406b1c..e8cf92b53f 100644 --- a/modules/auxiliary/gather/checkpoint_hostname.rb +++ b/modules/auxiliary/gather/checkpoint_hostname.rb @@ -51,19 +51,19 @@ class Metasploit3 < Msf::Auxiliary sock.put("\x51\x00\x00\x00") sock.put("\x00\x00\x00\x21") - res = sock.get(4) + res = sock.get_once(4) if (res == "Y\x00\x00\x00") print_good("Appears to be a CheckPoint Firewall...") sock.put("\x00\x00\x00\x0bsecuremote\x00") res = sock.get_once - if (res =~ /CN\=(.+),O\=(.+)\./i) + if (res =~ /CN=(.+),O=(.+)\./i) fw_hostname = $1 sc_hostname = $2 print_good("Firewall Host: #{fw_hostname}") print_good("SmartCenter Host: #{sc_hostname}") end else - print_error("Unexpected response:\r\n#{res.inspect}") + print_error("Unexpected response: '#{res.inspect}'") end report_info(fw_hostname,sc_hostname)