File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1327,10 +1327,7 @@ def cmd_route_help
1327
1327
# which session a given subnet should route through.
1328
1328
#
1329
1329
def cmd_route ( *args )
1330
- if ( args . length == 0 )
1331
- cmd_route_help
1332
- return false
1333
- end
1330
+ args << 'print' if args . length == 0
1334
1331
1335
1332
action = args . shift
1336
1333
case action
@@ -1420,8 +1417,7 @@ def cmd_route(*args)
1420
1417
'Netmask' => { 'MaxWidth' => 17 } ,
1421
1418
} )
1422
1419
1423
- Rex ::Socket ::SwitchBoard . each { |route |
1424
-
1420
+ Rex ::Socket ::SwitchBoard . each . with_index { |route , idx |
1425
1421
if ( route . comm . kind_of? ( Msf ::Session ) )
1426
1422
gw = "Session #{ route . comm . sid } "
1427
1423
else
@@ -1431,7 +1427,11 @@ def cmd_route(*args)
1431
1427
tbl << [ route . subnet , route . netmask , gw ]
1432
1428
}
1433
1429
1434
- print ( tbl . to_s )
1430
+ if tbl . rows . length == 0
1431
+ print_status ( 'There are currently no routes defined.' )
1432
+ else
1433
+ print ( tbl . to_s )
1434
+ end
1435
1435
else
1436
1436
cmd_route_help
1437
1437
end
You can’t perform that action at this time.
0 commit comments