From 9353b2038ca140eb83dccd8c45ac66b5be2f283d Mon Sep 17 00:00:00 2001 From: evilsocket Date: Thu, 8 Feb 2018 05:36:53 +0100 Subject: [PATCH] balls --- firewall/firewall_windows.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/firewall/firewall_windows.go b/firewall/firewall_windows.go index 0207b2a3..aec968d1 100644 --- a/firewall/firewall_windows.go +++ b/firewall/firewall_windows.go @@ -54,23 +54,27 @@ func (f WindowsFirewall) EnableForwarding(enabled bool) error { func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string { rule := []string{ - fmt.Sprintf("listenport=%d", r.DstPort), + 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.SrcPort)) + 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.SrcAddress)) + rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress)) } } - if r.DstAddress != "" { - rule = append(rule, fmt.Sprintf("listenaddress=%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 }