Skip to content

Commit 4bb64a0

Browse files
committed
2 parents bbbf395 + 40e801d commit 4bb64a0

File tree

11 files changed

+473
-40
lines changed

11 files changed

+473
-40
lines changed

data/gui/msfgui.jar

14 Bytes
Binary file not shown.

external/source/gui/msfguijava/src/msfgui/MainFrame.form

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</DimensionLayout>
1616
<DimensionLayout dim="1">
1717
<Group type="103" groupAlignment="0" attributes="0">
18-
<Component id="tabbedPane" alignment="1" pref="530" max="32767" attributes="0"/>
18+
<Component id="tabbedPane" alignment="1" pref="534" max="32767" attributes="0"/>
1919
</Group>
2020
</DimensionLayout>
2121
</Layout>
@@ -308,7 +308,7 @@
308308
<Property name="name" type="java.lang.String" value="credsTable" noResource="true"/>
309309
</Properties>
310310
<AuxValues>
311-
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MsfTable(rpcConn, new String [] {&quot;Host&quot;, &quot;Time&quot;, &quot;Port&quot;, &quot;Proto&quot;, &quot;Sname&quot;, &quot;Type&quot;, &quot;User&quot;, &quot;Pass&quot;, &quot;Active&quot;&#xa; }, &quot;creds&quot;, new String[]{&quot;host&quot;, &quot;time&quot;, &quot;port&quot;, &quot;proto&quot;, &quot;sname&quot;, &quot;type&quot;, &quot;user&quot;, &quot;pass&quot;, &quot;active&quot;})"/>
311+
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MsfTable(rpcConn, new String [] {&quot;Host&quot;, &quot;Updated&quot;, &quot;Port&quot;, &quot;Proto&quot;, &quot;Sname&quot;, &quot;Type&quot;, &quot;User&quot;, &quot;Pass&quot;, &quot;Active&quot;&#xa; }, &quot;creds&quot;, new String[]{&quot;host&quot;, &quot;updated_at&quot;, &quot;port&quot;, &quot;proto&quot;, &quot;sname&quot;, &quot;type&quot;, &quot;user&quot;, &quot;pass&quot;, &quot;active&quot;})"/>
312312
</AuxValues>
313313
</Component>
314314
</SubComponents>

external/source/gui/msfguijava/src/msfgui/MainFrame.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ private void initComponents() {
527527
lootsTable = new MsfTable(rpcConn,new String [] {"Host", "Service", "Ltype", "Ctype", "Data", "Created", "Updated", "Name", "Info"
528528
}, "loots", new String[]{"host", "service", "ltype", "ctype", "data", "created_at", "updated_at", "name", "info"});
529529
credsPane = new javax.swing.JScrollPane();
530-
credsTable = new MsfTable(rpcConn, new String [] {"Host", "Time", "Port", "Proto", "Sname", "Type", "User", "Pass", "Active"
531-
}, "creds", new String[]{"host", "time", "port", "proto", "sname", "type", "user", "pass", "active"});
530+
credsTable = new MsfTable(rpcConn, new String [] {"Host", "Updated", "Port", "Proto", "Sname", "Type", "User", "Pass", "Active"
531+
}, "creds", new String[]{"host", "updated_at", "port", "proto", "sname", "type", "user", "pass", "active"});
532532
menuBar = new javax.swing.JMenuBar();
533533
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
534534
connectRpcMenuItem = new javax.swing.JMenuItem();
@@ -710,7 +710,7 @@ public void keyReleased(java.awt.event.KeyEvent evt) {
710710
);
711711
mainPanelLayout.setVerticalGroup(
712712
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
713-
.addComponent(tabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
713+
.addComponent(tabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
714714
);
715715

716716
menuBar.setName("menuBar"); // NOI18N

lib/msf/core/auxiliary/web.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def calculate_confidence( vuln )
156156
end
157157

158158
def log_fingerprint( opts = {} )
159-
mode = details[:category].to_sym
159+
mode = name
160160
vhash = [target.to_url, opts[:fingerprint], mode, opts[:location]].
161161
map { |x| x.to_s }.join( '|' ).hash
162162

@@ -187,12 +187,12 @@ def log_fingerprint( opts = {} )
187187

188188
report_web_vuln( info )
189189

190-
print_good " FOUND(#{mode.to_s.upcase}) URL(#{location})"
190+
print_good " FOUND(#{mode.to_s}) URL(#{location})"
191191
print_good " PROOF(#{opts[:fingerprint]})"
192192
end
193193

194194
def log_resource( opts = {} )
195-
mode = details[:category].to_sym
195+
mode = name
196196
vhash = [target.to_url, mode, opts[:location]].
197197
map { |x| x.to_s }.join( '|' ).hash
198198

@@ -221,12 +221,12 @@ def log_resource( opts = {} )
221221

222222
report_web_vuln( info )
223223

224-
print_good " VULNERABLE(#{mode.to_s.upcase}) URL(#{target.to_url})"
224+
print_good " VULNERABLE(#{mode.to_s}) URL(#{target.to_url})"
225225
print_good " PROOF(#{opts[:location]})"
226226
end
227227

228228
def process_vulnerability( element, proof, opts = {} )
229-
mode = details[:category].to_sym
229+
mode = name
230230
vhash = [target.to_url, mode, element.altered].
231231
map{ |x| x.to_s }.join( '|' ).hash
232232

@@ -281,7 +281,7 @@ def process_vulnerability( element, proof, opts = {} )
281281

282282
report_web_vuln( info )
283283

284-
print_good " VULNERABLE(#{mode.to_s.upcase}) URL(#{target.to_url})" +
284+
print_good " VULNERABLE(#{mode.to_s}) URL(#{target.to_url})" +
285285
" PARAMETER(#{element.altered}) VALUES(#{element.params})"
286286
print_good " PROOF(#{proof})"
287287
end

lib/msf/core/auxiliary/web/path.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def to_hash
118118
end
119119

120120
def self.from_model( form )
121-
e = new( :action => "#{form.path}?#{form.query}", :input => inputs[0][1] )
121+
e = new( :action => "#{form.path}?#{form.query}", :input => form.inputs[0][1] )
122122
e.model = form
123123
e
124124
end

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

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: binary -*-
2-
2+
#
33
require 'rexml/document'
44
require 'rex/parser/nmap_xml'
55
require 'msf/core/db_export'
@@ -975,8 +975,15 @@ def cmd_notes(*args)
975975
end
976976

977977
def cmd_loot_help
978-
print_line "Usage: loot [-h] [addr1 addr2 ...] [-t <type1,type2>]"
978+
print_line "Usage: loot <options>"
979+
print_line " Info: loot [-h] [addr1 addr2 ...] [-t <type1,type2>]"
980+
print_line " Add: loot -f [fname] -i [info] -a [addr1 addr2 ...] [-t [type]"
981+
print_line " Del: loot -d [addr1 addr2 ...]"
979982
print_line
983+
print_line " -a,--add Add loot to the list of addresses, instead of listing"
984+
print_line " -d,--delete Delete *all* loot matching host and type"
985+
print_line " -f,--file File with contents of the loot to add"
986+
print_line " -i,--info Info of the loot to add"
980987
print_line " -t <type1,type2> Search for a list of types"
981988
print_line " -h,--help Show this help information"
982989
print_line " -S,--search Search string to filter by"
@@ -991,31 +998,52 @@ def cmd_loot(*args)
991998
types = nil
992999
delete_count = 0
9931000
search_term = nil
1001+
file = nil
1002+
name = nil
1003+
info = nil
9941004

9951005
while (arg = args.shift)
9961006
case arg
997-
when '-d','--delete'
998-
mode = :delete
999-
when '-t'
1000-
typelist = args.shift
1001-
if(!typelist)
1002-
print_status("Invalid type list")
1007+
when '-a','--add'
1008+
mode = :add
1009+
when '-d','--delete'
1010+
mode = :delete
1011+
when '-f','--file'
1012+
filename = args.shift
1013+
if(!filename)
1014+
print_error("Can't make loot with no filename")
1015+
return
1016+
end
1017+
if (!File.exists?(filename) or !File.readable?(filename))
1018+
print_error("Can't read file")
1019+
return
1020+
end
1021+
when '-i','--info'
1022+
info = args.shift
1023+
if(!info)
1024+
print_error("Can't make loot with no info")
10031025
return
10041026
end
1005-
types = typelist.strip().split(",")
1006-
when '-S', '--search'
1007-
search_term = /#{args.shift}/nmi
1008-
when '-h','--help'
1009-
cmd_loot_help
1010-
return
1011-
else
1012-
# Anything that wasn't an option is a host to search for
1013-
unless (arg_host_range(arg, host_ranges))
1027+
when '-t'
1028+
typelist = args.shift
1029+
if(!typelist)
1030+
print_error("Invalid type list")
1031+
return
1032+
end
1033+
types = typelist.strip().split(",")
1034+
when '-S', '--search'
1035+
search_term = /#{args.shift}/nmi
1036+
when '-h','--help'
1037+
cmd_loot_help
1038+
return
1039+
else
1040+
# Anything that wasn't an option is a host to search for
1041+
unless (arg_host_range(arg, host_ranges))
10141042
return
10151043
end
10161044
end
1017-
10181045
end
1046+
10191047
tbl = Rex::Ui::Text::Table.new({
10201048
'Header' => "Loot",
10211049
'Columns' => [ 'host', 'service', 'type', 'name', 'content', 'info', 'path' ],
@@ -1024,6 +1052,32 @@ def cmd_loot(*args)
10241052
# Sentinal value meaning all
10251053
host_ranges.push(nil) if host_ranges.empty?
10261054

1055+
if mode == :add
1056+
if info.nil?
1057+
print_error("Info required")
1058+
return
1059+
end
1060+
if filename.nil?
1061+
print_error("Loot file required")
1062+
return
1063+
end
1064+
if types.nil? or types.size != 1
1065+
print_error("Exactly one loot type is required")
1066+
return
1067+
end
1068+
type = types.first
1069+
name = File.basename(filename)
1070+
host_ranges.each do |range|
1071+
range.each do |host|
1072+
file = File.open(filename, "rb")
1073+
contents = file.read
1074+
lootfile = framework.db.find_or_create_loot(:type => type, :host => host,:info => info, :data => contents,:path => filename,:name => name)
1075+
print_status "Added loot #{host}"
1076+
end
1077+
end
1078+
return
1079+
end
1080+
10271081
each_host_range_chunk(host_ranges) do |host_search|
10281082
framework.db.hosts(framework.db.workspace, false, host_search).each do |host|
10291083
host.loots.each do |loot|

0 commit comments

Comments
 (0)