pentest-tool-lite 3.9.0 → 3.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pentest-tool-lite",
3
3
  "description": "Check your website ( or any other website ) for common vulnerabilities.",
4
- "version": "3.9.0",
4
+ "version": "3.9.2",
5
5
  "homepage": "https://pentest-tool-lite.com",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -22,7 +22,7 @@
22
22
  "ssl-checker": "^2.0.7",
23
23
  "uglify-js": "^3.6.1",
24
24
  "whois": "^2.14.2",
25
- "xml2js": "^0.4.22"
25
+ "xml2js": "^0.6.2"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
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,7 +25,7 @@ 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.${(new URL(url).hostname)}`, (err, records) => {
28
+ dns_1.default.resolveTxt(`_dmarc.${(0, getDomain_1.default)(url)}`, (err, records) => {
28
29
  if (err) {
29
30
  reject(err);
30
31
  }
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((new URL(url).hostname));
27
+ const nameServers = yield this.getNameServers((0, getDomain_1.default)(url));
27
28
  return {
28
29
  status: 'SUCCESS',
29
30
  title: this.constructor.name,
@@ -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((new URL(url).hostname));
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 {
@@ -0,0 +1,2 @@
1
+ declare const getDomain: (url: string) => string;
2
+ export default getDomain;
@@ -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;