mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
balls
This commit is contained in:
parent
ae773799a6
commit
fe4de09f53
1 changed files with 7 additions and 4 deletions
|
@ -52,14 +52,17 @@ func (f WindowsFirewall) EnableForwarding(enabled bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f WindowsFirewall) generateRule(r *Redirection) []string {
|
func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string {
|
||||||
rule := []string{
|
rule := []string{
|
||||||
fmt.Sprintf("connectport=%d", r.SrcPort),
|
|
||||||
fmt.Sprintf("listenport=%d", r.DstPort),
|
fmt.Sprintf("listenport=%d", r.DstPort),
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.SrcAddress != "" {
|
if enabled == true {
|
||||||
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress))
|
rule = append(rule, fmt.Sprintf("connectport=%d", r.SrcPort))
|
||||||
|
|
||||||
|
if r.SrcAddress != "" {
|
||||||
|
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.DstAddress != "" {
|
if r.DstAddress != "" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue