pentest-tool-lite 3.9.2 → 3.10.6

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 (174) hide show
  1. package/LICENSE +19 -0
  2. package/dist/package.json +61 -0
  3. package/{src → dist/src}/Pentest.d.ts +1 -0
  4. package/{src → dist/src}/Pentest.js +19 -5
  5. package/{src → dist/src}/Test.d.ts +1 -0
  6. package/{src → dist/src}/Test.js +5 -7
  7. package/{src → dist/src}/commands/Sitemap.d.ts +4 -4
  8. package/{src → dist/src}/commands/Sitemap.js +3 -1
  9. package/{src → dist/src}/dns/A.js +4 -3
  10. package/{src → dist/src}/dns/DMARC.js +2 -1
  11. package/{src → dist/src}/dns/NS.js +2 -2
  12. package/{src → dist/src}/dns/RegistrationDate.js +3 -3
  13. package/{src → dist/src}/dns/index.js +1 -1
  14. package/dist/src/functions/findEvery.d.ts +2 -0
  15. package/{src → dist/src}/functions/getDuplicates.js +1 -0
  16. package/dist/src/functions/getGenerator.d.ts +2 -0
  17. package/{src → dist/src}/functions/getGenerator.js +3 -0
  18. package/{src → dist/src}/functions/getHeading.js +4 -0
  19. package/{src → dist/src}/functions/getImages.js +1 -0
  20. package/dist/src/functions/getObject.d.ts +2 -0
  21. package/{src → dist/src}/functions/getScripts.js +1 -0
  22. package/{src → dist/src}/functions/getStylesheets.js +1 -0
  23. package/{src → dist/src}/functions/getTitle.js +1 -0
  24. package/{src → dist/src}/functions/parseHtml.js +4 -0
  25. package/{src → dist/src}/functions/parseSitemap.js +1 -0
  26. package/{src → dist/src}/functions/parseXml.js +1 -1
  27. package/{src → dist/src}/html/Anchor.js +2 -1
  28. package/{src → dist/src}/html/CSS.js +6 -2
  29. package/{src → dist/src}/html/Image.js +5 -2
  30. package/{src → dist/src}/html/JavaScript.js +6 -1
  31. package/{src → dist/src}/html/__TESTS__/Generator.test.js +2 -0
  32. package/{src → dist/src}/html/index.js +1 -1
  33. package/{src → dist/src}/index +18 -8
  34. package/dist/src/logger/Console.d.ts +14 -0
  35. package/{src → dist/src}/logger/Console.js +12 -12
  36. package/dist/src/metadata/HTML.d.ts +6 -0
  37. package/dist/src/metadata/HTML.js +40 -0
  38. package/dist/src/metadata/Markdown.d.ts +6 -0
  39. package/dist/src/metadata/Markdown.js +42 -0
  40. package/dist/src/metadata/ResponseTime.d.ts +6 -0
  41. package/dist/src/metadata/ResponseTime.js +39 -0
  42. package/dist/src/metadata/index.d.ts +6 -0
  43. package/dist/src/metadata/index.js +56 -0
  44. package/{src → dist/src}/request/NodeFetch.d.ts +2 -0
  45. package/{src → dist/src}/request/NodeFetch.js +26 -7
  46. package/{src → dist/src}/request/Request.d.ts +2 -0
  47. package/dist/src/request/cache/BlackHoleCache.d.ts +7 -0
  48. package/{src → dist/src}/request/cache/BlackHoleCache.js +4 -3
  49. package/{src → dist/src}/request/cache/UnlimitedCache.d.ts +1 -2
  50. package/{src → dist/src}/request/cache/UnlimitedCache.js +2 -0
  51. package/dist/src/request/index.js +11 -0
  52. package/{src → dist/src}/security/HTTPS.js +19 -0
  53. package/dist/src/security/Redirect.d.ts +6 -0
  54. package/dist/src/security/Redirect.js +51 -0
  55. package/{src → dist/src}/security/__TESTS__/ContentSecurityPolicy.test.js +2 -0
  56. package/{src → dist/src}/security/__TESTS__/FingerPrint.test.js +2 -0
  57. package/{src → dist/src}/security/__TESTS__/HSTS.test.js +3 -0
  58. package/{src → dist/src}/security/__TESTS__/HTTPS.test.js +3 -0
  59. package/{src → dist/src}/security/__TESTS__/XFrameOptions.test.js +2 -0
  60. package/{src → dist/src}/security/__TESTS__/XXSSProtection.test.js +2 -0
  61. package/{src → dist/src}/security/index.js +5 -7
  62. package/{src → dist/src}/seo/Heading.js +1 -1
  63. package/{src → dist/src}/seo/Title.js +1 -1
  64. package/{src → dist/src}/seo/index.js +1 -1
  65. package/{src → dist/src}/wordpress/Generator.js +2 -1
  66. package/{src → dist/src}/wordpress/index.js +1 -1
  67. package/package.json +60 -59
  68. package/src/functions/findEvery.d.ts +0 -2
  69. package/src/functions/getGenerator.d.ts +0 -2
  70. package/src/functions/getObject.d.ts +0 -2
  71. package/src/logger/Console.d.ts +0 -14
  72. package/src/request/cache/BlackHoleCache.d.ts +0 -8
  73. package/src/request/cache/Cache.d.ts +0 -6
  74. package/src/request/cache/Cache.js +0 -2
  75. package/src/request/index.js +0 -7
  76. package/src/types/Sitemap.d.ts +0 -9
  77. package/src/types/Sitemap.js +0 -0
  78. /package/{README.md → dist/README.md} +0 -0
  79. /package/{src → dist/src}/config.d.ts +0 -0
  80. /package/{src → dist/src}/config.js +0 -0
  81. /package/{src → dist/src}/dns/A.d.ts +0 -0
  82. /package/{src → dist/src}/dns/DMARC.d.ts +0 -0
  83. /package/{src → dist/src}/dns/NS.d.ts +0 -0
  84. /package/{src → dist/src}/dns/RegistrationDate.d.ts +0 -0
  85. /package/{src → dist/src}/dns/index.d.ts +0 -0
  86. /package/{src → dist/src}/functions/findEvery.js +0 -0
  87. /package/{src → dist/src}/functions/getAnchors.d.ts +0 -0
  88. /package/{src → dist/src}/functions/getAnchors.js +0 -0
  89. /package/{src → dist/src}/functions/getDomain.d.ts +0 -0
  90. /package/{src → dist/src}/functions/getDomain.js +0 -0
  91. /package/{src → dist/src}/functions/getDuplicates.d.ts +0 -0
  92. /package/{src → dist/src}/functions/getHeading.d.ts +0 -0
  93. /package/{src → dist/src}/functions/getImages.d.ts +0 -0
  94. /package/{src → dist/src}/functions/getObject.js +0 -0
  95. /package/{src → dist/src}/functions/getScripts.d.ts +0 -0
  96. /package/{src → dist/src}/functions/getStylesheets.d.ts +0 -0
  97. /package/{src → dist/src}/functions/getTitle.d.ts +0 -0
  98. /package/{src → dist/src}/functions/index.d.ts +0 -0
  99. /package/{src → dist/src}/functions/index.js +0 -0
  100. /package/{src → dist/src}/functions/parseHtml.d.ts +0 -0
  101. /package/{src → dist/src}/functions/parseSitemap.d.ts +0 -0
  102. /package/{src → dist/src}/functions/parseXml.d.ts +0 -0
  103. /package/{src → dist/src}/html/Anchor.d.ts +0 -0
  104. /package/{src → dist/src}/html/CSS.d.ts +0 -0
  105. /package/{src → dist/src}/html/DuplicateId.d.ts +0 -0
  106. /package/{src → dist/src}/html/DuplicateId.js +0 -0
  107. /package/{src → dist/src}/html/Generator.d.ts +0 -0
  108. /package/{src → dist/src}/html/Generator.js +0 -0
  109. /package/{src → dist/src}/html/Image.d.ts +0 -0
  110. /package/{src → dist/src}/html/JavaScript.d.ts +0 -0
  111. /package/{src → dist/src}/html/__TESTS__/Generator.test.d.ts +0 -0
  112. /package/{src → dist/src}/html/index.d.ts +0 -0
  113. /package/{src → dist/src}/index.d.ts +0 -0
  114. /package/{src → dist/src}/logger/Logger.d.ts +0 -0
  115. /package/{src → dist/src}/logger/Logger.js +0 -0
  116. /package/{src → dist/src}/logger/index.d.ts +0 -0
  117. /package/{src → dist/src}/logger/index.js +0 -0
  118. /package/{src → dist/src}/report/CommandLine.d.ts +0 -0
  119. /package/{src → dist/src}/report/CommandLine.js +0 -0
  120. /package/{src → dist/src}/report/Json.d.ts +0 -0
  121. /package/{src → dist/src}/report/Json.js +0 -0
  122. /package/{src → dist/src}/report/Report.d.ts +0 -0
  123. /package/{src → dist/src}/report/Report.js +0 -0
  124. /package/{src → dist/src}/report/Symbols.d.ts +0 -0
  125. /package/{src → dist/src}/report/Symbols.js +0 -0
  126. /package/{src → dist/src}/report/index.d.ts +0 -0
  127. /package/{src → dist/src}/report/index.js +0 -0
  128. /package/{src → dist/src}/request/Request.js +0 -0
  129. /package/{src → dist/src}/request/index.d.ts +0 -0
  130. /package/{src → dist/src}/security/ContentEncoding.d.ts +0 -0
  131. /package/{src → dist/src}/security/ContentEncoding.js +0 -0
  132. /package/{src → dist/src}/security/ContentSecurityPolicy.d.ts +0 -0
  133. /package/{src → dist/src}/security/ContentSecurityPolicy.js +0 -0
  134. /package/{src → dist/src}/security/Cookies.d.ts +0 -0
  135. /package/{src → dist/src}/security/Cookies.js +0 -0
  136. /package/{src → dist/src}/security/FingerPrint.d.ts +0 -0
  137. /package/{src → dist/src}/security/FingerPrint.js +0 -0
  138. /package/{src → dist/src}/security/GoogleWebRisk.d.ts +0 -0
  139. /package/{src → dist/src}/security/GoogleWebRisk.js +0 -0
  140. /package/{src → dist/src}/security/HSTS.d.ts +0 -0
  141. /package/{src → dist/src}/security/HSTS.js +0 -0
  142. /package/{src → dist/src}/security/HTTPS.d.ts +0 -0
  143. /package/{src → dist/src}/security/HTTPVersion.d.ts +0 -0
  144. /package/{src → dist/src}/security/HTTPVersion.js +0 -0
  145. /package/{src → dist/src}/security/PermissionsPolicy.d.ts +0 -0
  146. /package/{src → dist/src}/security/PermissionsPolicy.js +0 -0
  147. /package/{src → dist/src}/security/ReferrerPolicy.d.ts +0 -0
  148. /package/{src → dist/src}/security/ReferrerPolicy.js +0 -0
  149. /package/{src → dist/src}/security/RobotsTXT.d.ts +0 -0
  150. /package/{src → dist/src}/security/RobotsTXT.js +0 -0
  151. /package/{src → dist/src}/security/SSL.d.ts +0 -0
  152. /package/{src → dist/src}/security/SSL.js +0 -0
  153. /package/{src → dist/src}/security/XFrameOptions.d.ts +0 -0
  154. /package/{src → dist/src}/security/XFrameOptions.js +0 -0
  155. /package/{src → dist/src}/security/XXSSProtection.d.ts +0 -0
  156. /package/{src → dist/src}/security/XXSSProtection.js +0 -0
  157. /package/{src → dist/src}/security/__TESTS__/ContentSecurityPolicy.test.d.ts +0 -0
  158. /package/{src → dist/src}/security/__TESTS__/FingerPrint.test.d.ts +0 -0
  159. /package/{src → dist/src}/security/__TESTS__/HSTS.test.d.ts +0 -0
  160. /package/{src → dist/src}/security/__TESTS__/HTTPS.test.d.ts +0 -0
  161. /package/{src → dist/src}/security/__TESTS__/XFrameOptions.test.d.ts +0 -0
  162. /package/{src → dist/src}/security/__TESTS__/XXSSProtection.test.d.ts +0 -0
  163. /package/{src → dist/src}/security/index.d.ts +0 -0
  164. /package/{src → dist/src}/seo/Heading.d.ts +0 -0
  165. /package/{src → dist/src}/seo/Robots.d.ts +0 -0
  166. /package/{src → dist/src}/seo/Robots.js +0 -0
  167. /package/{src → dist/src}/seo/Sitemap.d.ts +0 -0
  168. /package/{src → dist/src}/seo/Sitemap.js +0 -0
  169. /package/{src → dist/src}/seo/Title.d.ts +0 -0
  170. /package/{src → dist/src}/seo/index.d.ts +0 -0
  171. /package/{src → dist/src}/wordpress/DefaultFiles.d.ts +0 -0
  172. /package/{src → dist/src}/wordpress/DefaultFiles.js +0 -0
  173. /package/{src → dist/src}/wordpress/Generator.d.ts +0 -0
  174. /package/{src → dist/src}/wordpress/index.d.ts +0 -0
@@ -27,6 +27,7 @@ const RobotsTXT_1 = __importDefault(require("./RobotsTXT"));
27
27
  const PermissionsPolicy_1 = __importDefault(require("./PermissionsPolicy"));
28
28
  const SSL_1 = __importDefault(require("./SSL"));
29
29
  const GoogleWebRisk_1 = __importDefault(require("./GoogleWebRisk"));
30
+ const Redirect_1 = __importDefault(require("./Redirect"));
30
31
  class Security extends Test_1.default {
31
32
  constructor() {
32
33
  super();
@@ -46,6 +47,7 @@ class Security extends Test_1.default {
46
47
  new RobotsTXT_1.default(),
47
48
  new SSL_1.default(),
48
49
  new GoogleWebRisk_1.default(),
50
+ new Redirect_1.default(),
49
51
  ];
50
52
  }
51
53
  test(params) {
@@ -53,17 +55,13 @@ class Security extends Test_1.default {
53
55
  const tests = this.getTests();
54
56
  const results = [];
55
57
  for (const test of tests) {
56
- let result = null;
57
- try {
58
- result = yield test.run(params);
59
- }
60
- catch (error) {
61
- result = {
58
+ const result = yield test.run(params).catch(() => {
59
+ return {
62
60
  status: 'ERROR',
63
61
  title: test.name,
64
62
  description: 'Test failed or cannot be run!',
65
63
  };
66
- }
64
+ });
67
65
  results.push(result);
68
66
  }
69
67
  return {
@@ -46,7 +46,7 @@ class Heading extends Test_1.default {
46
46
  }];
47
47
  }
48
48
  results.push({
49
- status: typeof title !== undefined && title.length > 0 ? 'SUCCESS' : 'WARNING',
49
+ status: typeof title !== 'undefined' && title.length > 0 ? 'SUCCESS' : 'WARNING',
50
50
  title: 'H1 tag',
51
51
  });
52
52
  results.push({
@@ -39,7 +39,7 @@ class Title extends Test_1.default {
39
39
  checkTitle(title) {
40
40
  const results = [];
41
41
  results.push({
42
- status: typeof title !== undefined && title.length > 0 ? 'SUCCESS' : 'WARNING',
42
+ status: typeof title !== 'undefined' && title.length > 0 ? 'SUCCESS' : 'WARNING',
43
43
  title: 'Title tag',
44
44
  });
45
45
  results.push({
@@ -37,7 +37,7 @@ class SEO extends Test_1.default {
37
37
  try {
38
38
  result = yield test.run(params);
39
39
  }
40
- catch (error) {
40
+ catch (_a) {
41
41
  result = {
42
42
  status: 'ERROR',
43
43
  title: test.name,
@@ -39,7 +39,8 @@ class Generator extends Test_1.default {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
40
  const response = yield request_1.default.get(url);
41
41
  const html = yield (0, functions_1.parseHtml)(response);
42
- const generators = yield (0, functions_1.getGenerator)(html);
42
+ const generators = (0, functions_1.getGenerator)(html);
43
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
43
44
  if (generators.some((generator) => generator.attribs.content.toLowerCase().includes('wordpress'))) {
44
45
  return {
45
46
  status: 'WARNING',
@@ -33,7 +33,7 @@ class WordPress extends Test_1.default {
33
33
  try {
34
34
  result = yield test.run(params);
35
35
  }
36
- catch (error) {
36
+ catch (_a) {
37
37
  result = {
38
38
  status: 'ERROR',
39
39
  title: test.name,
package/package.json CHANGED
@@ -1,60 +1,61 @@
1
1
  {
2
- "name": "pentest-tool-lite",
3
- "description": "Check your website ( or any other website ) for common vulnerabilities.",
4
- "version": "3.9.2",
5
- "homepage": "https://pentest-tool-lite.com",
6
- "license": "MIT",
7
- "author": {
8
- "name": "Matej Jellus",
9
- "email": "juffalow@juffalow.com",
10
- "url": "https://juffalow.com"
11
- },
12
- "bin": {
13
- "pentest-tool-lite": "./src/index"
14
- },
15
- "dependencies": {
16
- "@google-cloud/web-risk": "^4.0.1",
17
- "commander": "^6.0.0",
18
- "csso": "^5.0.5",
19
- "domhandler": "^4.2.2",
20
- "htmlparser2": "^7.1.2",
21
- "node-fetch": "^2.6.0",
22
- "ssl-checker": "^2.0.7",
23
- "uglify-js": "^3.6.1",
24
- "whois": "^2.14.2",
25
- "xml2js": "^0.6.2"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/juffalow/pentest-tool-lite.git"
30
- },
31
- "bugs": {
32
- "url": "https://github.com/juffalow/pentest-tool-lite/issues"
33
- },
34
- "scripts": {
35
- "start": "tsc && node dist/src/index.js",
36
- "build": "tsc",
37
- "lint": "eslint . --ext .ts",
38
- "test": "jest"
39
- },
40
- "devDependencies": {
41
- "@types/jest": "^29.4.0",
42
- "@types/node": "^20.12.2",
43
- "@types/node-fetch": "^2.5.7",
44
- "@types/uglify-js": "^3.0.4",
45
- "@types/xml2js": "^0.4.5",
46
- "@typescript-eslint/eslint-plugin": "^5.1.0",
47
- "@typescript-eslint/parser": "^5.1.0",
48
- "eslint": "^8.0.1",
49
- "jest": "^29.4.3",
50
- "ts-jest": "^29.0.5",
51
- "typescript": "^5.2.2"
52
- },
53
- "keywords": [
54
- "pentest-tool",
55
- "pentesting",
56
- "penetration-test",
57
- "analyzer",
58
- "analyser"
59
- ]
60
- }
2
+ "name": "pentest-tool-lite",
3
+ "description": "Check your website ( or any other website ) for common vulnerabilities.",
4
+ "version": "3.10.6",
5
+ "homepage": "https://pentest-tool-lite.com",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Matej Jellus",
9
+ "email": "juffalow@juffalow.com",
10
+ "url": "https://juffalow.com"
11
+ },
12
+ "bin": "./src/index",
13
+ "dependencies": {
14
+ "@google-cloud/web-risk": "^4.0.1",
15
+ "commander": "^6.0.0",
16
+ "csso": "^5.0.5",
17
+ "domhandler": "^4.2.2",
18
+ "htmlparser2": "^7.1.2",
19
+ "node-html-markdown": "^2.0.0",
20
+ "ssl-checker": "^2.0.7",
21
+ "uglify-js": "^3.6.1",
22
+ "whois": "^2.14.2",
23
+ "xml2js": "^0.6.2"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/juffalow/pentest-tool-lite.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/juffalow/pentest-tool-lite/issues"
31
+ },
32
+ "scripts": {
33
+ "start": "tsc && node dist/src/index.js",
34
+ "start-build": "tsc -w --preserveWatchOutput",
35
+ "start-test": "node dist/src/index.js",
36
+ "build": "tsc",
37
+ "lint": "eslint",
38
+ "test": "jest"
39
+ },
40
+ "devDependencies": {
41
+ "@eslint/js": "^9.17.0",
42
+ "@types/jest": "^29.4.0",
43
+ "@types/node": "^22.5.0",
44
+ "@types/uglify-js": "^3.0.4",
45
+ "@types/xml2js": "^0.4.5",
46
+ "eslint": "^9.17.0",
47
+ "globals": "^15.14.0",
48
+ "jest": "^29.4.3",
49
+ "ts-jest": "^29.0.5",
50
+ "typescript": "^5.2.2",
51
+ "typescript-eslint": "^8.18.1"
52
+ },
53
+ "keywords": [
54
+ "pentest-tool",
55
+ "pentesting",
56
+ "penetration-test",
57
+ "analyzer",
58
+ "analyser"
59
+ ],
60
+ "packageManager": "yarn@4.12.0"
61
+ }
@@ -1,2 +0,0 @@
1
- declare const find: (object: any, test: (object: unknown) => boolean) => any;
2
- export default find;
@@ -1,2 +0,0 @@
1
- declare const getGenerator: (result: any) => string[];
2
- export default getGenerator;
@@ -1,2 +0,0 @@
1
- declare const getObject: (theObject: any | [], key: string, value: string) => any[];
2
- export default getObject;
@@ -1,14 +0,0 @@
1
- import Logger from './Logger';
2
- export default class Console implements Logger {
3
- protected levels: string[];
4
- debug(message: string): void;
5
- verbose(message: string): void;
6
- info(message: string): void;
7
- warning(message: string): void;
8
- error(message: string): void;
9
- /**
10
- * What a terrible failure
11
- * @param message
12
- */
13
- wtf(message: string): void;
14
- }
@@ -1,8 +0,0 @@
1
- import Cache from './Cache';
2
- declare class BlackHoleCache implements Cache {
3
- add(url: string, response: any): void;
4
- has(url: string): boolean;
5
- get(url: string): any;
6
- clear(): void;
7
- }
8
- export default BlackHoleCache;
@@ -1,6 +0,0 @@
1
- export default interface Cache {
2
- add(url: string, response: any): void;
3
- has(url: string): boolean;
4
- get(url: string): any;
5
- clear(): void;
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const NodeFetch_1 = __importDefault(require("./NodeFetch"));
7
- exports.default = new NodeFetch_1.default();
@@ -1,9 +0,0 @@
1
- interface IUrl {
2
- loc: string[];
3
- }
4
- interface IURLSet {
5
- url: IUrl[];
6
- }
7
- interface ISitemap {
8
- urlset: IURLSet;
9
- }
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
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