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.29k stars 184 forks source link

hashmap size -s argument #258

Closed jaikishantulswani closed 7 months ago

jaikishantulswani commented 7 months ago

@ehsandeep @Mzack9999 shuffledns is not accepting the custom value given through the argument -mcmd for hashmap argument of massdns like if we try to give -mcmd -s 35, shuffledns execute the command with default value and with provided one like -s 10000 -s 35 One more thing, is there any way to use massdns --processes argument to run parallel processes with shuffldns

dogancanbakir commented 7 months ago

I couldn't repro the issue. Do you mind sharing full cmd:

$ go run . -d example.com -list example-subdomains.txt -r resolvers.txt -mcmd '-s 0' 

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

                projectdiscovery.io

[INF] Current shuffledns version v1.0.9 (latest)
[INF] Creating temporary massdns output file: /var/folders/hx/f8qcbgj91795xdrdnb55qkdc0000gn/T/shuffledns-3174722994/cmsd76va2ua2t2pctoa0
[INF] Executing massdns on example.com
[ERR] Could not run massdns: could not execute massdns: could not execute massdns: exit status 1
detailed error: The argument -s requires a value between 1 and 18446744073709551615.

[INF] Finished resolving. Hack the Planet!
jaikishantulswani commented 7 months ago

@dogancanbakir Thank you for looking into this, Indeed it throws error when we supply -mcmd -s 0 but when you try to resolve a real list and supply -mcmd -s 50 and monitor the massdns command running behind the wrapper it is executing a command like -s 10000 -s 50

dogancanbakir commented 7 months ago

After reviewing the issue again, I believe that the reason behind it is https://github.com/projectdiscovery/shuffledns/blob/db34c6634ca891f7a7df9fe75488373212a0130a/pkg/massdns/process.go#L93 If you want to modify the -s option, try setting -t instead. For instance:

go run . -d example.com -list example-subdomains.txt -r resolvers.txt -t 35

Let me know if you have any questions!

jaikishantulswani commented 7 months ago

@dogancanbakir but this does't help to solve my issue as I want to control the concurrent lookups which is available through -s flag --hashmap-size

dogancanbakir commented 7 months ago

shuffledns' -t flag controls the massdns' -s flag. It seems like this is exactly what you're looking for 👀

jaikishantulswani commented 7 months ago

@dogancanbakir if you still check the running massdns behind the shuffledns wrapper then it still consist the flag -s 10000 which i want to control with -s 50

dogancanbakir commented 7 months ago

Could you please share the details of how you conducted the testing process? This is how I did:

$ go run . -d example.com -list example-subdomains.txt -r resolvers.txt -t 35 & sleep 5; ps -o command -p $(pgrep massdns)
[1] 31144

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

                projectdiscovery.io

[INF] Current shuffledns version v1.0.9 (latest)
[INF] Creating temporary massdns output file: /var/folders/hx/f8qcbgj91795xdrdnb55qkdc0000gn/T/shuffledns-1229974457/cmt08dna2ua7jgq1o570
[INF] Executing massdns on example.com
COMMAND
/usr/local/bin/massdns -r resolvers.txt -o Snl -t A example-subdomains.txt -w /var/folders/hx/f8qcbgj91795xdrdnb55qkdc0000gn/T/shuffledns-1229974457/cmt08dna2ua7jgq1o570 -s 35
jaikishantulswani commented 7 months ago

@dogancanbakir Thank you, it works.One more thing, is there any workaround to use massdns -processes flag in shuffledns as I need to use --processes 2

dogancanbakir commented 7 months ago

You can use -mcmd '--processes 2'.