d3mondev / puredns

Puredns is a fast domain resolver and subdomain bruteforcing tool that can accurately filter out wildcard subdomains and DNS poisoned entries.
GNU General Public License v3.0
1.72k stars 160 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #47

Closed 0xPugal closed 1 year ago

0xPugal commented 1 year ago
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6a6d8c]

goroutine 32 [running]:
github.com/d3mondev/resolvermt.(*resolverDNS).Resolve(0xc0003e0180, {0xc00030bc20, 0x1d}, 0x0?)
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/resolverdns.go:46 +0x6c
github.com/d3mondev/resolvermt.(*clientDNS).startThreads.func1(0x0?)
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/client_dns.go:50 +0x3f
created by github.com/d3mondev/resolvermt.(*clientDNS).startThreads
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/client_dns.go:42 +0x65
d3mondev commented 1 year ago

Do you have any information about how to reproduce this issue?

d3mondev commented 1 year ago

More specifically, if you could share the command line you used and the content of your resolvers.txt file it would be appreciated.

Thanks!

0xPugal commented 1 year ago

I ran the puredns with txt file contains 4 domains. and i got the subdomains for 1st target and then i got the above error

cat domain.txt | xargs -I @ sh -c 'puredns wordlists.txt @ --resolvers resolvers.txt --resolvers-trusted resolvers_trusted.txt -q | tee @_puredns.txt'
0xPugal commented 1 year ago

I used the Trickest resolver

d3mondev commented 1 year ago

I'm sorry, I still cannot reproduce the issue. Do you use trusted resolvers from trickest as well? If not, could you share the content of your resolvers_trusted.txt file?

Here's the test that I did. I used resolvers.txt and resolvers-trusted.txt from trickest.

words.txt:

www
ftp
mail

domains.txt:

example1.com
example2.com
example3.com
example4.com

Result of the command:

$ cat domains.txt | xargs -I @ sh -c 'puredns bruteforce words.txt @ --resolvers resolvers.txt --resolvers-trusted resolvers-trusted.txt -q | tee @_puredns.txt'
mail.example1.com
www.example1.com
ftp.example1.com
www.example2.com
0xPugal commented 1 year ago

Yeah, Thanks for the reply. I too got the output for the domains. but it shows the errors like this,

mail.example1.com
www.example1.com
ftp.example1.com
www.example2.com
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6a6d8c]

goroutine 32 [running]:
github.com/d3mondev/resolvermt.(*resolverDNS).Resolve(0xc0003e0180, {0xc00030bc20, 0x1d}, 0x0?)
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/resolverdns.go:46 +0x6c
github.com/d3mondev/resolvermt.(*clientDNS).startThreads.func1(0x0?)
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/client_dns.go:50 +0x3f
created by github.com/d3mondev/resolvermt.(*clientDNS).startThreads
        /root/go/pkg/mod/github.com/d3mondev/resolvermt@v0.3.2/client_dns.go:42 +0x65

But now its doesn't shows any error even for me. Thanks <3