From 89279b680a54260e2f514148e89b578b5fc0dbb3 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Mon, 23 Jan 2012 15:15:49 -0600 Subject: [PATCH] Fix fh, trailing comma, and ruby loop syntax --- modules/auxiliary/gather/d20pass.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/auxiliary/gather/d20pass.rb b/modules/auxiliary/gather/d20pass.rb index 4ddeec8e98..ec7d3019a8 100644 --- a/modules/auxiliary/gather/d20pass.rb +++ b/modules/auxiliary/gather/d20pass.rb @@ -32,7 +32,7 @@ class Metasploit3 < Msf::Auxiliary 'Author' => [ 'K. Reid Wightman ' ], 'License' => MSF_LICENSE, 'Version' => '$Revision: 1 $', - 'DisclosureDate' => 'Jan 19 2012', + 'DisclosureDate' => 'Jan 19 2012' )) register_options( @@ -200,8 +200,8 @@ class Metasploit3 < Msf::Auxiliary 'Header' => "D20 usernames, passwords, and account levels\n(use for TELNET authentication)", 'Indent' => 1, 'Columns' => ["Type", "User Name", "Password"]) - range = Range.new(0, numentries - 1) - range.each do |i| + + 0.upto(numentries -1).each |i| f.seek(dstart + headerlen + i * entrylen) accounttype = makeword(f.read(2)) f.seek(dstart + headerlen + i * entrylen + 2) @@ -241,7 +241,7 @@ class Metasploit3 < Msf::Auxiliary def parse(fh) print_status("Parsing file") - f = File.open(fh, 'rb') + f = File.open(fh.path, 'rb') used = f.read(4) if used != "USED" print_error "Invalid Configuration File!"