mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
new: implementing IsForwardingEnabled for windows firewall
This commit is contained in:
parent
529d834815
commit
c87e1e7f1d
1 changed files with 11 additions and 1 deletions
|
@ -2,6 +2,10 @@ package firewall
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/evilsocket/bettercap-ng/core"
|
||||
"github.com/evilsocket/bettercap-ng/session"
|
||||
)
|
||||
|
||||
type WindowsFirewall struct {
|
||||
|
@ -21,10 +25,16 @@ func Make() FirewallManager {
|
|||
}
|
||||
|
||||
func (f WindowsFirewall) IsForwardingEnabled() bool {
|
||||
return false
|
||||
if out, err := core.Exec("netsh", []string{"interface", "ipv4", "dump"}); err != nil {
|
||||
fmt.Printf("%s\n", err)
|
||||
return false
|
||||
} else {
|
||||
return strings.Contains(out, "forwarding=enabled")
|
||||
}
|
||||
}
|
||||
|
||||
func (f WindowsFirewall) EnableForwarding(enabled bool) error {
|
||||
fmt.Printf("iface idx=%d\n", session.I.Interface.Index)
|
||||
return fmt.Errorf("Not implemented")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue