mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
balls
This commit is contained in:
parent
241c88a06b
commit
f7ee9d36be
1 changed files with 9 additions and 8 deletions
|
@ -54,22 +54,23 @@ func (f WindowsFirewall) EnableForwarding(enabled bool) error {
|
||||||
|
|
||||||
func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string {
|
func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string {
|
||||||
rule := []string{
|
rule := []string{
|
||||||
fmt.Sprintf("listenport=%d", r.DstPort),
|
fmt.Sprintf("listenport=%d", r.SrcPort),
|
||||||
}
|
}
|
||||||
|
|
||||||
if enabled == true {
|
if enabled == true {
|
||||||
rule = append(rule, fmt.Sprintf("protocol=%s", r.Protocol))
|
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))
|
if r.SrcAddress != "" {
|
||||||
} else {
|
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress))
|
||||||
// rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress))
|
} else {
|
||||||
}
|
// rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress))
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.DstAddress != "" {
|
if r.DstAddress != "" {
|
||||||
rule = append(rule, fmt.Sprintf("listenaddress=%s", r.DstAddress))
|
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.DstAddress))
|
||||||
}
|
}
|
||||||
|
|
||||||
return rule
|
return rule
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue