I'm new to zap, i want to test my web application for vulnerabilities, How can i create a node js program to scan my website and generate a JSON report of the response.
--
You received this message because you are subscribed to the Google Groups "OWASP ZAP User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zaproxy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zaproxy-users/ee8abc4c-574b-4262-bfed-05b9070e4595n%40googlegroups.com.
I can help you with that. Here are the steps on how to create a NodeJS program to scan your website and generate a JSON report of the response:
Here is an example of a NodeJS program that scans a website and generates a JSON report of the response:
const ZapClient = require('zaproxy'); const fs = require('fs'); const zapOptions = { apiKey: 'eahhr6h6kal92j21gkcnhkp80t', proxy: { host: '127.0.0.1', port: 8080, }, }; const zaproxy = new ZapClient(zapOptions); let params = { contextid: 1, userid: 1, url: 'https://www.example.com', maxchildren: 100, recurse: true, subtreeonly: false, }; let response = await zaproxy.spider.scanAsUser(params); const jsonResponse = JSON.stringify(response); fs.writeFile('report.json', jsonResponse);To run this program, you will need to have ZAP installed and running. You can then run the program by typing the following command into your terminal:
This will generate a JSON report of the scan results in the report.json file. You can then open this file in a text editor to view the results.
I hope this helps! Let me know if you have any other questions.
To view this discussion on the web visit https://groups.google.com/d/msgid/zaproxy-users/7cb85f42-fd15-4cd8-ff28-e73649b8fa5c%40gmail.com.