Skip to content

Commit

Permalink
add timeout to zone transfer attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
5amu committed Jul 10, 2022
1 parent df8a9ea commit f667d55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/checks/dnschecks/zonetransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dnschecks
import (
"fmt"
"net"
"time"

"github.com/5amu/dnshunter/pkg/output"
"github.com/5amu/dnshunter/pkg/utils"
Expand Down Expand Up @@ -43,7 +44,7 @@ func (c *AXFRCheck) Start(domain string, nameservers *utils.Nameservers) error {
res.Zone = domain
res.Vulnerable = false

conn, err := net.Dial("tcp", net.JoinHostPort(nameservers.GetIP(fqdn).String(), "53"))
conn, err := net.DialTimeout("tcp", net.JoinHostPort(nameservers.GetIP(fqdn).String(), "53"), 2*time.Second)
if err != nil {
continue
}
Expand Down

0 comments on commit f667d55

Please sign in to comment.