Skip to content

Commit eb0ae6e

Browse files
committed
Update rfcode_reader_enum.rb
Updated as per review comments
1 parent 6b8e6b3 commit eb0ae6e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

modules/auxiliary/scanner/http/rfcode_reader_enum.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ def initialize(info={})
2121
This module simply attempts to login to a RFCode Reader web interface. Please note that
2222
by default there is no authentication. In such a case, password brute force will not be performed.
2323
If there is authentication configured, the module will attempt to find valid login credentials and
24-
capture device information.
24+
capture device information.
2525
},
2626
'Author' =>
2727
[
2828
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
2929
],
3030
'Version' => '1.0',
31-
'License' => MSF_LICENSE
31+
'License' => MSF_LICENSE
3232

3333
))
3434

@@ -49,13 +49,13 @@ def initialize(info={})
4949
#
5050

5151
def run_host(ip)
52-
if not is_app_rfreader?
52+
unless is_app_rfreader?
5353
print_error("Application does not appear to be RFCode Reader. Module will not continue.")
5454
return
5555
end
5656

5757
print_status("Checking if authentication is required...")
58-
if not is_auth_required?
58+
unless is_auth_required?
5959
print_warning("Application does not require authentication.")
6060
user = ''
6161
pass = ''
@@ -102,7 +102,7 @@ def is_auth_required?
102102
#
103103
def do_login(user, pass)
104104

105-
vprint_status("Trying username:'#{user}' with password:'#{pass}'")
105+
vprint_status("Trying username:'#{user.inspect}' with password:'#{pass.inspect}'")
106106
begin
107107
res = send_request_cgi(
108108
{
@@ -112,10 +112,10 @@ def do_login(user, pass)
112112
})
113113

114114
if not res or res.code == 401
115-
vprint_error("FAILED LOGIN. '#{user}' : '#{pass}' with code #{res.code}")
115+
vprint_error("FAILED LOGIN. '#{user.inspect}' : '#{pass.inspect}' with code #{res.code}")
116116
return :skip_pass
117117
else
118-
print_good("SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
118+
print_good("SUCCESSFUL LOGIN. '#{user.inspect}' : '#{pass.inspect}'")
119119

120120
collect_info(user, pass)
121121

@@ -131,7 +131,7 @@ def do_login(user, pass)
131131
report_auth_info(report_hash)
132132
return :next_user
133133
end
134-
rescue ::Rex::ConnectionError, Errno::ECONNREFUSED, Errno::ETIMEDOUT
134+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
135135
print_error("HTTP Connection Failed, Aborting")
136136
return :abort
137137
end
@@ -142,7 +142,7 @@ def do_login(user, pass)
142142
#
143143
def collect_info(user, pass)
144144

145-
vprint_status("Collecting information from app as '#{user}':'#{pass}'...")
145+
vprint_status("Collecting information from app as '#{user.inspect}':'#{pass.inspect}'...")
146146
begin
147147

148148
res = send_request_cgi(

0 commit comments

Comments
 (0)