Skip to content

Commit 7e9fce5

Browse files
committed
Merge branch 'hotfix/parser'
2 parents dba5718 + 606f467 commit 7e9fce5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

utils/hurricane.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"net/http/httputil"
66
"regexp"
77
"strings"
8+
"time"
89

910
"github.com/PuerkitoBio/goquery"
1011
"github.com/projectdiscovery/gologger"
@@ -38,6 +39,10 @@ func (h *Hurricane) RunCrawler() {
3839
func (h *Hurricane) Request(url string) string {
3940
opts := retryablehttp.DefaultOptionsSpraying
4041
client := retryablehttp.NewClient(opts)
42+
43+
// Configurando o timeout diretamente no cliente HTTP interno
44+
client.HTTPClient.Timeout = 30 * time.Second
45+
4146
resp, err := client.Get(url)
4247
if err != nil {
4348
panic(err)
@@ -56,7 +61,7 @@ func (h *Hurricane) ExtractDomain(domain string) {
5661
var url = ""
5762

5863
if domain != "" {
59-
url = urlBase + "dns/" + domain
64+
url = urlBase + "dns/" + domain + "#_dns"
6065
}
6166

6267
var str = h.Request(url)
@@ -77,7 +82,7 @@ func (h *Hurricane) ExtractDomains(ipRange string) {
7782
return
7883
}
7984

80-
var url = urlBase + "net/" + ipRange
85+
var url = urlBase + "net/" + ipRange + "#_dnsrecords"
8186
var html = h.Request(url)
8287

8388
h.ParseHTML(strings.NewReader(html))
@@ -89,7 +94,9 @@ func (h *Hurricane) ParseHTML(body io.Reader) {
8994
gologger.Fatal().Msgf("%s", err)
9095
}
9196
var re = regexp.MustCompile(`\/dns\/([^"]+)`)
92-
doc.Find("#_dnsrecords").Each(func(h int, div *goquery.Selection) {
97+
98+
doc.Find("#dnsrecords").Each(func(h int, div *goquery.Selection) {
99+
93100
div.Find("tr").Each(func(i int, tr *goquery.Selection) {
94101
var result Result
95102
tr.Find("td").Each(func(j int, td *goquery.Selection) {

0 commit comments

Comments
 (0)