mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
sslstrip fix
This commit is contained in:
parent
924ff5753d
commit
a950d3b767
2 changed files with 31 additions and 12 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
type LinuxFirewall struct {
|
||||
iface *network.Endpoint
|
||||
forwarding bool
|
||||
restore bool
|
||||
redirections map[string]*Redirection
|
||||
}
|
||||
|
||||
|
@ -28,6 +29,7 @@ func Make(iface *network.Endpoint) FirewallManager {
|
|||
firewall := &LinuxFirewall{
|
||||
iface: iface,
|
||||
forwarding: false,
|
||||
restore: false,
|
||||
redirections: make(map[string]*Redirection),
|
||||
}
|
||||
|
||||
|
@ -72,6 +74,7 @@ func (f LinuxFirewall) EnableForwarding(enabled bool) error {
|
|||
return f.enableFeature(IPV6ForwardingFile, enabled)
|
||||
}
|
||||
|
||||
f.restore = true
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -156,6 +159,9 @@ func (f *LinuxFirewall) EnableRedirection(r *Redirection, enabled bool) error {
|
|||
}
|
||||
|
||||
func (f LinuxFirewall) Restore() {
|
||||
if f.restore == false {
|
||||
return
|
||||
}
|
||||
for _, r := range f.redirections {
|
||||
if err := f.EnableRedirection(r, false); err != nil {
|
||||
fmt.Printf("%s", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue