mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
balls
This commit is contained in:
parent
c8153fd0f9
commit
b5371bfccc
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue