pentest-tool-lite 3.9.1 → 3.9.3
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/package.json +1 -1
- package/src/dns/A.js +2 -2
- package/src/dns/DMARC.js +3 -2
- package/src/dns/NS.js +3 -2
- package/src/dns/RegistrationDate.js +3 -2
- package/src/functions/getDomain.d.ts +2 -0
- package/src/functions/getDomain.js +14 -0
- package/src/functions/parseXml.js +1 -1
package/package.json
CHANGED
package/src/dns/A.js
CHANGED
|
@@ -27,7 +27,7 @@ class A extends Test_1.default {
|
|
|
27
27
|
const response = yield new Promise((resolve, reject) => {
|
|
28
28
|
dns_1.default.lookup((new URL(url).hostname), { all: true }, (err, addresses) => {
|
|
29
29
|
if (err) {
|
|
30
|
-
reject(err);
|
|
30
|
+
return reject(err);
|
|
31
31
|
}
|
|
32
32
|
resolve(addresses);
|
|
33
33
|
});
|
|
@@ -48,7 +48,7 @@ class A extends Test_1.default {
|
|
|
48
48
|
const organization = yield new Promise((resolve, reject) => {
|
|
49
49
|
whois_1.default.lookup(ip, function (err, data) {
|
|
50
50
|
if (err) {
|
|
51
|
-
reject(err);
|
|
51
|
+
return reject(err);
|
|
52
52
|
}
|
|
53
53
|
const organization = data.split('\n')
|
|
54
54
|
.filter((line) => line.includes('OrgName'))
|
package/src/dns/DMARC.js
CHANGED
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const dns_1 = __importDefault(require("dns"));
|
|
16
16
|
const Test_1 = __importDefault(require("../Test"));
|
|
17
17
|
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
+
const getDomain_1 = __importDefault(require("../functions/getDomain"));
|
|
18
19
|
class DMARC extends Test_1.default {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -24,9 +25,9 @@ class DMARC extends Test_1.default {
|
|
|
24
25
|
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
25
26
|
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
26
27
|
const response = yield new Promise((resolve, reject) => {
|
|
27
|
-
dns_1.default.resolveTxt(`_dmarc.${(
|
|
28
|
+
dns_1.default.resolveTxt(`_dmarc.${(0, getDomain_1.default)(url)}`, (err, records) => {
|
|
28
29
|
if (err) {
|
|
29
|
-
reject(err);
|
|
30
|
+
return reject(err);
|
|
30
31
|
}
|
|
31
32
|
resolve(records);
|
|
32
33
|
});
|
package/src/dns/NS.js
CHANGED
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const whois_1 = __importDefault(require("whois"));
|
|
16
16
|
const Test_1 = __importDefault(require("../Test"));
|
|
17
17
|
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
+
const getDomain_1 = __importDefault(require("../functions/getDomain"));
|
|
18
19
|
class NS extends Test_1.default {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -23,7 +24,7 @@ class NS extends Test_1.default {
|
|
|
23
24
|
test(_a) {
|
|
24
25
|
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
25
26
|
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
26
|
-
const nameServers = yield this.getNameServers((
|
|
27
|
+
const nameServers = yield this.getNameServers((0, getDomain_1.default)(url));
|
|
27
28
|
return {
|
|
28
29
|
status: 'SUCCESS',
|
|
29
30
|
title: this.constructor.name,
|
|
@@ -36,7 +37,7 @@ class NS extends Test_1.default {
|
|
|
36
37
|
const nameServers = yield new Promise((resolve, reject) => {
|
|
37
38
|
whois_1.default.lookup(domain, function (err, data) {
|
|
38
39
|
if (err) {
|
|
39
|
-
reject(err);
|
|
40
|
+
return reject(err);
|
|
40
41
|
}
|
|
41
42
|
const nameServers = data.split('\n')
|
|
42
43
|
.filter((line) => line.includes('Name Server'))
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const whois_1 = __importDefault(require("whois"));
|
|
16
16
|
const Test_1 = __importDefault(require("../Test"));
|
|
17
17
|
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
+
const getDomain_1 = __importDefault(require("../functions/getDomain"));
|
|
18
19
|
class RegistrationDate extends Test_1.default {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -23,7 +24,7 @@ class RegistrationDate extends Test_1.default {
|
|
|
23
24
|
test(_a) {
|
|
24
25
|
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
25
26
|
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
26
|
-
const registrationDate = yield this.getRegistrationDate((
|
|
27
|
+
const registrationDate = yield this.getRegistrationDate((0, getDomain_1.default)(url));
|
|
27
28
|
const diffInMs = (new Date(registrationDate)).getTime() - (new Date()).getTime();
|
|
28
29
|
const diffInDays = diffInMs / (1000 * 60 * 60 * 24);
|
|
29
30
|
return {
|
|
@@ -38,7 +39,7 @@ class RegistrationDate extends Test_1.default {
|
|
|
38
39
|
const date = yield new Promise((resolve, reject) => {
|
|
39
40
|
whois_1.default.lookup(domain, function (err, data) {
|
|
40
41
|
if (err) {
|
|
41
|
-
reject(err);
|
|
42
|
+
return reject(err);
|
|
42
43
|
}
|
|
43
44
|
const d = data.split('\n')
|
|
44
45
|
.filter((line) => line.includes('Expiration Date'))
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getDomain = (url) => {
|
|
4
|
+
const hostname = (new URL(url)).hostname;
|
|
5
|
+
const parts = hostname.split('.');
|
|
6
|
+
if (parts.length === 2) {
|
|
7
|
+
return hostname;
|
|
8
|
+
}
|
|
9
|
+
if (parts.length === 3 && parts[1].length > parts[2].length) {
|
|
10
|
+
return hostname.replace(`${parts[0]}.`, '');
|
|
11
|
+
}
|
|
12
|
+
return hostname;
|
|
13
|
+
};
|
|
14
|
+
exports.default = getDomain;
|