dnssim 1.0.0
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/LICENSE +21 -0
- package/README.md +21 -0
- package/ecosystem.config.js +10 -0
- package/known_sites.js +112 -0
- package/main.js +51 -0
- package/package.json +15 -0
- package/site_generator.js +73 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Dustin Van Tate Testa
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# dnssim - DNS Traffic Simulator
|
2
|
+
Because they want to sell my DNS history, AT&T doesn't allow me to change the DNS server in the router I have to pay them to use. So I threw together this script which sends random requests -- making DNS data worthless.
|
3
|
+
|
4
|
+
## Setup
|
5
|
+
The app has no dependencies! Just use `npm run deploy`, `npm start` or `node main.js` and it should start making requests.
|
6
|
+
|
7
|
+
### Environment Variables
|
8
|
+
#### `DNS_SERVERS`
|
9
|
+
Set this to a comma-separated list of ip addresses for DNS servers to send requests to.
|
10
|
+
#### `THREADS`
|
11
|
+
Maximum number of simultaneous requests to send. Comparable to number of active devices to simulate being on your network.
|
12
|
+
|
13
|
+
## Same problem, different ISP?
|
14
|
+
If your ISP is equally evil you can simply change the line in `main.js` starting with `dns.setServers([...` to use whatever DNS servers they're shoving down your throat.
|
15
|
+
|
16
|
+
## Legal
|
17
|
+
### ISP
|
18
|
+
The volume of requests shouldn't be significantly higher than what would be generated from regular browsing activty and nowhere near enough to contribute to a DDoS. The purpose of the requests is only to mitigate the damage done by your willful violation of our privacy rights (as evidenced by language used on your website). Your support team says that in order to use a different DNS service one must change the DNS settings on all devices on the network (instead of the router we're required to use) but in reality many devices don't support such advanced network configuration settings (and doing so would degrade performance), so the best solution is just to generate fake requests so that the requests sent from unprotected devices are burried in bogus requests and authenticity cannot be verified. Your actions are introducing serious security risks to American consumers as DNS data can be used to, for example, find vulnerable IoT devices on a network.
|
19
|
+
|
20
|
+
### User
|
21
|
+
I do not recommend using this with a DNS server that you don't control or modifying the code to use multiple threads. If you're really paranoid about security I'd combine this with a VPN .
|
package/known_sites.js
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
|
2
|
+
module.exports = [
|
3
|
+
// Shameless self-promotion
|
4
|
+
'dvtt.net',
|
5
|
+
'xtie.net',
|
6
|
+
'xssaas.com',
|
7
|
+
'bodge.dev',
|
8
|
+
'dvtate.github.io',
|
9
|
+
'corki.js.org',
|
10
|
+
'ridder.xyz',
|
11
|
+
'xss.software',
|
12
|
+
'gitadopt.org',
|
13
|
+
'gitadopt.com',
|
14
|
+
|
15
|
+
// Promos
|
16
|
+
'birdmonitors.net',
|
17
|
+
'ubuntu.com',
|
18
|
+
'archlinux.org',
|
19
|
+
'redhat.com',
|
20
|
+
'996.icu',
|
21
|
+
'www.spamhaus.org',
|
22
|
+
'githubcopilotinvestigation.com',
|
23
|
+
'tilde.club',
|
24
|
+
'infoseccorp.com',
|
25
|
+
|
26
|
+
// Public good
|
27
|
+
'wikipedia.org',
|
28
|
+
|
29
|
+
// Popular search engines
|
30
|
+
'google.com',
|
31
|
+
'ddg.co',
|
32
|
+
'duckduckgo.com',
|
33
|
+
'searx.work',
|
34
|
+
'goo.gl',
|
35
|
+
|
36
|
+
// Gaming
|
37
|
+
'leagueoflegends.com',
|
38
|
+
'riotgames.com',
|
39
|
+
'lol.gg',
|
40
|
+
'op.gg',
|
41
|
+
'lolalytics.com',
|
42
|
+
|
43
|
+
// Shopping
|
44
|
+
'ebay.com',
|
45
|
+
'walmart.com',
|
46
|
+
'amazon.com',
|
47
|
+
'bestbuy.com',
|
48
|
+
|
49
|
+
// Tech
|
50
|
+
'apple.com',
|
51
|
+
'intel.com',
|
52
|
+
'amazon.com',
|
53
|
+
'hp.com',
|
54
|
+
|
55
|
+
// Social media
|
56
|
+
'fb.com',
|
57
|
+
'facebook.com',
|
58
|
+
'myspace.com',
|
59
|
+
'reddit.com',
|
60
|
+
'twitter.com',
|
61
|
+
'youtube.com',
|
62
|
+
// 'tiktok.com',
|
63
|
+
'snapchat.com',
|
64
|
+
't.co',
|
65
|
+
'aol.com',
|
66
|
+
'blogger.com',
|
67
|
+
'tumblr.com',
|
68
|
+
'pinterest.com',
|
69
|
+
'blogspot.com',
|
70
|
+
'yelp.com',
|
71
|
+
|
72
|
+
// news
|
73
|
+
'cnn.com',
|
74
|
+
'wsj.com',
|
75
|
+
'reuters.com',
|
76
|
+
'apnews.com',
|
77
|
+
'bloomberg.com',
|
78
|
+
'yahoo.com',
|
79
|
+
'gizmodo.com',
|
80
|
+
'sciencedirect.com',
|
81
|
+
'forbes.com',
|
82
|
+
'nature.com',
|
83
|
+
'wired.co.uk',
|
84
|
+
'cnet.com',
|
85
|
+
'nola.com',
|
86
|
+
'nypost.com',
|
87
|
+
|
88
|
+
// Entertainment
|
89
|
+
'netflix.com',
|
90
|
+
'twitch.tv',
|
91
|
+
'youtube.com',
|
92
|
+
'last.fm',
|
93
|
+
'spotify.com',
|
94
|
+
'pandora.com',
|
95
|
+
|
96
|
+
// Nerd
|
97
|
+
'github.com',
|
98
|
+
'stackoverflow.com',
|
99
|
+
|
100
|
+
// Schools
|
101
|
+
'iit.edu',
|
102
|
+
'uchicago.edu',
|
103
|
+
|
104
|
+
// Other
|
105
|
+
'wix.com',
|
106
|
+
'zoom.earth',
|
107
|
+
'robinhood.com',
|
108
|
+
'x.com',
|
109
|
+
'wasm.builders',
|
110
|
+
'feedburner.com',
|
111
|
+
|
112
|
+
];
|
package/main.js
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
const dns = require('dns');
|
3
|
+
|
4
|
+
const genDomain = require('./site_generator');
|
5
|
+
const knownSites = require('./known_sites');
|
6
|
+
|
7
|
+
dns.setServers(
|
8
|
+
process.env.DNS_SERVERS
|
9
|
+
? process.env.DNS_SERVERS.split(',')
|
10
|
+
: [ '68.94.156.1', '68.94.157.1' ] // AT&T DNS servers
|
11
|
+
);
|
12
|
+
|
13
|
+
let requestsSent = 0;
|
14
|
+
|
15
|
+
const spacepad = ' ';
|
16
|
+
function randLookup() {
|
17
|
+
const domain = genDomain({ minLength: 3, maxLength: 20 });
|
18
|
+
process.stdout.write(`\r[${requestsSent++}] resolve ${domain}${spacepad}`);
|
19
|
+
dns.resolveAny(domain, err => {
|
20
|
+
if (err && err.code !== 'ENOTFOUND')
|
21
|
+
console.error(`\rERROR: lookup ${domain}:`, err.code, ' ');
|
22
|
+
|
23
|
+
// If server is busy, slow down
|
24
|
+
if (os.loadavg()[0] > 0.5)
|
25
|
+
setTimeout(randLookup, 1000);
|
26
|
+
else
|
27
|
+
randLookup();
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
// Spawn threads
|
32
|
+
const nThreads = process.env.THREADS || 16;
|
33
|
+
for (let i = 0; i < nThreads; i++)
|
34
|
+
randLookup();
|
35
|
+
console.log(`\nSpawned ${nThreads} random lookup threads`);
|
36
|
+
|
37
|
+
|
38
|
+
function knownLookup() {
|
39
|
+
const domain = knownSites[Math.floor(Math.random() * knownSites.length)];
|
40
|
+
// process.stdout.write(`\r[${requestsSent++}] dig ${domain}${}`);
|
41
|
+
requestsSent++;
|
42
|
+
dns.resolveAny(domain, err => {
|
43
|
+
if (err)
|
44
|
+
console.error(`\rERROR: known ${domain}:`, err);
|
45
|
+
|
46
|
+
setTimeout(knownLookup, 5000);
|
47
|
+
});
|
48
|
+
}
|
49
|
+
|
50
|
+
knownLookup();
|
51
|
+
console.log('\nSpawned 1 known lookup thread');
|
package/package.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "dnssim",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "protestware ware to send randomly genereated dns requests so that maybe att will let me change dns servers on my router",
|
5
|
+
"main": "main.js",
|
6
|
+
"scripts": {
|
7
|
+
"start": "node main.js",
|
8
|
+
"deploy": "until npm start; do echo \"exited with code $?. Restarting...\" > /dev/stderr; sleep 1; done"
|
9
|
+
},
|
10
|
+
"keywords": [
|
11
|
+
"dns"
|
12
|
+
],
|
13
|
+
"author": "dvtate",
|
14
|
+
"license": "MIT"
|
15
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
const tldWeights = {
|
4
|
+
com: 100,
|
5
|
+
tk: 2,
|
6
|
+
net: 12,
|
7
|
+
org: 10,
|
8
|
+
info: 6,
|
9
|
+
io: 5,
|
10
|
+
dev: 3,
|
11
|
+
biz: 1,
|
12
|
+
gg: 2,
|
13
|
+
xyz: 4,
|
14
|
+
work: 1,
|
15
|
+
app: 1,
|
16
|
+
ml: 1,
|
17
|
+
ai: 1,
|
18
|
+
us: 1,
|
19
|
+
// 'co.uk': 1,
|
20
|
+
// 'co.jp': 1,
|
21
|
+
tv: 1,
|
22
|
+
club: 1,
|
23
|
+
live: 1,
|
24
|
+
ga: 1,
|
25
|
+
space: 1,
|
26
|
+
online: 1,
|
27
|
+
earth: 1,
|
28
|
+
me: 2,
|
29
|
+
co: 1,
|
30
|
+
to: 1,
|
31
|
+
ca: 1,
|
32
|
+
edu: 2,
|
33
|
+
page: 1,
|
34
|
+
fm: 1,
|
35
|
+
am: 1,
|
36
|
+
eu: 1,
|
37
|
+
};
|
38
|
+
|
39
|
+
const tldPicker = [].concat(
|
40
|
+
...Object.entries(tldWeights)
|
41
|
+
.map(([k, v]) => new Array(v).fill(k)));
|
42
|
+
|
43
|
+
// Note that last char cannot be start or end of domain
|
44
|
+
const domainChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-';
|
45
|
+
|
46
|
+
const prefixes = [
|
47
|
+
'attsux',
|
48
|
+
'not4sale',
|
49
|
+
'goaway',
|
50
|
+
'letmechangedns',
|
51
|
+
'givemedns',
|
52
|
+
'trashrouter',
|
53
|
+
];
|
54
|
+
|
55
|
+
function generateDomain(options = {}) {
|
56
|
+
const minLength = options.minLength || 1;
|
57
|
+
const maxLength = options.maxLength || 20;
|
58
|
+
const len = Math.floor(Math.random() * (maxLength - minLength) + minLength);
|
59
|
+
|
60
|
+
let ret = '';
|
61
|
+
if (Math.random() > 0.5)
|
62
|
+
ret += prefixes[Math.floor(Math.random() * prefixes.length)];
|
63
|
+
|
64
|
+
ret += domainChars[Math.floor(Math.random() * (domainChars.length - 1))];
|
65
|
+
for (let i = 1; i < len - 1; i++)
|
66
|
+
ret += domainChars[Math.floor(Math.random() * domainChars.length)];
|
67
|
+
ret += domainChars[Math.floor(Math.random() * (domainChars.length - 1))];
|
68
|
+
|
69
|
+
ret += '.' + tldPicker[Math.floor(Math.random() * tldPicker.length)];
|
70
|
+
return ret;
|
71
|
+
}
|
72
|
+
|
73
|
+
module.exports = generateDomain;
|