File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,17 @@ def load_config(path=nil)
387
387
if ( conf . group? ( ConfigGroup ) )
388
388
conf [ ConfigGroup ] . each_pair { |k , v |
389
389
case k . downcase
390
- when " activemodule"
390
+ when ' activemodule'
391
391
run_single ( "use #{ v } " )
392
+ when 'activeworkspace'
393
+ if framework . db . active
394
+ workspace = framework . db . find_workspace ( v )
395
+ if workspace
396
+ framework . db . workspace = workspace
397
+ else
398
+ framework . db . workspace = framework . db . add_workspace ( v )
399
+ end
400
+ end
392
401
end
393
402
}
394
403
end
@@ -405,6 +414,12 @@ def save_config
405
414
group [ 'ActiveModule' ] = active_module . fullname
406
415
end
407
416
417
+ if framework . db . active
418
+ unless framework . db . workspace . default?
419
+ group [ 'ActiveWorkspace' ] = framework . db . workspace . name
420
+ end
421
+ end
422
+
408
423
# Save it
409
424
begin
410
425
Msf ::Config . save ( ConfigGroup => group )
You can’t perform that action at this time.
0 commit comments