@@ -21,14 +21,14 @@ def initialize(info={})
21
21
This module simply attempts to login to a RFCode Reader web interface. Please note that
22
22
by default there is no authentication. In such a case, password brute force will not be performed.
23
23
If there is authentication configured, the module will attempt to find valid login credentials and
24
- capture device information.
24
+ capture device information.
25
25
} ,
26
26
'Author' =>
27
27
[
28
28
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
29
29
] ,
30
30
'Version' => '1.0' ,
31
- 'License' => MSF_LICENSE
31
+ 'License' => MSF_LICENSE
32
32
33
33
) )
34
34
@@ -49,13 +49,13 @@ def initialize(info={})
49
49
#
50
50
51
51
def run_host ( ip )
52
- if not is_app_rfreader?
52
+ unless is_app_rfreader?
53
53
print_error ( "Application does not appear to be RFCode Reader. Module will not continue." )
54
54
return
55
55
end
56
56
57
57
print_status ( "Checking if authentication is required..." )
58
- if not is_auth_required?
58
+ unless is_auth_required?
59
59
print_warning ( "Application does not require authentication." )
60
60
user = ''
61
61
pass = ''
@@ -102,7 +102,7 @@ def is_auth_required?
102
102
#
103
103
def do_login ( user , pass )
104
104
105
- vprint_status ( "Trying username:'#{ user } ' with password:'#{ pass } '" )
105
+ vprint_status ( "Trying username:'#{ user . inspect } ' with password:'#{ pass . inspect } '" )
106
106
begin
107
107
res = send_request_cgi (
108
108
{
@@ -112,10 +112,10 @@ def do_login(user, pass)
112
112
} )
113
113
114
114
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 } " )
116
116
return :skip_pass
117
117
else
118
- print_good ( "SUCCESSFUL LOGIN. '#{ user } ' : '#{ pass } '" )
118
+ print_good ( "SUCCESSFUL LOGIN. '#{ user . inspect } ' : '#{ pass . inspect } '" )
119
119
120
120
collect_info ( user , pass )
121
121
@@ -131,7 +131,7 @@ def do_login(user, pass)
131
131
report_auth_info ( report_hash )
132
132
return :next_user
133
133
end
134
- rescue ::Rex ::ConnectionError , Errno :: ECONNREFUSED , Errno ::ETIMEDOUT
134
+ rescue ::Rex ::ConnectionRefused , :: Rex :: HostUnreachable , :: Rex :: ConnectionTimeout , :: Rex :: ConnectionError , :: Errno ::EPIPE
135
135
print_error ( "HTTP Connection Failed, Aborting" )
136
136
return :abort
137
137
end
@@ -142,7 +142,7 @@ def do_login(user, pass)
142
142
#
143
143
def collect_info ( user , pass )
144
144
145
- vprint_status ( "Collecting information from app as '#{ user } ':'#{ pass } '..." )
145
+ vprint_status ( "Collecting information from app as '#{ user . inspect } ':'#{ pass . inspect } '..." )
146
146
begin
147
147
148
148
res = send_request_cgi (
0 commit comments