Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Fixes fingerprints.json: too many open files Error #49

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

zeknox
Copy link
Contributor

@zeknox zeknox commented Feb 4, 2020

While running the tool with the following arguments the script would error due to a condition where too many open files occurred.

$ subjack -w targets.txt -t 100 -timeout 30 -o results.json -a

...

2020/02/04 02:33:04 open /go//src/github.com/haccer/subjack/fingerprints.json: too many open files

After review, it appears that each goroutine within subjack.dns() would read the fingerprints file. Refactored the code to read the fingerprints.json file once and then pass the []Fingerprints struct into the goroutines.

This appears to be working well for me and likely has some performance gains as well.

  • fixes fingerprints.json: too many open files condition by reading the file once and passing data into the goroutine functions

… file once and passing data into the goroutine functions
@AnotherWayIn
Copy link

Thanks for fixing this. After adding the fixes manually, is there an easier way to compile these changes? I'm getting:

../../../src/subjack/dns.go:8:2: cannot find package "github.com/haccer/available" in any of:
        /usr/lib/go-1.13/src/github.com/haccer/available (from $GOROOT)
        /root/go/src/src/github.com/haccer/available (from $GOPATH)
../../../src/subjack/dns.go:9:2: cannot find package "github.com/miekg/dns" in any of:
        /usr/lib/go-1.13/src/github.com/miekg/dns (from $GOROOT)
        /root/go/src/src/github.com/miekg/dns (from $GOPATH)
../../../src/subjack/requests.go:5:2: cannot find package "github.com/valyala/fasthttp" in any of:
        /usr/lib/go-1.13/src/github.com/valyala/fasthttp (from $GOROOT)
        /root/go/src/src/github.com/valyala/fasthttp (from $GOPATH)

@zeknox
Copy link
Contributor Author

zeknox commented Feb 4, 2020

Navigate into the $GOPATH/src/github.com/haccer/subjack/ directory or wherever you pulled it down too. Execute go get . to install the dependency packages, and then try to go build or go run

This PR does not fully fix the too many files issue, but likely helps.

@haccer haccer merged commit 390b93d into haccer:master Sep 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants