projectdiscovery / shuffledns

MassDNS wrapper written in go to enumerate valid subdomains using active bruteforce as well as resolve subdomains with wildcard filtering and easy input-output support.
https://projectdiscovery.io
GNU General Public License v3.0
1.3k stars 185 forks source link

Permission denied : could not run massdns #46

Closed JDRanpariya closed 4 years ago

JDRanpariya commented 4 years ago
jdranpariya@DESKTOP-O7SQM7K:/mnt/e/Word_lists$ shuffledns -d target.com -w commonspeak2_subdomains.txt -r resolvers.txt

       __        ________        __
  ___ / /  __ __/ _/ _/ /__  ___/ /__ ___
 (_-</ _ \/ // / _/ _/ / -_)/ _  / _ \(_-<
/___/_//_/\_,_/_//_//_/\__/ \_,_/_//_/___/ v1

                projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] Started generating bruteforce permutation
[INF] Generating permutations took 237.2702ms
[INF] Creating temporary massdns output file: /tmp/shuffledns731669339/bt7ig5jrdkuc1r7rd9k0
[INF] Executing massdns on target.com
[ERR] Could not run massdns: could not execute massdns: could not execute massdns: fork/exec /usr/local/bin/massdns: permission denied
detailed error:
[INF] Finished resolving. Hack the Planet!

I also used sudo shuffledns -d target.com -w commonspeak2_subdomains.txt -r resolvers.txt and I referred to this pr but I'm the only user no need to switch. what are the steps do I need to take?

bsysop commented 4 years ago

Probably execution permission.

chmod +x /usr/local/bin/massdns
JDRanpariya commented 4 years ago

Ohh my bad I kept full dir in /usr/local/bin and had not used command make to create massdns in massdns/bin/massdns Now I'm find with this.

bsysop commented 4 years ago

=]

0xh7ml commented 4 years ago

I'm also facing this problem , any solution please?

koyok99 commented 3 years ago

/ / / / _/ /_ / / __ (-</ \/ // / / / / -)/ / (-< /////_,//////_/ _,////___/ v1

    projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions [WRN] Developers assume no liability and are not responsible for any misuse or damage. [INF] Started generating bruteforce permutation [INF] Generating permutations took 109.882µs [INF] Creating temporary massdns output file: /tmp/shuffledns278906949/bv4rc3k9a3vshk3ut7jg [INF] Executing massdns on test.com [ERR] Could not run massdns: could not execute massdns: could not execute massdns: fork/exec /usr/local/bin/massdns: permission denied detailed error: [INF] Finished resolving. Hack the Planet!

i try put permision chmod +x /usr/local/bin/massdns but error

can tou help me i try create make massdns in massdns/bin/massdns

atikrahman1 commented 3 years ago

The problem is actually in massdns. that massdns will not allow you to run massdns without supplying --root argument when you are the root user. Where shuffledns didn't provide the --root argument when calling massdns command in proccess.go

https://github.com/projectdiscovery/shuffledns/blob/2c66f4987600807a6c75b0993051b5dba37e2124/pkg/massdns/process.go#L92

What I did is to solve this problem edit this code and added --root argument end of the command.

cmd := exec.Command(c.config.MassdnsPath, []string{"-r", c.config.ResolversFile, "-o", "Snl", "-t", "A", c.config.InputFile, "-w", output, "-s", strconv.Itoa(c.config.Threads), "--root"}...)

and rebuild the package and copy the binary to GOBIN PATH.

step to solve

  1. Go to /root/go/src/github.com/projectdiscovery/shuffledns/pkg/massdns/process.go

  2. Edit and save the file

  3. cd root/go/src/github.com/projectdiscovery/shuffledns/cmd/shuffledns

  4. go build && cp shuffledns $GOPATH/bin