Add IP and port validation to beef.net
This commit is contained in:
@@ -20,11 +20,11 @@ beef.execute(function() {
|
||||
}
|
||||
|
||||
// validate target details
|
||||
if (!rport || !rhost || isNaN(rport)) {
|
||||
if (!rport || !rhost) {
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=malformed remote host or remote port');
|
||||
return;
|
||||
}
|
||||
if (rport > 65535 || rport < 0) {
|
||||
if (!beef.net.is_valid_port(rport)) {
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=invalid remote port');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user