pentest-tool-lite 3.10.6 → 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.
Files changed (205) hide show
  1. package/dist/Pentest.js +46 -0
  2. package/dist/{src/Test.js → Test.js} +11 -24
  3. package/dist/commands/Sitemap.js +79 -0
  4. package/dist/dns/A.js +49 -0
  5. package/dist/dns/DMARC.js +59 -0
  6. package/dist/dns/NS.js +36 -0
  7. package/dist/dns/RegistrationDate.js +39 -0
  8. package/dist/dns/index.js +47 -0
  9. package/dist/functions/parseSitemap.js +12 -0
  10. package/dist/html/Anchor.js +56 -0
  11. package/dist/html/CSS.js +92 -0
  12. package/dist/html/DuplicateId.js +35 -0
  13. package/dist/html/Generator.js +31 -0
  14. package/dist/html/Image.js +79 -0
  15. package/dist/html/JavaScript.js +107 -0
  16. package/dist/{src/html → html}/__TESTS__/Generator.test.js +10 -19
  17. package/dist/html/index.js +51 -0
  18. package/dist/{src/index → index} +21 -20
  19. package/dist/{src/logger → logger}/Console.js +1 -3
  20. package/dist/metadata/HTML.js +26 -0
  21. package/dist/metadata/Markdown.js +28 -0
  22. package/dist/metadata/ResponseTime.js +25 -0
  23. package/dist/metadata/index.js +45 -0
  24. package/dist/request/NodeFetch.js +58 -0
  25. package/dist/{src/request → request}/cache/UnlimitedCache.js +2 -0
  26. package/dist/security/ContentEncoding.js +44 -0
  27. package/dist/security/ContentSecurityPolicy.js +32 -0
  28. package/dist/security/Cookies.js +44 -0
  29. package/dist/security/FingerPrint.js +37 -0
  30. package/dist/security/GoogleWebRisk.js +44 -0
  31. package/dist/security/HSTS.js +48 -0
  32. package/dist/security/HTTPS.js +78 -0
  33. package/dist/security/HTTPVersion.js +50 -0
  34. package/dist/security/PermissionsPolicy.js +53 -0
  35. package/dist/security/Redirect.js +37 -0
  36. package/dist/security/ReferrerPolicy.js +32 -0
  37. package/dist/security/RobotsTXT.js +28 -0
  38. package/dist/security/SSL.js +36 -0
  39. package/dist/security/XFrameOptions.js +32 -0
  40. package/dist/security/XXSSProtection.js +32 -0
  41. package/dist/{src/security → security}/__TESTS__/ContentSecurityPolicy.test.js +10 -19
  42. package/dist/{src/security → security}/__TESTS__/FingerPrint.test.js +10 -19
  43. package/dist/{src/security → security}/__TESTS__/HSTS.test.js +15 -24
  44. package/dist/{src/security → security}/__TESTS__/HTTPS.test.js +15 -24
  45. package/dist/{src/security → security}/__TESTS__/XFrameOptions.test.js +10 -19
  46. package/dist/{src/security → security}/__TESTS__/XXSSProtection.test.js +10 -19
  47. package/dist/{src/security → security}/index.js +20 -31
  48. package/dist/seo/Heading.js +51 -0
  49. package/dist/seo/Robots.js +21 -0
  50. package/dist/seo/Sitemap.js +32 -0
  51. package/dist/seo/Title.js +44 -0
  52. package/dist/seo/index.js +47 -0
  53. package/dist/wordpress/DefaultFiles.js +50 -0
  54. package/dist/wordpress/Generator.js +58 -0
  55. package/dist/wordpress/index.js +43 -0
  56. package/package.json +10 -2
  57. package/dist/package.json +0 -61
  58. package/dist/src/Pentest.js +0 -57
  59. package/dist/src/commands/Sitemap.js +0 -96
  60. package/dist/src/dns/A.js +0 -65
  61. package/dist/src/dns/DMARC.js +0 -73
  62. package/dist/src/dns/NS.js +0 -52
  63. package/dist/src/dns/RegistrationDate.js +0 -55
  64. package/dist/src/dns/index.js +0 -58
  65. package/dist/src/functions/parseSitemap.js +0 -23
  66. package/dist/src/html/Anchor.js +0 -72
  67. package/dist/src/html/CSS.js +0 -108
  68. package/dist/src/html/DuplicateId.js +0 -49
  69. package/dist/src/html/Generator.js +0 -45
  70. package/dist/src/html/Image.js +0 -95
  71. package/dist/src/html/JavaScript.js +0 -123
  72. package/dist/src/html/index.js +0 -62
  73. package/dist/src/metadata/HTML.js +0 -40
  74. package/dist/src/metadata/Markdown.js +0 -42
  75. package/dist/src/metadata/ResponseTime.js +0 -39
  76. package/dist/src/metadata/index.js +0 -56
  77. package/dist/src/request/NodeFetch.js +0 -68
  78. package/dist/src/security/ContentEncoding.js +0 -58
  79. package/dist/src/security/ContentSecurityPolicy.js +0 -46
  80. package/dist/src/security/Cookies.js +0 -58
  81. package/dist/src/security/FingerPrint.js +0 -51
  82. package/dist/src/security/GoogleWebRisk.js +0 -58
  83. package/dist/src/security/HSTS.js +0 -62
  84. package/dist/src/security/HTTPS.js +0 -92
  85. package/dist/src/security/HTTPVersion.js +0 -64
  86. package/dist/src/security/PermissionsPolicy.js +0 -67
  87. package/dist/src/security/Redirect.js +0 -51
  88. package/dist/src/security/ReferrerPolicy.js +0 -46
  89. package/dist/src/security/RobotsTXT.js +0 -42
  90. package/dist/src/security/SSL.js +0 -50
  91. package/dist/src/security/XFrameOptions.js +0 -46
  92. package/dist/src/security/XXSSProtection.js +0 -46
  93. package/dist/src/seo/Heading.js +0 -65
  94. package/dist/src/seo/Robots.js +0 -35
  95. package/dist/src/seo/Sitemap.js +0 -46
  96. package/dist/src/seo/Title.js +0 -58
  97. package/dist/src/seo/index.js +0 -58
  98. package/dist/src/wordpress/DefaultFiles.js +0 -66
  99. package/dist/src/wordpress/Generator.js +0 -76
  100. package/dist/src/wordpress/index.js +0 -54
  101. /package/dist/{src/Pentest.d.ts → Pentest.d.ts} +0 -0
  102. /package/dist/{src/Test.d.ts → Test.d.ts} +0 -0
  103. /package/dist/{src/commands → commands}/Sitemap.d.ts +0 -0
  104. /package/dist/{src/config.d.ts → config.d.ts} +0 -0
  105. /package/dist/{src/config.js → config.js} +0 -0
  106. /package/dist/{src/dns → dns}/A.d.ts +0 -0
  107. /package/dist/{src/dns → dns}/DMARC.d.ts +0 -0
  108. /package/dist/{src/dns → dns}/NS.d.ts +0 -0
  109. /package/dist/{src/dns → dns}/RegistrationDate.d.ts +0 -0
  110. /package/dist/{src/dns → dns}/index.d.ts +0 -0
  111. /package/dist/{src/functions → functions}/findEvery.d.ts +0 -0
  112. /package/dist/{src/functions → functions}/findEvery.js +0 -0
  113. /package/dist/{src/functions → functions}/getAnchors.d.ts +0 -0
  114. /package/dist/{src/functions → functions}/getAnchors.js +0 -0
  115. /package/dist/{src/functions → functions}/getDomain.d.ts +0 -0
  116. /package/dist/{src/functions → functions}/getDomain.js +0 -0
  117. /package/dist/{src/functions → functions}/getDuplicates.d.ts +0 -0
  118. /package/dist/{src/functions → functions}/getDuplicates.js +0 -0
  119. /package/dist/{src/functions → functions}/getGenerator.d.ts +0 -0
  120. /package/dist/{src/functions → functions}/getGenerator.js +0 -0
  121. /package/dist/{src/functions → functions}/getHeading.d.ts +0 -0
  122. /package/dist/{src/functions → functions}/getHeading.js +0 -0
  123. /package/dist/{src/functions → functions}/getImages.d.ts +0 -0
  124. /package/dist/{src/functions → functions}/getImages.js +0 -0
  125. /package/dist/{src/functions → functions}/getObject.d.ts +0 -0
  126. /package/dist/{src/functions → functions}/getObject.js +0 -0
  127. /package/dist/{src/functions → functions}/getScripts.d.ts +0 -0
  128. /package/dist/{src/functions → functions}/getScripts.js +0 -0
  129. /package/dist/{src/functions → functions}/getStylesheets.d.ts +0 -0
  130. /package/dist/{src/functions → functions}/getStylesheets.js +0 -0
  131. /package/dist/{src/functions → functions}/getTitle.d.ts +0 -0
  132. /package/dist/{src/functions → functions}/getTitle.js +0 -0
  133. /package/dist/{src/functions → functions}/index.d.ts +0 -0
  134. /package/dist/{src/functions → functions}/index.js +0 -0
  135. /package/dist/{src/functions → functions}/parseHtml.d.ts +0 -0
  136. /package/dist/{src/functions → functions}/parseHtml.js +0 -0
  137. /package/dist/{src/functions → functions}/parseSitemap.d.ts +0 -0
  138. /package/dist/{src/functions → functions}/parseXml.d.ts +0 -0
  139. /package/dist/{src/functions → functions}/parseXml.js +0 -0
  140. /package/dist/{src/html → html}/Anchor.d.ts +0 -0
  141. /package/dist/{src/html → html}/CSS.d.ts +0 -0
  142. /package/dist/{src/html → html}/DuplicateId.d.ts +0 -0
  143. /package/dist/{src/html → html}/Generator.d.ts +0 -0
  144. /package/dist/{src/html → html}/Image.d.ts +0 -0
  145. /package/dist/{src/html → html}/JavaScript.d.ts +0 -0
  146. /package/dist/{src/html → html}/__TESTS__/Generator.test.d.ts +0 -0
  147. /package/dist/{src/html → html}/index.d.ts +0 -0
  148. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  149. /package/dist/{src/logger → logger}/Console.d.ts +0 -0
  150. /package/dist/{src/logger → logger}/Logger.d.ts +0 -0
  151. /package/dist/{src/logger → logger}/Logger.js +0 -0
  152. /package/dist/{src/logger → logger}/index.d.ts +0 -0
  153. /package/dist/{src/logger → logger}/index.js +0 -0
  154. /package/dist/{src/metadata → metadata}/HTML.d.ts +0 -0
  155. /package/dist/{src/metadata → metadata}/Markdown.d.ts +0 -0
  156. /package/dist/{src/metadata → metadata}/ResponseTime.d.ts +0 -0
  157. /package/dist/{src/metadata → metadata}/index.d.ts +0 -0
  158. /package/dist/{src/report → report}/CommandLine.d.ts +0 -0
  159. /package/dist/{src/report → report}/CommandLine.js +0 -0
  160. /package/dist/{src/report → report}/Json.d.ts +0 -0
  161. /package/dist/{src/report → report}/Json.js +0 -0
  162. /package/dist/{src/report → report}/Report.d.ts +0 -0
  163. /package/dist/{src/report → report}/Report.js +0 -0
  164. /package/dist/{src/report → report}/Symbols.d.ts +0 -0
  165. /package/dist/{src/report → report}/Symbols.js +0 -0
  166. /package/dist/{src/report → report}/index.d.ts +0 -0
  167. /package/dist/{src/report → report}/index.js +0 -0
  168. /package/dist/{src/request → request}/NodeFetch.d.ts +0 -0
  169. /package/dist/{src/request → request}/Request.d.ts +0 -0
  170. /package/dist/{src/request → request}/Request.js +0 -0
  171. /package/dist/{src/request → request}/cache/BlackHoleCache.d.ts +0 -0
  172. /package/dist/{src/request → request}/cache/BlackHoleCache.js +0 -0
  173. /package/dist/{src/request → request}/cache/UnlimitedCache.d.ts +0 -0
  174. /package/dist/{src/request → request}/index.d.ts +0 -0
  175. /package/dist/{src/request → request}/index.js +0 -0
  176. /package/dist/{src/security → security}/ContentEncoding.d.ts +0 -0
  177. /package/dist/{src/security → security}/ContentSecurityPolicy.d.ts +0 -0
  178. /package/dist/{src/security → security}/Cookies.d.ts +0 -0
  179. /package/dist/{src/security → security}/FingerPrint.d.ts +0 -0
  180. /package/dist/{src/security → security}/GoogleWebRisk.d.ts +0 -0
  181. /package/dist/{src/security → security}/HSTS.d.ts +0 -0
  182. /package/dist/{src/security → security}/HTTPS.d.ts +0 -0
  183. /package/dist/{src/security → security}/HTTPVersion.d.ts +0 -0
  184. /package/dist/{src/security → security}/PermissionsPolicy.d.ts +0 -0
  185. /package/dist/{src/security → security}/Redirect.d.ts +0 -0
  186. /package/dist/{src/security → security}/ReferrerPolicy.d.ts +0 -0
  187. /package/dist/{src/security → security}/RobotsTXT.d.ts +0 -0
  188. /package/dist/{src/security → security}/SSL.d.ts +0 -0
  189. /package/dist/{src/security → security}/XFrameOptions.d.ts +0 -0
  190. /package/dist/{src/security → security}/XXSSProtection.d.ts +0 -0
  191. /package/dist/{src/security → security}/__TESTS__/ContentSecurityPolicy.test.d.ts +0 -0
  192. /package/dist/{src/security → security}/__TESTS__/FingerPrint.test.d.ts +0 -0
  193. /package/dist/{src/security → security}/__TESTS__/HSTS.test.d.ts +0 -0
  194. /package/dist/{src/security → security}/__TESTS__/HTTPS.test.d.ts +0 -0
  195. /package/dist/{src/security → security}/__TESTS__/XFrameOptions.test.d.ts +0 -0
  196. /package/dist/{src/security → security}/__TESTS__/XXSSProtection.test.d.ts +0 -0
  197. /package/dist/{src/security → security}/index.d.ts +0 -0
  198. /package/dist/{src/seo → seo}/Heading.d.ts +0 -0
  199. /package/dist/{src/seo → seo}/Robots.d.ts +0 -0
  200. /package/dist/{src/seo → seo}/Sitemap.d.ts +0 -0
  201. /package/dist/{src/seo → seo}/Title.d.ts +0 -0
  202. /package/dist/{src/seo → seo}/index.d.ts +0 -0
  203. /package/dist/{src/wordpress → wordpress}/DefaultFiles.d.ts +0 -0
  204. /package/dist/{src/wordpress → wordpress}/Generator.d.ts +0 -0
  205. /package/dist/{src/wordpress → wordpress}/index.d.ts +0 -0
@@ -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,76 +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 = (0, functions_1.getGenerator)(html);
43
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
44
- if (generators.some((generator) => generator.attribs.content.toLowerCase().includes('wordpress'))) {
45
- return {
46
- status: 'WARNING',
47
- title: 'HTML Tag',
48
- description: 'Page contains inmformation about its generator!',
49
- };
50
- }
51
- return {
52
- status: 'SUCCESS',
53
- title: 'HTML Tag',
54
- description: 'Page doesn\t contain any information about its generator.',
55
- };
56
- });
57
- }
58
- checkRSSFeed(url) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const response = yield request_1.default.get(`${url.endsWith('/') ? url.substring(0, url.length - 1) : url}/feed/`);
61
- if (response.response.headers.get('content-type').startsWith('application/rss+xml') && response.body.includes('<generator>https://wordpress.org')) {
62
- return {
63
- status: 'WARNING',
64
- title: 'RSS Feed',
65
- description: 'RSS feed contains information about its generator!',
66
- };
67
- }
68
- return {
69
- status: 'SUCCESS',
70
- title: 'RSS Feed',
71
- description: 'RSS feed doesn\t contain any information about its generator.',
72
- };
73
- });
74
- }
75
- }
76
- exports.default = Generator;
@@ -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 (_a) {
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
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
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