From cce4aafd9b117fece134a265cb4b7ae4548c3116 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Wed, 12 Oct 2011 20:14:58 +0000 Subject: [PATCH] Tweak the snmp_login code to actually only poll response packets every 10 sent and break out of infinite loop in the case of a target going crazy and continuously replying git-svn-id: file:///home/svn/framework3/trunk@13891 4d416f70-5f16-0410-b530-b9f4589650da --- modules/auxiliary/scanner/snmp/snmp_login.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/auxiliary/scanner/snmp/snmp_login.rb b/modules/auxiliary/scanner/snmp/snmp_login.rb index 5b252bbee3..e4a62025b5 100644 --- a/modules/auxiliary/scanner/snmp/snmp_login.rb +++ b/modules/auxiliary/scanner/snmp/snmp_login.rb @@ -93,15 +93,18 @@ class Metasploit3 < Msf::Auxiliary parse_reply(r) end end + + idx += 1 end end - while (r = udp_sock.recvfrom(65535, 3) and r[1]) + idx = 0 + while (r = udp_sock.recvfrom(65535, 3) and r[1] and idx < 500) parse_reply(r) + idx += 1 end - if @found.keys.length > 0 print_status("Validating scan results from #{@found.keys.length} hosts...") end