mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -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
|
||||
}
|
||||
|
||||
func (f WindowsFirewall) generateRule(r *Redirection) []string {
|
||||
func (f WindowsFirewall) generateRule(r *Redirection, enabled bool) []string {
|
||||
rule := []string{
|
||||
fmt.Sprintf("connectport=%d", r.SrcPort),
|
||||
fmt.Sprintf("listenport=%d", r.DstPort),
|
||||
}
|
||||
|
||||
if r.SrcAddress != "" {
|
||||
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress))
|
||||
if enabled == true {
|
||||
rule = append(rule, fmt.Sprintf("connectport=%d", r.SrcPort))
|
||||
|
||||
if r.SrcAddress != "" {
|
||||
rule = append(rule, fmt.Sprintf("connectaddress=%s", r.SrcAddress))
|
||||
}
|
||||
}
|
||||
|
||||
if r.DstAddress != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue