This commit is contained in:
evilsocket 2018-02-08 05:41:34 +01:00
commit cf888b116c
2 changed files with 2 additions and 16 deletions

View file

@ -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
}