juffalow / pentest-tool-lite

Test your page against basic security, html, wordpress, ... check lists
https://pentest-tool-lite.com/
MIT License
25 stars 10 forks source link

Fatal error on: href="skype:SDHDHOSTS?add" #52

Open SjamonDaal opened 4 years ago

SjamonDaal commented 4 years ago
Checking skype:SDHDHOSTS?add...
Requesting skype:SDHDHOSTS?add...
(node:12811) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'statusCode' of undefined
    at Anchor.isUrlAvailable (/usr/local/lib/node_modules/pentest-tool-lite/src/html/Anchor.js:45:29)
    at Anchor.<anonymous> (/usr/local/lib/node_modules/pentest-tool-lite/src/html/Anchor.js:37:38)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/pentest-tool-lite/src/html/Anchor.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:12811) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12811) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
juffalow commented 4 years ago

Thank you! Maybe it would be fine to test if the URL is valid before actually requesting it.

Kubik2000 commented 3 years ago

oh this is sad yeah when you open npm start https://juffalow.co it will fail I thing I have general fix running locally we can check if it is good enough

Kubik2000 commented 3 years ago

yeah after the update to v3 I have to redo it from scratch

Kubik2000 commented 3 years ago

this was my idea of the fix but some strage stuff happens when I run it the method is executed twice

`public async run(params: TestParameters): Promise<Result | Array> { let result = null; const response = await request.get(params.url); console.error("aaaaaaaaaa");

if(response.statusCode == undefined)
{
  return {
    status: 'ERROR',
    title: 'URL',
    description: 'The url was not found.',
  };
} else {
  try {
    result = await this.test(params);
  } catch (err) {
    console.error(err);
  }

  return result;
}

}}`

juffalow commented 3 years ago

In the version 3 of pentest-tool-lite if a single test will fail it just shows an error status of the test. So the script should not end with error anymore.

But this is not a fix of course. It should check if the provided url is valid url and after that make a request.