From a2a7d43c80b41b0b2c9f7aee174fc46a61746863 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 05:27:36 +0100 Subject: [PATCH] balls --- firewall/firewall_windows.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index 5bb4665d..0207b2a3 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -54,23 +54,22 @@ func (f WindowsFirewall) EnableForwarding(enabled bool) error { func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string { rule := []string{ - fmt.Sprintf("listenport=%d", r.SrcPort), + fmt.Sprintf("listenport=%d", r.DstPort), } if enabled == true { rule = append(rule, fmt.Sprintf("protocol=%s", r.Protocol)) - rule = append(rule, fmt.Sprintf("connectport=%d", r.DstPort)) + rule = append(rule, fmt.Sprintf("connectport=%d", r.SrcPort)) - /* - if r.SrcAddress != "" { - rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress)) - } else { - // rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress)) - }*/ + if r.SrcAddress != "" { + rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress)) + } else { + rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress)) + } } if r.DstAddress != "" { - rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress)) + rule = append(rule, fmt.Sprintf("listenaddress=%s", r.DstAddress)) } return rule