Added protection for division by 0 in the enum_domain code

unstable
Meatballs1 2012-06-22 18:20:45 +01:00
parent 0d4feb9fce
commit 3519aff146
1 changed files with 5 additions and 1 deletions

View File

@ -365,7 +365,11 @@ class Metasploit3 < Msf::Post
result = client.railgun.netapi32.NetServerEnum(nil,100,4,buffersize,4,4,domain_enum,nil,nil)
# Estimate new buffer size on percentage recovered.
percent_found = (result['entriesread'].to_f/result['totalentries'].to_f)
buffersize = (buffersize/percent_found).to_i
if percent_found > 0
buffersize = (buffersize/percent_found).to_i
else
buffersize += 500
end
while result['return'] == 234
buffersize = buffersize + 500