Skip to content

Commit 6188df1

Browse files
committed
added note :type - Info. This is mandatory field for report_note. also, vprint statements seem to be adding an extra space with a hyphen. kinda make print dis-aligned than other regular print_* statements. changed -> to -, removed ' from '#{user/pass}'. works fine. msftidy check. module load check. pcap taken.
1 parent 871f1b7 commit 6188df1

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

modules/auxiliary/scanner/http/rfcode_reader_enum.rb

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ def initialize(info={})
4747

4848
def run_host(ip)
4949
unless is_app_rfreader?
50-
print_error("#{rhost}:#{rport} -> Application does not appear to be RFCode Reader. Module will not continue.")
50+
print_error("#{rhost}:#{rport} - Application does not appear to be RFCode Reader. Module will not continue.")
5151
return
5252
end
5353

54-
print_status("#{rhost}:#{rport} -> Checking if authentication is required...")
54+
print_status("#{rhost}:#{rport} - Checking if authentication is required...")
5555
unless is_auth_required?
56-
print_warning("#{rhost}:#{rport} -> Application does not require authentication.")
56+
print_warning("#{rhost}:#{rport} - Application does not require authentication.")
5757
user = ''
5858
pass = ''
5959

@@ -62,7 +62,7 @@ def run_host(ip)
6262
return
6363
end
6464

65-
print_status("#{rhost}:#{rport} -> Brute-forcing...")
65+
print_status("#{rhost}:#{rport} - Brute-forcing...")
6666
each_user_pass do |user, pass|
6767
do_login(user, pass)
6868
end
@@ -110,7 +110,7 @@ def is_auth_required?
110110
#
111111
def do_login(user, pass)
112112

113-
vprint_status("#{rhost}:#{rport} -> Trying username:'#{user.inspect}' with password:'#{pass.inspect}'")
113+
vprint_status("#{rhost}:#{rport} - Trying username:#{user.inspect} with password:#{pass.inspect}")
114114
begin
115115
res = send_request_cgi(
116116
{
@@ -124,10 +124,10 @@ def do_login(user, pass)
124124
})
125125

126126
if not res or res.code == 401
127-
vprint_error("#{rhost}:#{rport} -> FAILED LOGIN - '#{user.inspect}' : '#{pass.inspect}' with code #{res.code}")
127+
vprint_error("#{rhost}:#{rport} - FAILED LOGIN - #{user.inspect}:#{pass.inspect} with code #{res.code}")
128128
return :skip_pass
129129
else
130-
print_good("#{rhost}:#{rport} -> SUCCESSFUL LOGIN - '#{user.inspect}' : '#{pass.inspect}'")
130+
print_good("#{rhost}:#{rport} - SUCCESSFUL LOGIN - #{user.inspect}:#{pass.inspect}")
131131

132132
collect_info(user, pass)
133133

@@ -144,7 +144,7 @@ def do_login(user, pass)
144144
return :next_user
145145
end
146146
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError, ::Errno::EPIPE
147-
print_error("#{rhost}:#{rport} -> HTTP Connection Failed, Aborting")
147+
print_error("#{rhost}:#{rport} - HTTP Connection Failed, Aborting")
148148
return :abort
149149
end
150150
end
@@ -154,7 +154,7 @@ def do_login(user, pass)
154154
#
155155
def collect_info(user, pass)
156156

157-
vprint_status("#{rhost}:#{rport} -> Collecting information from app as '#{user.inspect}':'#{pass.inspect}'...")
157+
vprint_status("#{rhost}:#{rport} - Collecting information from app as #{user.inspect}:#{pass.inspect}...")
158158
begin
159159

160160
res = send_request_cgi(
@@ -171,15 +171,16 @@ def collect_info(user, pass)
171171
release_ver = JSON.parse(res.body)["release"]
172172
product_name = JSON.parse(res.body)["product"]
173173

174-
vprint_status("#{rhost}:#{rport} -> Collecting device platform info...")
175-
print_good("#{rhost}:#{rport} -> Release version: '#{release_ver}', Product Name: '#{product_name}'")
174+
vprint_status("#{rhost}:#{rport} - Collecting device platform info...")
175+
print_good("#{rhost}:#{rport} - Release version: '#{release_ver}', Product Name: '#{product_name}'")
176176

177177
report_note(
178178
:host => rhost,
179179
:proto => 'tcp',
180180
:port => rport,
181181
:sname => "RFCode Reader",
182-
:data => 'Release Version: #{release_ver}, Product: #{product_name}'
182+
:data => 'Release Version: #{release_ver}, Product: #{product_name}',
183+
:type => 'Info'
183184
)
184185

185186
res = send_request_cgi(
@@ -194,15 +195,16 @@ def collect_info(user, pass)
194195
})
195196

196197
userlist = JSON.parse(res.body)
197-
vprint_status("#{rhost}:#{rport} -> Collecting user list...")
198-
print_good("#{rhost}:#{rport} -> User list & role: #{userlist}")
198+
vprint_status("#{rhost}:#{rport} - Collecting user list...")
199+
print_good("#{rhost}:#{rport} - User list & role: #{userlist}")
199200

200201
report_note(
201202
:host => rhost,
202203
:proto => 'tcp',
203204
:port => rport,
204205
:sname => "RFCode Reader",
205-
:data => 'User List & Roles: #{userlist}'
206+
:data => 'User List & Roles: #{userlist}',
207+
:type => 'Info'
206208
)
207209

208210

@@ -218,15 +220,16 @@ def collect_info(user, pass)
218220
})
219221

220222
eth0_info = JSON.parse(res.body)["eth0"]
221-
vprint_status("#{rhost}:#{rport} -> Collecting interface info...")
222-
print_good("#{rhost}:#{rport} -> Interface eth0 info: #{eth0_info}")
223+
vprint_status("#{rhost}:#{rport} - Collecting interface info...")
224+
print_good("#{rhost}:#{rport} - Interface eth0 info: #{eth0_info}")
223225

224226
report_note(
225227
:host => rhost,
226228
:proto => 'tcp',
227229
:port => rport,
228230
:sname => "RFCode Reader",
229-
:data => 'Interface eth0: #{eth0_info}'
231+
:data => 'Interface eth0: #{eth0_info}',
232+
:type => 'Info'
230233
)
231234

232235
return

0 commit comments

Comments
 (0)