diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index aec968d1..2667fda3 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -54,28 +54,16 @@ func (f WindowsFirewall) EnableForwarding(enabled bool) error { func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string { rule := []string{ + "listenaddress=0.0.0.0", fmt.Sprintf("listenport=%d", r.SrcPort), } if enabled == true { rule = append(rule, fmt.Sprintf("protocol=%s", r.Protocol)) rule = append(rule, fmt.Sprintf("connectport=%d", r.DstPort)) - - if r.SrcAddress != "" { - rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress)) - } else { - rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress)) - } + rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress)) } - /* - if r.DstAddress != "" { - rule = append(rule, fmt.Sprintf("listenaddress=%s", r.DstAddress)) - } - */ - - rule = append(rule, "listenaddress=0.0.0.0") - return rule } diff --git a/modules/http_proxy.go b/modules/http_proxy.go index 1ad38b78..9f1075a7 100644 --- a/modules/http_proxy.go +++ b/modules/http_proxy.go @@ -1,7 +1,6 @@ package modules import ( - "fmt" "github.com/evilsocket/bettercap-ng/session" ) @@ -37,7 +36,6 @@ func NewHttpProxy(s *session.Session) *HttpProxy { p.AddHandler(session.NewModuleHandler("http.proxy on", "", "Start HTTP proxy.", func(args []string) error { - fmt.Printf("\nproxy.start\n") return p.Start() }))