【发布时间】:2021-09-30 14:23:57
【问题描述】:
我是 ZAP 和 node.js 的新手
我的目标是扫描任何 web 应用程序中的漏洞并生成报告 (JSON)。
我尝试了下面的代码,它给了我错误
const ZapClient = require('zaproxy');
const zapOptions = {
apiKey: 'myAPIKEY'
proxy: 'http://localhost:8095',
};
const zaproxy = new ZapClient(zapOptions);
let target = 'http://localhost:3000/#/app/my-app'
let promiseObj = zaproxy.ascan.scan(target);
promiseObj
.then(resp => {
console.log(JSON.stringify(resp))
})
.catch(error =>{
console.log(error)
})
let promiseObj = zaproxy.core.alerts(target);
promiseObj
.then(resp => {
console.log(JSON.stringify(resp))
})
.catch(error =>{
console.log(error)
})
我面临的错误:
StatusCodeError: 404 - "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>
Error</title>\n</head>\n<body>\n<pre>
Cannot GET /JSON/ascan/action/scan/</pre>\n</body>\n</html>\n"
另外,我将非常感谢:
- 谁能分享任何与 node.js 相关的 Zap 示例
- 是否有必要在我运行上述示例时保持 ZAP 工具打开和运行。
【问题讨论】: