File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1334,14 +1334,13 @@ def cmd_route(*args)
1334
1334
1335
1335
when "add" , "remove" , "del"
1336
1336
subnet = args . shift
1337
- subnet , cidr_mask = subnet . split ( "/" )
1338
-
1339
- if cidr_mask
1340
- netmask = Rex ::Socket . addr_ctoa ( cidr_mask . to_i )
1341
- else
1342
- netmask = args . shift
1337
+ netmask = nil
1338
+ if subnet
1339
+ subnet , cidr_mask = subnet . split ( "/" )
1340
+ netmask = Rex ::Socket . addr_ctoa ( cidr_mask . to_i ) if cidr_mask
1343
1341
end
1344
1342
1343
+ netmask = args . shift if netmask . nil?
1345
1344
gateway_name = args . shift
1346
1345
1347
1346
if ( subnet . nil? || netmask . nil? || gateway_name . nil? )
@@ -1354,15 +1353,15 @@ def cmd_route(*args)
1354
1353
case gateway_name
1355
1354
when /local/i
1356
1355
gateway = Rex ::Socket ::Comm ::Local
1357
- when /^[0-9]+$/
1356
+ when /^(-1| [0-9]+) $/
1358
1357
session = framework . sessions . get ( gateway_name )
1359
1358
if session . kind_of? ( Msf ::Session ::Comm )
1360
1359
gateway = session
1361
1360
elsif session . nil?
1362
1361
print_error ( "Not a session: #{ gateway_name } " )
1363
1362
return false
1364
1363
else
1365
- print_error ( "Cannout route through specified session (not a Comm)" )
1364
+ print_error ( "Cannot route through the specified session (not a Comm)" )
1366
1365
return false
1367
1366
end
1368
1367
else
You can’t perform that action at this time.
0 commit comments