@burtthecoder/mcp-dnstwist 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/index.js +1 -1
- package/build/validate.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ This tool is designed for legitimate security research purposes. Please:
|
|
|
17
17
|
|
|
18
18
|
## Requirements
|
|
19
19
|
|
|
20
|
-
- Node.js (
|
|
20
|
+
- Node.js (v20 or later)
|
|
21
21
|
- Docker
|
|
22
22
|
- macOS, Linux, or Windows with Docker Desktop installed
|
|
23
23
|
|
|
@@ -100,8 +100,8 @@ npm run build
|
|
|
100
100
|
- Description: Generate and analyze domain permutations to detect potential typosquatting, phishing, and brand impersonation
|
|
101
101
|
- Parameters:
|
|
102
102
|
* `domain` (required): Domain name to analyze (e.g., example.com)
|
|
103
|
-
* `nameservers` (optional, default: "1.1.1.1"): Comma-separated
|
|
104
|
-
* `threads` (optional, default: 50): Number of threads for parallel processing
|
|
103
|
+
* `nameservers` (optional, default: "1.1.1.1"): Comma-separated DNS servers, up to 10. Each must be an IPv4 address or a DNS-over-HTTPS URL such as `https://cloudflare-dns.com/dns-query` (the forms dnstwist accepts). DNS-over-HTTPS is much slower: a DoH-only scan can take over 10 minutes, so include an IPv4 resolver unless you need DoH
|
|
104
|
+
* `threads` (optional, default: 50): Number of threads for parallel processing (1-100)
|
|
105
105
|
* `format` (optional, default: "json"): Output format (json, csv, list)
|
|
106
106
|
* `registered_only` (optional, default: true): Show only registered domains
|
|
107
107
|
* `mxcheck` (optional, default: true): Check for MX records
|
package/build/index.js
CHANGED
|
@@ -80,7 +80,7 @@ class DnstwistServer {
|
|
|
80
80
|
},
|
|
81
81
|
nameservers: {
|
|
82
82
|
type: 'string',
|
|
83
|
-
description: 'Comma-separated
|
|
83
|
+
description: 'Comma-separated DNS servers: IPv4 addresses or DNS-over-HTTPS URLs such as https://cloudflare-dns.com/dns-query (default: 1.1.1.1)',
|
|
84
84
|
default: '1.1.1.1'
|
|
85
85
|
},
|
|
86
86
|
threads: {
|
package/build/validate.js
CHANGED
|
@@ -7,6 +7,8 @@ import { domainToASCII } from 'url';
|
|
|
7
7
|
const HOSTNAME = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$/i;
|
|
8
8
|
const FORMATS = ['json', 'csv', 'list'];
|
|
9
9
|
const MAX_NAMESERVERS = 10;
|
|
10
|
+
// The DNS-over-HTTPS form dnstwist accepts (dnstwist.py --nameservers parsing).
|
|
11
|
+
const DOH = /^https:\/\/([a-z0-9.-]{4,253})\/dns-query$/;
|
|
10
12
|
function invalid(message) {
|
|
11
13
|
throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for fuzz_domain: ${message}`);
|
|
12
14
|
}
|
|
@@ -42,12 +44,18 @@ export function validateFuzzArgs(args) {
|
|
|
42
44
|
const rawNameservers = a.nameservers === undefined ? '1.1.1.1' : a.nameservers;
|
|
43
45
|
if (typeof rawNameservers !== 'string')
|
|
44
46
|
invalid('nameservers must be a string');
|
|
47
|
+
// dnstwist only accepts IPv4 addresses and https://<host>/dns-query URLs, so
|
|
48
|
+
// anything else would fail inside the container anyway.
|
|
45
49
|
const servers = rawNameservers.split(',').map((ns) => {
|
|
46
50
|
const trimmed = ns.trim();
|
|
47
|
-
|
|
51
|
+
if (isIP(trimmed) === 4)
|
|
52
|
+
return trimmed;
|
|
53
|
+
const doh = trimmed.match(DOH);
|
|
54
|
+
return doh && (isIP(doh[1]) === 4 || HOSTNAME.test(doh[1])) ? trimmed : null;
|
|
48
55
|
});
|
|
49
56
|
if (servers.length > MAX_NAMESERVERS || servers.some((ns) => !ns)) {
|
|
50
|
-
invalid(`nameservers must be up to ${MAX_NAMESERVERS} comma-separated
|
|
57
|
+
invalid(`nameservers must be up to ${MAX_NAMESERVERS} comma-separated IPv4 addresses ` +
|
|
58
|
+
'or DNS-over-HTTPS URLs like https://cloudflare-dns.com/dns-query');
|
|
51
59
|
}
|
|
52
60
|
const threads = a.threads === undefined ? 50 : a.threads;
|
|
53
61
|
if (typeof threads !== 'number' || !Number.isInteger(threads) || threads < 1 || threads > 100) {
|
package/package.json
CHANGED