mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
balls
This commit is contained in:
parent
9353b2038c
commit
cf888b116c
2 changed files with 2 additions and 16 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue