Skip to content

Commit

Permalink
Adjust massdns command line parameter -s to limit the size of the ini…
Browse files Browse the repository at this point in the history
…tial burst of queries sent to the trusted resolvers. Increase the default rate limit per trusted resolver to 50.
  • Loading branch information
d3mondev committed Apr 13, 2021
1 parent 506dda4 commit 1bc3f94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- No changes yet.

## [1.0.3] - 2021-04-12
### Fixed
- Remove Cloudflare DNS from the list of trusted resolvers. [Here's why](https://twitter.com/d3mondev/status/1381678504450924552?s=20).
- Increase the default rate limit per trusted resolvers to 50.
- Adjust massdns command line parameter -s to limit the size of the initial burst of queries sent to the trusted resolvers.

## [1.0.2] - 2021-03-22
### Fixed
- Fix a badly handled exception during wildcard detection that was halting the process.
Expand Down
10 changes: 6 additions & 4 deletions puredns
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

program_name="puredns"
program_version="v1.0.2"
program_version="v1.0.3"
program_description="Very accurate massdns resolving and bruteforcing."

COL_LOGO='\033[0;36m'
Expand Down Expand Up @@ -48,7 +48,7 @@ usage() {
echo " -l, --limit Limit queries per second for public resolvers"
echo " (default: unlimited)"
echo " -lt, --limit-trusted Limit queries per second for trusted resolvers"
echo " (default: 10 * number of trusted resolvers)"
echo " (default: 50 * number of trusted resolvers)"
echo ""
echo " -ss, --skip-sanitize Do not sanitize the list of domains to test"
echo " By default, domains are set to lowercase and"
Expand Down Expand Up @@ -253,7 +253,7 @@ parse_args() {
set -u

if [[ "${limit_rate_trusted}" -eq 0 ]]; then
limit_rate_trusted=$(( $(wc -l "${resolvers_trusted_file}" | awk '{ print $1 }') * 10 ))
limit_rate_trusted=$(( $(wc -l "${resolvers_trusted_file}" | awk '{ print $1 }') * 50 ))
fi
}

Expand Down Expand Up @@ -348,12 +348,14 @@ invoke_massdns() {
local count="$(cat "${domains_file}" | wc -l)"

local pv_args=("-l" "-F" "Queries per seconds: %r %t %e Progress: %p" "-s" "${count}")
local massdns_args=()
if [[ ! "${rate}" -eq 0 ]]; then
pv_args+=("-L" "${rate}")
massdns_args=("-s" "${rate}")
fi

printf "${COL_PV}" >&2
cat "${domains_file}" | pv "${pv_args[@]}" | "${massdns_bin}" -q -r "${resolvers}" -o S -t A -w "${massdns_outputfile}"
cat "${domains_file}" | pv "${pv_args[@]}" | "${massdns_bin}" -q -r "${resolvers}" -o S -t A -w "${massdns_outputfile}" "${massdns_args[@]}"
cat "${massdns_outputfile}" | awk -F '. ' '{ print $1 }' | sort -u > "${domains_outputfile}"
printf "${COL_RESET}" >&2
}
Expand Down

0 comments on commit 1bc3f94

Please sign in to comment.