File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -177,11 +177,31 @@ def cmd_workspace(*args)
177
177
return
178
178
end
179
179
else
180
+ workspace = framework . db . workspace
181
+ col_names = %w{ current name hosts services vulns creds loots notes }
182
+
183
+ tbl = Rex ::Text ::Table . new (
184
+ 'Header' => 'Workspaces' ,
185
+ 'Columns' => col_names ,
186
+ 'SortIndex' => 1
187
+ )
188
+
180
189
# List workspaces
181
- framework . db . workspaces . each do |s |
182
- pad = ( s . name == framework . db . workspace . name ) ? "* " : " "
183
- print_line ( "#{ pad } #{ s . name } " )
190
+ framework . db . workspaces . each do |ws |
191
+ tbl << [
192
+ ws == workspace ? '*' : '' ,
193
+ ws . name ,
194
+ ws . hosts . count ,
195
+ ws . services . count ,
196
+ ws . vulns . count ,
197
+ ws . core_credentials . count ,
198
+ ws . loots . count ,
199
+ ws . notes . count
200
+ ]
184
201
end
202
+
203
+ print_line
204
+ print_line ( tbl . to_s )
185
205
end
186
206
}
187
207
end
You can’t perform that action at this time.
0 commit comments