mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
balls
This commit is contained in:
parent
cb2c676576
commit
1de7013eac
1 changed files with 45 additions and 0 deletions
45
firewall/firewall_windows.go
Normal file
45
firewall/firewall_windows.go
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
package firewall
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
type WindowsFirewall struct {
|
||||||
|
forwarding bool
|
||||||
|
redirections map[string]*Redirection
|
||||||
|
}
|
||||||
|
|
||||||
|
func Make() FirewallManager {
|
||||||
|
firewall := &WindowsFirewall{
|
||||||
|
forwarding: false,
|
||||||
|
redirections: make(map[string]*Redirection, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
firewall.forwarding = firewall.IsForwardingEnabled()
|
||||||
|
|
||||||
|
return firewall
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f WindowsFirewall) IsForwardingEnabled() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f WindowsFirewall) EnableForwarding(enabled bool) error {
|
||||||
|
return fmt.Errorf("Not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *WindowsFirewall) EnableRedirection(r *Redirection, enabled bool) error {
|
||||||
|
return fmt.Errorf("Not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f WindowsFirewall) Restore() {
|
||||||
|
for _, r := range f.redirections {
|
||||||
|
if err := f.EnableRedirection(r, false); err != nil {
|
||||||
|
fmt.Printf("%s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := f.EnableForwarding(f.forwarding); err != nil {
|
||||||
|
fmt.Printf("%s", err)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue