anshumanbh / tko-subs

A tool that can help detect and takeover subdomains with dead DNS records
MIT License
745 stars 137 forks source link

panic: open /dev/null: too many open files #8

Closed rabidang3ls closed 7 years ago

rabidang3ls commented 7 years ago

Running tko-subs on Kali Linux I receive an error if I have 375 domains in the domains.txt file, but no error if I only have 350 domains. The error is:

# go run tkosubs.go
panic: open /dev/null: too many open files

goroutine 92 [running]:
main.Checkiferr(0x80e660, 0xc420467170)
    /opt/tko-subs/tkosubs.go:44 +0x4a
main.scanforeachDomain(0xc4200acfa0, 0x16, 0x858e60, 0x0, 0x0, 0xc420011180)
    /opt/tko-subs/tkosubs.go:195 +0x120
created by main.main
    /opt/tko-subs/tkosubs.go:316 +0x2ec
exit status 2
#

I managed to get around the error by upping the allowed open files by adding these two lines to /etc/security/limits.conf:

* soft nofile 999999
* hard nofile 999999

I don't understand exactly what is going on, but thought it wise to bring it to your attention.

random-robbie commented 7 years ago

same issue here.

docker run -it tko:latest panic: exec: "dig": executable file not found in $PATH

goroutine 5 [running]: main.Checkiferr(0x80f6e0, 0xc4200c6780) /go/src/app/tko-subs.go:46 +0x4a main.scanforeachDomain(0xc420011128, 0x8, 0xc420092780, 0x14, 0x14, 0xc420011b60) /go/src/app/tko-subs.go:197 +0x120 created by main.main /go/src/app/tko-subs.go:423 +0x32a

anshumanbh commented 7 years ago

Your error is different.

panic: exec: "dig": executable file not found in $PATH

You need to have dig installed and set in your $PATH

zeknox commented 7 years ago

Same issue here running the latest version:

# ./tko-subs -domains domains.txt 
panic: pipe2: too many open files

goroutine 717 [running]:
main.Checkiferr(0x80f6a0, 0xc42099bf00)
  /root/tko-subs.go:46 +0x4a
main.scanforeachDomain(0xc420221b00, 0x12, 0xc42009e370, 0x16, 0x16, 0xc420063bc0)
  /root/tko-subs.go:197 +0x120
created by main.main
  /root/tko-subs.go:423 +0x32a
anshumanbh commented 7 years ago

Does the domains.txt file have a lot of domains? If so, this is a known bug. I'd recommend trying with a smaller file..

anshumanbh commented 7 years ago

This should be fixed with the latest code push. If not, please create a new bug. Thanks!