put a permission restriction on !tcpup - it could be abused for port scanning

This commit is contained in:
jesopo 2019-10-18 15:18:26 +01:00
parent 4391176c7f
commit 40a8406054

View file

@ -32,6 +32,7 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("min_args", 1) @utils.kwarg("min_args", 1)
@utils.kwarg("help", "Check if a given hostname:port is up or not") @utils.kwarg("help", "Check if a given hostname:port is up or not")
@utils.kwarg("usage", "<hostname>[:port]") @utils.kwarg("usage", "<hostname>[:port]")
@utils.kwarg("permission", "tcpup")
def tcpup(self, event): def tcpup(self, event):
hostname, _, port = event["args_split"][0].partition(":") hostname, _, port = event["args_split"][0].partition(":")
port = utils.parse.try_int(port or "80") port = utils.parse.try_int(port or "80")