From b5371bfccce24bb9b99a856e02b48f3d63eebfbf Mon Sep 17 00:00:00 2001 From: evilsocket Date: Sat, 10 Feb 2018 02:39:03 +0100 Subject: [PATCH] balls --- firewall/firewall_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index a4b5b354..594130e8 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -74,12 +74,12 @@ func (f *WindowsFirewall) AllowPort(port int, address string, proto string, allo ipField := fmt.Sprintf("lolcalip=%s", address) portField := fmt.Sprintf("localport=%d", port) - cmd := []string{"advfirewall"} + cmd := []string{} if allow { - cmd = append(cmd, []string{"add", "rule", nameField, protoField, "dir=in", ipField, portField, "action=allow"}...) + cmd = []string{"advfirewall", "add", "rule", nameField, protoField, "dir=in", ipField, portField, "action=allow"} } else { - cmd = append(cmd, []string{"del", "rule", nameField}...) + cmd = []string{"advfirewall", "del", "rule", nameField} } out, err := core.Exec("netsh", cmd)