@k03mad/dns-leak 4.2.1 → 5.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/.github/workflows/lint.yml +0 -3
- package/README.md +2 -2
- package/app/api/ip-leak.js +4 -4
- package/app/api/ip-whois.js +4 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Using API/tools:\
|
|
|
10
10
|
## Global
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
13
|
+
npm i @k03mad/dns-leak -g
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
```bash
|
|
@@ -20,7 +20,7 @@ dns-leak
|
|
|
20
20
|
## API
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
23
|
+
npm i @k03mad/dns-leak
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
```js
|
package/app/api/ip-leak.js
CHANGED
|
@@ -14,7 +14,7 @@ export default class IPLeak {
|
|
|
14
14
|
* @param {number} [opts.dnsRequestsWaitBeforeLastMs] dns leak multi requests wait before the last request (with all ips gathered)
|
|
15
15
|
* @param {number} [opts.dnsSessionStringLength] dns leak session string length, only works with 40 characters for now
|
|
16
16
|
* @param {number} [opts.dnsUniqStringLength] dns leak unique string length for subdomain
|
|
17
|
-
* @param {number} [opts.
|
|
17
|
+
* @param {number} [opts.ipRequestsCacheExpireSec] ip info requests cache ttl ms for same ip
|
|
18
18
|
* @param {number} [opts.requestsRps] parallel requests rps
|
|
19
19
|
*/
|
|
20
20
|
constructor({
|
|
@@ -22,14 +22,14 @@ export default class IPLeak {
|
|
|
22
22
|
dnsRequestsWaitBeforeLastMs = 2000,
|
|
23
23
|
dnsSessionStringLength = 40,
|
|
24
24
|
dnsUniqStringLength = 20,
|
|
25
|
-
|
|
25
|
+
ipRequestsCacheExpireSec = 3600,
|
|
26
26
|
requestsRps = 2,
|
|
27
27
|
} = {}) {
|
|
28
28
|
this._dnsRequestsCount = dnsRequestsCount;
|
|
29
29
|
this._dnsRequestsWaitBeforeLastMs = dnsRequestsWaitBeforeLastMs;
|
|
30
30
|
this._dnsSessionStringLength = dnsSessionStringLength;
|
|
31
31
|
this._dnsUniqStringLength = dnsUniqStringLength;
|
|
32
|
-
this.
|
|
32
|
+
this._ipRequestsCacheExpireSec = ipRequestsCacheExpireSec;
|
|
33
33
|
this._requestsRps = requestsRps;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -108,7 +108,7 @@ export default class IPLeak {
|
|
|
108
108
|
const ipEndpoint = IPLeak.endpoints.ip(ip);
|
|
109
109
|
|
|
110
110
|
const {body} = await requestCache(ipEndpoint, {}, {
|
|
111
|
-
expire: this.
|
|
111
|
+
expire: this._ipRequestsCacheExpireSec,
|
|
112
112
|
rps: this._requestsRps,
|
|
113
113
|
});
|
|
114
114
|
|
package/app/api/ip-whois.js
CHANGED
|
@@ -5,14 +5,14 @@ export default class IPWhois {
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {object} [opts]
|
|
8
|
-
* @param {number} [opts.
|
|
8
|
+
* @param {number} [opts.ipRequestsCacheExpireSec] ip info requests cache ttl ms for same ip
|
|
9
9
|
* @param {number} [opts.requestsRps] parallel requests rps
|
|
10
10
|
*/
|
|
11
11
|
constructor({
|
|
12
|
-
|
|
12
|
+
ipRequestsCacheExpireSec = 3600,
|
|
13
13
|
requestsRps = 2,
|
|
14
14
|
} = {}) {
|
|
15
|
-
this.
|
|
15
|
+
this._ipRequestsCacheExpireSec = ipRequestsCacheExpireSec;
|
|
16
16
|
this._requestsRps = requestsRps;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -34,7 +34,7 @@ export default class IPWhois {
|
|
|
34
34
|
const ipEndpoint = IPWhois.endpoints.ip(ip);
|
|
35
35
|
|
|
36
36
|
const {body} = await requestCache(ipEndpoint, {}, {
|
|
37
|
-
expire: this.
|
|
37
|
+
expire: this._ipRequestsCacheExpireSec,
|
|
38
38
|
rps: this._requestsRps,
|
|
39
39
|
});
|
|
40
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k03mad/dns-leak",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "DNS leak test",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
"Kirill Molchanov <k03.mad@gmail.com"
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"ora": "8.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@k03mad/eslint-config": "18.
|
|
30
|
+
"@k03mad/eslint-config": "18.1.0",
|
|
31
31
|
"eslint": "8.56.0",
|
|
32
32
|
"husky": "8.0.3"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"lint": "
|
|
35
|
+
"lint": "npm run lint:eslint",
|
|
36
36
|
"lint:eslint": "eslint ./ --cache",
|
|
37
|
-
"clean": "
|
|
37
|
+
"clean": "npm run clean:modules && npm run clean:eslint:cache",
|
|
38
38
|
"clean:modules": "rm -rf ./node_modules || true",
|
|
39
39
|
"clean:eslint:cache": "rm -rf .eslintcache || true",
|
|
40
|
-
"setup": "
|
|
40
|
+
"setup": "npm run clean && npm i",
|
|
41
41
|
"prepare": "husky install || true"
|
|
42
42
|
}
|
|
43
43
|
}
|