pentest-tool-lite 3.9.3 → 3.10.8
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 +19 -0
- package/{src → dist}/Pentest.d.ts +1 -0
- package/dist/Pentest.js +46 -0
- package/{src → dist}/Test.d.ts +1 -0
- package/{src → dist}/Test.js +12 -27
- package/{src → dist}/commands/Sitemap.d.ts +4 -4
- package/dist/commands/Sitemap.js +79 -0
- package/dist/dns/A.js +49 -0
- package/dist/dns/DMARC.js +59 -0
- package/dist/dns/NS.js +36 -0
- package/dist/dns/RegistrationDate.js +39 -0
- package/dist/dns/index.js +47 -0
- package/dist/functions/findEvery.d.ts +2 -0
- package/{src → dist}/functions/getDuplicates.js +1 -0
- package/dist/functions/getGenerator.d.ts +2 -0
- package/{src → dist}/functions/getGenerator.js +3 -0
- package/{src → dist}/functions/getHeading.js +4 -0
- package/{src → dist}/functions/getImages.js +1 -0
- package/dist/functions/getObject.d.ts +2 -0
- package/{src → dist}/functions/getScripts.js +1 -0
- package/{src → dist}/functions/getStylesheets.js +1 -0
- package/{src → dist}/functions/getTitle.js +1 -0
- package/{src → dist}/functions/parseHtml.js +4 -0
- package/dist/functions/parseSitemap.js +12 -0
- package/dist/html/Anchor.js +56 -0
- package/dist/html/CSS.js +92 -0
- package/dist/html/DuplicateId.js +35 -0
- package/dist/html/Generator.js +31 -0
- package/dist/html/Image.js +79 -0
- package/dist/html/JavaScript.js +107 -0
- package/{src → dist}/html/__TESTS__/Generator.test.js +12 -19
- package/dist/html/index.js +51 -0
- package/{src → dist}/index +39 -28
- package/dist/logger/Console.d.ts +14 -0
- package/{src → dist}/logger/Console.js +13 -15
- package/dist/metadata/HTML.d.ts +6 -0
- package/dist/metadata/HTML.js +26 -0
- package/dist/metadata/Markdown.d.ts +6 -0
- package/dist/metadata/Markdown.js +28 -0
- package/dist/metadata/ResponseTime.d.ts +6 -0
- package/dist/metadata/ResponseTime.js +25 -0
- package/dist/metadata/index.d.ts +6 -0
- package/dist/metadata/index.js +45 -0
- package/{src → dist}/request/NodeFetch.d.ts +2 -0
- package/dist/request/NodeFetch.js +58 -0
- package/{src → dist}/request/Request.d.ts +2 -0
- package/dist/request/cache/BlackHoleCache.d.ts +7 -0
- package/{src → dist}/request/cache/BlackHoleCache.js +4 -3
- package/{src → dist}/request/cache/UnlimitedCache.d.ts +1 -2
- package/{src → dist}/request/cache/UnlimitedCache.js +4 -0
- package/dist/request/index.js +11 -0
- package/dist/security/ContentEncoding.js +44 -0
- package/dist/security/ContentSecurityPolicy.js +32 -0
- package/dist/security/Cookies.js +44 -0
- package/dist/security/FingerPrint.js +37 -0
- package/dist/security/GoogleWebRisk.js +44 -0
- package/dist/security/HSTS.js +48 -0
- package/dist/security/HTTPS.js +78 -0
- package/dist/security/HTTPVersion.js +50 -0
- package/dist/security/PermissionsPolicy.js +53 -0
- package/dist/security/Redirect.d.ts +6 -0
- package/dist/security/Redirect.js +37 -0
- package/dist/security/ReferrerPolicy.js +32 -0
- package/dist/security/RobotsTXT.js +28 -0
- package/dist/security/SSL.js +36 -0
- package/dist/security/XFrameOptions.js +32 -0
- package/dist/security/XXSSProtection.js +32 -0
- package/{src → dist}/security/__TESTS__/ContentSecurityPolicy.test.js +12 -19
- package/{src → dist}/security/__TESTS__/FingerPrint.test.js +12 -19
- package/{src → dist}/security/__TESTS__/HSTS.test.js +18 -24
- package/{src → dist}/security/__TESTS__/HTTPS.test.js +18 -24
- package/dist/security/__TESTS__/XFrameOptions.test.js +37 -0
- package/{src → dist}/security/__TESTS__/XXSSProtection.test.js +12 -19
- package/{src → dist}/security/index.js +22 -35
- package/dist/seo/Heading.js +51 -0
- package/dist/seo/Robots.js +21 -0
- package/dist/seo/Sitemap.js +32 -0
- package/dist/seo/Title.js +44 -0
- package/dist/seo/index.js +47 -0
- package/dist/wordpress/DefaultFiles.js +50 -0
- package/dist/wordpress/Generator.js +58 -0
- package/dist/wordpress/index.js +43 -0
- package/package.json +68 -59
- package/src/Pentest.js +0 -43
- package/src/commands/Sitemap.js +0 -94
- package/src/dns/A.js +0 -64
- package/src/dns/DMARC.js +0 -72
- package/src/dns/NS.js +0 -52
- package/src/dns/RegistrationDate.js +0 -55
- package/src/dns/index.js +0 -58
- package/src/functions/findEvery.d.ts +0 -2
- package/src/functions/getGenerator.d.ts +0 -2
- package/src/functions/getObject.d.ts +0 -2
- package/src/functions/parseSitemap.js +0 -22
- package/src/html/Anchor.js +0 -71
- package/src/html/CSS.js +0 -104
- package/src/html/DuplicateId.js +0 -49
- package/src/html/Generator.js +0 -45
- package/src/html/Image.js +0 -92
- package/src/html/JavaScript.js +0 -118
- package/src/html/index.js +0 -62
- package/src/logger/Console.d.ts +0 -14
- package/src/request/NodeFetch.js +0 -49
- package/src/request/cache/BlackHoleCache.d.ts +0 -8
- package/src/request/cache/Cache.d.ts +0 -6
- package/src/request/cache/Cache.js +0 -2
- package/src/request/index.js +0 -7
- package/src/security/ContentEncoding.js +0 -58
- package/src/security/ContentSecurityPolicy.js +0 -46
- package/src/security/Cookies.js +0 -58
- package/src/security/FingerPrint.js +0 -51
- package/src/security/GoogleWebRisk.js +0 -58
- package/src/security/HSTS.js +0 -62
- package/src/security/HTTPS.js +0 -73
- package/src/security/HTTPVersion.js +0 -64
- package/src/security/PermissionsPolicy.js +0 -67
- package/src/security/ReferrerPolicy.js +0 -46
- package/src/security/RobotsTXT.js +0 -42
- package/src/security/SSL.js +0 -50
- package/src/security/XFrameOptions.js +0 -46
- package/src/security/XXSSProtection.js +0 -46
- package/src/security/__TESTS__/XFrameOptions.test.js +0 -44
- package/src/seo/Heading.js +0 -65
- package/src/seo/Robots.js +0 -35
- package/src/seo/Sitemap.js +0 -46
- package/src/seo/Title.js +0 -58
- package/src/seo/index.js +0 -58
- package/src/types/Sitemap.d.ts +0 -9
- package/src/types/Sitemap.js +0 -0
- package/src/wordpress/DefaultFiles.js +0 -66
- package/src/wordpress/Generator.js +0 -75
- package/src/wordpress/index.js +0 -54
- /package/{README.md → dist/README.md} +0 -0
- /package/{src → dist}/config.d.ts +0 -0
- /package/{src → dist}/config.js +0 -0
- /package/{src → dist}/dns/A.d.ts +0 -0
- /package/{src → dist}/dns/DMARC.d.ts +0 -0
- /package/{src → dist}/dns/NS.d.ts +0 -0
- /package/{src → dist}/dns/RegistrationDate.d.ts +0 -0
- /package/{src → dist}/dns/index.d.ts +0 -0
- /package/{src → dist}/functions/findEvery.js +0 -0
- /package/{src → dist}/functions/getAnchors.d.ts +0 -0
- /package/{src → dist}/functions/getAnchors.js +0 -0
- /package/{src → dist}/functions/getDomain.d.ts +0 -0
- /package/{src → dist}/functions/getDomain.js +0 -0
- /package/{src → dist}/functions/getDuplicates.d.ts +0 -0
- /package/{src → dist}/functions/getHeading.d.ts +0 -0
- /package/{src → dist}/functions/getImages.d.ts +0 -0
- /package/{src → dist}/functions/getObject.js +0 -0
- /package/{src → dist}/functions/getScripts.d.ts +0 -0
- /package/{src → dist}/functions/getStylesheets.d.ts +0 -0
- /package/{src → dist}/functions/getTitle.d.ts +0 -0
- /package/{src → dist}/functions/index.d.ts +0 -0
- /package/{src → dist}/functions/index.js +0 -0
- /package/{src → dist}/functions/parseHtml.d.ts +0 -0
- /package/{src → dist}/functions/parseSitemap.d.ts +0 -0
- /package/{src → dist}/functions/parseXml.d.ts +0 -0
- /package/{src → dist}/functions/parseXml.js +0 -0
- /package/{src → dist}/html/Anchor.d.ts +0 -0
- /package/{src → dist}/html/CSS.d.ts +0 -0
- /package/{src → dist}/html/DuplicateId.d.ts +0 -0
- /package/{src → dist}/html/Generator.d.ts +0 -0
- /package/{src → dist}/html/Image.d.ts +0 -0
- /package/{src → dist}/html/JavaScript.d.ts +0 -0
- /package/{src → dist}/html/__TESTS__/Generator.test.d.ts +0 -0
- /package/{src → dist}/html/index.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/logger/Logger.d.ts +0 -0
- /package/{src → dist}/logger/Logger.js +0 -0
- /package/{src → dist}/logger/index.d.ts +0 -0
- /package/{src → dist}/logger/index.js +0 -0
- /package/{src → dist}/report/CommandLine.d.ts +0 -0
- /package/{src → dist}/report/CommandLine.js +0 -0
- /package/{src → dist}/report/Json.d.ts +0 -0
- /package/{src → dist}/report/Json.js +0 -0
- /package/{src → dist}/report/Report.d.ts +0 -0
- /package/{src → dist}/report/Report.js +0 -0
- /package/{src → dist}/report/Symbols.d.ts +0 -0
- /package/{src → dist}/report/Symbols.js +0 -0
- /package/{src → dist}/report/index.d.ts +0 -0
- /package/{src → dist}/report/index.js +0 -0
- /package/{src → dist}/request/Request.js +0 -0
- /package/{src → dist}/request/index.d.ts +0 -0
- /package/{src → dist}/security/ContentEncoding.d.ts +0 -0
- /package/{src → dist}/security/ContentSecurityPolicy.d.ts +0 -0
- /package/{src → dist}/security/Cookies.d.ts +0 -0
- /package/{src → dist}/security/FingerPrint.d.ts +0 -0
- /package/{src → dist}/security/GoogleWebRisk.d.ts +0 -0
- /package/{src → dist}/security/HSTS.d.ts +0 -0
- /package/{src → dist}/security/HTTPS.d.ts +0 -0
- /package/{src → dist}/security/HTTPVersion.d.ts +0 -0
- /package/{src → dist}/security/PermissionsPolicy.d.ts +0 -0
- /package/{src → dist}/security/ReferrerPolicy.d.ts +0 -0
- /package/{src → dist}/security/RobotsTXT.d.ts +0 -0
- /package/{src → dist}/security/SSL.d.ts +0 -0
- /package/{src → dist}/security/XFrameOptions.d.ts +0 -0
- /package/{src → dist}/security/XXSSProtection.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/ContentSecurityPolicy.test.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/FingerPrint.test.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/HSTS.test.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/HTTPS.test.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/XFrameOptions.test.d.ts +0 -0
- /package/{src → dist}/security/__TESTS__/XXSSProtection.test.d.ts +0 -0
- /package/{src → dist}/security/index.d.ts +0 -0
- /package/{src → dist}/seo/Heading.d.ts +0 -0
- /package/{src → dist}/seo/Robots.d.ts +0 -0
- /package/{src → dist}/seo/Sitemap.d.ts +0 -0
- /package/{src → dist}/seo/Title.d.ts +0 -0
- /package/{src → dist}/seo/index.d.ts +0 -0
- /package/{src → dist}/wordpress/DefaultFiles.d.ts +0 -0
- /package/{src → dist}/wordpress/Generator.d.ts +0 -0
- /package/{src → dist}/wordpress/index.d.ts +0 -0
package/src/seo/Heading.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
const functions_1 = require("../functions");
|
|
19
|
-
class Heading extends Test_1.default {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.name = 'Heading';
|
|
23
|
-
}
|
|
24
|
-
test(_a) {
|
|
25
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
26
|
-
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
27
|
-
const response = yield request_1.default.get(url);
|
|
28
|
-
const html = yield (0, functions_1.parseHtml)(response);
|
|
29
|
-
const heading = (0, functions_1.getHeading)(html);
|
|
30
|
-
const subTests = this.checkHeading(heading);
|
|
31
|
-
return {
|
|
32
|
-
status: this.getStatus(subTests.map(test => test.status)),
|
|
33
|
-
title: this.constructor.name,
|
|
34
|
-
description: '',
|
|
35
|
-
results: subTests,
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
checkHeading(title) {
|
|
40
|
-
const results = [];
|
|
41
|
-
if (typeof title === 'undefined') {
|
|
42
|
-
return [{
|
|
43
|
-
status: 'ERROR',
|
|
44
|
-
title: 'H1 tag',
|
|
45
|
-
description: 'HTML should contain H1 tag.',
|
|
46
|
-
}];
|
|
47
|
-
}
|
|
48
|
-
results.push({
|
|
49
|
-
status: typeof title !== undefined && title.length > 0 ? 'SUCCESS' : 'WARNING',
|
|
50
|
-
title: 'H1 tag',
|
|
51
|
-
});
|
|
52
|
-
results.push({
|
|
53
|
-
status: Array.isArray(title) ? 'ERROR' : 'SUCCESS',
|
|
54
|
-
title: 'Duplicate H1 tag',
|
|
55
|
-
description: `HTML should contain just one H1 tag.`,
|
|
56
|
-
});
|
|
57
|
-
results.push({
|
|
58
|
-
status: title.length <= 60 ? 'SUCCESS' : 'WARNING',
|
|
59
|
-
title: 'H1 length',
|
|
60
|
-
description: `H1 length should be under 60 characters and it is ${title.length}.`,
|
|
61
|
-
});
|
|
62
|
-
return results;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.default = Heading;
|
package/src/seo/Robots.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
class Robots extends Test_1.default {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.name = 'Robots';
|
|
22
|
-
}
|
|
23
|
-
test(_a) {
|
|
24
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
25
|
-
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
26
|
-
const response = yield request_1.default.get(`${url}/robots.txt`);
|
|
27
|
-
return {
|
|
28
|
-
status: Math.floor(response.statusCode / 100) === 2 ? 'SUCCESS' : 'WARNING',
|
|
29
|
-
title: 'Robots.txt',
|
|
30
|
-
description: '',
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.default = Robots;
|
package/src/seo/Sitemap.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
const functions_1 = require("../functions");
|
|
19
|
-
class Sitemap extends Test_1.default {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.name = 'Sitemap';
|
|
23
|
-
}
|
|
24
|
-
test(_a) {
|
|
25
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
26
|
-
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
27
|
-
const robotsResponse = yield request_1.default.get(`${url}/robots.txt`);
|
|
28
|
-
let sitemapUrl = `${url}/sitemap.xml`;
|
|
29
|
-
if (Math.floor(robotsResponse.statusCode / 100) === 2) {
|
|
30
|
-
const lines = robotsResponse.body.split(/\r?\n/);
|
|
31
|
-
const sitemap = lines.find(line => line.startsWith('Sitemap'));
|
|
32
|
-
if (typeof sitemap !== 'undefined') {
|
|
33
|
-
sitemapUrl = sitemap.split(' ')[1];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
const response = yield request_1.default.get(sitemapUrl);
|
|
37
|
-
const xml = yield (0, functions_1.parseXml)(response);
|
|
38
|
-
return {
|
|
39
|
-
status: 'sitemapindex' in xml || 'urlset' in xml ? 'SUCCESS' : 'WARNING',
|
|
40
|
-
title: this.constructor.name,
|
|
41
|
-
description: '',
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.default = Sitemap;
|
package/src/seo/Title.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
const functions_1 = require("../functions");
|
|
19
|
-
class Title extends Test_1.default {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.name = 'Title';
|
|
23
|
-
}
|
|
24
|
-
test(_a) {
|
|
25
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
26
|
-
logger_1.default.info(`Starting ${this.constructor.name} test...`);
|
|
27
|
-
const response = yield request_1.default.get(url);
|
|
28
|
-
const html = yield (0, functions_1.parseHtml)(response);
|
|
29
|
-
const title = (0, functions_1.getTitle)(html);
|
|
30
|
-
const subTests = this.checkTitle(title);
|
|
31
|
-
return {
|
|
32
|
-
status: this.getStatus(subTests.map(test => test.status)),
|
|
33
|
-
title: this.constructor.name,
|
|
34
|
-
description: '',
|
|
35
|
-
results: subTests,
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
checkTitle(title) {
|
|
40
|
-
const results = [];
|
|
41
|
-
results.push({
|
|
42
|
-
status: typeof title !== undefined && title.length > 0 ? 'SUCCESS' : 'WARNING',
|
|
43
|
-
title: 'Title tag',
|
|
44
|
-
});
|
|
45
|
-
results.push({
|
|
46
|
-
status: Array.isArray(title) ? 'ERROR' : 'SUCCESS',
|
|
47
|
-
title: 'Duplicate title tag',
|
|
48
|
-
description: `HTML should contain just one title tag.`,
|
|
49
|
-
});
|
|
50
|
-
results.push({
|
|
51
|
-
status: title.length <= 60 ? 'SUCCESS' : 'WARNING',
|
|
52
|
-
title: 'Title length',
|
|
53
|
-
description: `Title length should be under 60 characters and it is ${title.length}.`,
|
|
54
|
-
});
|
|
55
|
-
return results;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = Title;
|
package/src/seo/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const Title_1 = __importDefault(require("./Title"));
|
|
17
|
-
const Heading_1 = __importDefault(require("./Heading"));
|
|
18
|
-
const Sitemap_1 = __importDefault(require("./Sitemap"));
|
|
19
|
-
const Robots_1 = __importDefault(require("./Robots"));
|
|
20
|
-
class SEO extends Test_1.default {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.name = 'SEO';
|
|
24
|
-
this.tests = [
|
|
25
|
-
new Title_1.default(),
|
|
26
|
-
new Heading_1.default(),
|
|
27
|
-
new Sitemap_1.default(),
|
|
28
|
-
new Robots_1.default(),
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
test(params) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const tests = this.getTests();
|
|
34
|
-
const results = [];
|
|
35
|
-
for (const test of tests) {
|
|
36
|
-
let result = null;
|
|
37
|
-
try {
|
|
38
|
-
result = yield test.run(params);
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
result = {
|
|
42
|
-
status: 'ERROR',
|
|
43
|
-
title: test.name,
|
|
44
|
-
description: 'Test failed or cannot be run!',
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
results.push(result);
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
status: this.getStatus(results.map(result => result.status)),
|
|
51
|
-
title: this.name,
|
|
52
|
-
description: '',
|
|
53
|
-
results,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.default = SEO;
|
package/src/types/Sitemap.d.ts
DELETED
package/src/types/Sitemap.js
DELETED
|
File without changes
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
class DefaultFiles extends Test_1.default {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.name = 'Default files';
|
|
22
|
-
this.files = [
|
|
23
|
-
'readme.html',
|
|
24
|
-
'licence.txt',
|
|
25
|
-
'wp-config-sample.php',
|
|
26
|
-
'wp-admin/install.php',
|
|
27
|
-
'wp-admin/upgrade.php',
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
test(_a) {
|
|
31
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
32
|
-
logger_1.default.info('Starting default files test...');
|
|
33
|
-
let results = [];
|
|
34
|
-
results = yield this.checkFiles(url);
|
|
35
|
-
return {
|
|
36
|
-
status: this.getStatus(results.map(result => result.status)),
|
|
37
|
-
title: 'Default files',
|
|
38
|
-
description: '',
|
|
39
|
-
results: results,
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
checkFiles(url) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const results = [];
|
|
46
|
-
for (const file of this.files) {
|
|
47
|
-
const response = yield request_1.default.get(`${url.endsWith('/') ? url.substring(0, url.length - 1) : url}/${file}`);
|
|
48
|
-
if (Math.floor(response.statusCode / 100) === 2 || Math.floor(response.statusCode / 100) === 5) {
|
|
49
|
-
results.push({
|
|
50
|
-
status: 'WARNING',
|
|
51
|
-
title: file,
|
|
52
|
-
description: `The ${file} file is reachable on the server!`
|
|
53
|
-
});
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
results.push({
|
|
57
|
-
status: 'SUCCESS',
|
|
58
|
-
title: file,
|
|
59
|
-
description: `The ${file} file is not reachable on the server.`,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return results;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.default = DefaultFiles;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const request_1 = __importDefault(require("../request"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
const functions_1 = require("../functions");
|
|
19
|
-
class Generator extends Test_1.default {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.name = 'Generator';
|
|
23
|
-
}
|
|
24
|
-
test(_a) {
|
|
25
|
-
return __awaiter(this, arguments, void 0, function* ({ url }) {
|
|
26
|
-
logger_1.default.info('Starting default files test...');
|
|
27
|
-
const results = [];
|
|
28
|
-
results.push(yield this.checkHTML(url));
|
|
29
|
-
results.push(yield this.checkRSSFeed(url));
|
|
30
|
-
return {
|
|
31
|
-
status: this.getStatus(results.map(result => result.status)),
|
|
32
|
-
title: this.name,
|
|
33
|
-
description: '',
|
|
34
|
-
results: results,
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
checkHTML(url) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const response = yield request_1.default.get(url);
|
|
41
|
-
const html = yield (0, functions_1.parseHtml)(response);
|
|
42
|
-
const generators = yield (0, functions_1.getGenerator)(html);
|
|
43
|
-
if (generators.some((generator) => generator.attribs.content.toLowerCase().includes('wordpress'))) {
|
|
44
|
-
return {
|
|
45
|
-
status: 'WARNING',
|
|
46
|
-
title: 'HTML Tag',
|
|
47
|
-
description: 'Page contains inmformation about its generator!',
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
status: 'SUCCESS',
|
|
52
|
-
title: 'HTML Tag',
|
|
53
|
-
description: 'Page doesn\t contain any information about its generator.',
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
checkRSSFeed(url) {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
const response = yield request_1.default.get(`${url.endsWith('/') ? url.substring(0, url.length - 1) : url}/feed/`);
|
|
60
|
-
if (response.response.headers.get('content-type').startsWith('application/rss+xml') && response.body.includes('<generator>https://wordpress.org')) {
|
|
61
|
-
return {
|
|
62
|
-
status: 'WARNING',
|
|
63
|
-
title: 'RSS Feed',
|
|
64
|
-
description: 'RSS feed contains information about its generator!',
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
status: 'SUCCESS',
|
|
69
|
-
title: 'RSS Feed',
|
|
70
|
-
description: 'RSS feed doesn\t contain any information about its generator.',
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.default = Generator;
|
package/src/wordpress/index.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Test_1 = __importDefault(require("../Test"));
|
|
16
|
-
const DefaultFiles_1 = __importDefault(require("./DefaultFiles"));
|
|
17
|
-
const Generator_1 = __importDefault(require("./Generator"));
|
|
18
|
-
class WordPress extends Test_1.default {
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this.name = 'WordPress';
|
|
22
|
-
this.tests = [
|
|
23
|
-
new DefaultFiles_1.default(),
|
|
24
|
-
new Generator_1.default(),
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
|
-
test(params) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const tests = this.getTests();
|
|
30
|
-
const results = [];
|
|
31
|
-
for (const test of tests) {
|
|
32
|
-
let result = null;
|
|
33
|
-
try {
|
|
34
|
-
result = yield test.run(params);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
result = {
|
|
38
|
-
status: 'ERROR',
|
|
39
|
-
title: test.name,
|
|
40
|
-
description: 'Test failed or cannot be run!',
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
results.push(result);
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
status: this.getStatus(results.map(result => result.status)),
|
|
47
|
-
title: this.name,
|
|
48
|
-
description: '',
|
|
49
|
-
results,
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.default = WordPress;
|
|
File without changes
|
|
File without changes
|
/package/{src → dist}/config.js
RENAMED
|
File without changes
|
/package/{src → dist}/dns/A.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src → dist}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|