Skip to content

Commit f6faa55

Browse files
committed
Fixes modules to now correctly use a hash with report note
1 parent c5a5488 commit f6faa55

File tree

143 files changed

+712
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+712
-504
lines changed

data/exploits/psnuffle/smb.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ def parse_sessionsetup(pkt, s)
185185
report_note(
186186
:host => src_ip,
187187
:type => "smb_peer_os",
188-
:data => s[:peer_os]
188+
:data => { :peer_os => s[:peer_os] }
189189
) if (s[:peer_os] and s[:peer_os].strip.length > 0)
190190

191191
report_note(
192192
:host => src_ip,
193193
:type => "smb_peer_lm",
194-
:data => s[:peer_lm]
194+
:data => { :peer_lm => s[:peer_lm] }
195195
) if (s[:peer_lm] and s[:peer_lm].strip.length > 0)
196196

197197
report_note(
198198
:host => src_ip,
199199
:type => "smb_domain",
200-
:data => s[:domain]
200+
:data => { :domain => s[:domain] }
201201
) if (s[:domain] and s[:domain].strip.length > 0)
202202

203203
end

lib/msf/core/auxiliary/report.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def store_local(ltype=nil, ctype=nil, data=nil, filename=nil)
515515

516516
# This will probably evolve into a new database table
517517
report_note(
518-
:data => full_path.dup,
518+
:data => { :full_path => full_path.dup },
519519
:type => "#{ltype}.localpath"
520520
)
521521

@@ -590,4 +590,3 @@ def store_cred(opts={})
590590

591591
end
592592
end
593-

lib/msf/core/db_manager/note.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ def report_note(opts)
143143
end
144144

145145
ntype = opts.delete(:type) || opts.delete(:ntype) || (raise RuntimeError, "A note :type or :ntype is required")
146+
147+
unless opts[:data].is_a?(Hash)
148+
message = "[DEPRECATION] Using #{method.inspect} with a non-hash data value is deprecated, please raise a Github issue with this output. Called from: #{caller(1, stack_size).to_a}"
149+
print_warning message
150+
# Additionally write to ~/.msf4/logs/framework.log - as this gets attached to Github issues etc
151+
elog(message)
152+
end
153+
146154
data = opts[:data]
147155
note = nil
148156

lib/msf/core/exploit/remote/browser_autopwn2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ def log_click(ip, data='')
612612
report_note(
613613
:host => ip,
614614
:type => 'bap.clicks',
615-
:data => data,
615+
:data => { :csv_data => data },
616616
:update => :unique)
617617
end
618618

lib/msf/core/exploit/remote/dns/enumeration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def dns_get_srv(domain)
246246
}
247247
report_note(
248248
type: srv_record,
249-
data: srv_record_data
249+
data: { :srv_record_data => srv_record_data }
250250
)
251251
end
252252
end

lib/msf/core/exploit/remote/http_server.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,14 @@ def report_user_agent(address, request, client_opts={})
381381
report_note(
382382
:host => address,
383383
:type => 'http.request',
384-
:data => "#{address}: #{request.method} #{request.resource} #{client[:os_name]} #{client[:ua_name]} #{client[:ua_ver]}",
384+
:data => {
385+
:address => address,
386+
:method => request.method,
387+
:resource => request.resource,
388+
:os_name => client[:os_name],
389+
:ua_name => client[:ua_name],
390+
:ua_ver => client[:ua_ver]
391+
},
385392
:update => :unique_data
386393
)
387394
return host.merge(client)

lib/msf/core/exploit/remote/smb/client/psexec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def execute_command_payload(smbshare)
233233
:rport => simple.port,
234234
:type => 'psexec_command',
235235
:name => command,
236-
:data => output
236+
:data => { :command_output => output }
237237
)
238238
end
239239
end

lib/msf/core/exploit/remote/wdbrpc_client.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def wdbrpc_client_connect
6464
:port => rport,
6565
:proto => 'udp',
6666
:type => 'vxworks.target_info',
67-
:data => res,
67+
:data => { :target_info => res },
6868
:update => :unique
6969
)
7070
end
@@ -103,7 +103,7 @@ def wdbrpc_client_connect2
103103
:port => rport,
104104
:proto => 'udp',
105105
:type => 'vxworks.target_info',
106-
:data => res,
106+
:data => { :target_info => res },
107107
:update => :unique
108108
)
109109
end
@@ -215,4 +215,3 @@ def rport
215215

216216
end
217217
end
218-

lib/msf/core/exploit/remote/x11/connect.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def x11_print_connection_info(connection, ip, port)
4949
sname: 'x11',
5050
port: port,
5151
type: 'x11.server_vendor',
52-
data: "Open X Server (#{connection.body.vendor})"
52+
data: { :server => connection.body.vendor }
5353
)
5454
end
5555
end

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def change_host_data(host_ranges, host_data)
347347

348348
framework.db.hosts(address: host_search).each do |host|
349349
framework.db.update_host(host_data.merge(id: host.id))
350-
framework.db.report_note(host: host.address, type: "host.#{attribute}", data: host_data[attribute])
350+
framework.db.report_note(host: host.address, type: "host.#{attribute}", data: { :host_data => host_data[attribute] })
351351
end
352352
end
353353
end

0 commit comments

Comments
 (0)