ZAP Scanner

ZAP Scanner is capable of building site maps using ZAP Spider and performing both passive and active scans to look for various types of vulnerabilities.

Spider

Let's start with ZAP Spider, which is similar to the Crawler feature in Burp.

Note: When we click on the Spider button, ZAP may tell us that the current website is not in our scope, and will ask us to automatically add it to the scope before starting the scan, to which we can say 'Yes'. The Scope is the set of URLs ZAP will test if we start a generic scan, and it can be customized by us to scan multiple websites and URLs. Try to add multiple targets to the scope to see how the scan would run differently.

Note: In some versions of browsers, the ZAP's HUD might not work as intended.

Tip: ZAP also has a different type of Spider called Ajax Spider, which can be started from the third button on the right pane. The difference between this and the normal scanner is that Ajax Spider also tries to identify links requested through JavaScript AJAX requests, which may be running on the page even after it loads. Try running it after the normal Spider finishes its scan, as this may give a better output and add a few links the normal Spider may have missed, though it may take a little bit longer to finish.

Passive Scanner

Active Scanner

Reporting

Finally, we can generate a report with all of the findings identified by ZAP through its various scans.


Exercise

Target: 94.237.57.1:57364

Run ZAP Scanner on the target above to identify directories and potential vulnerabilities. Once you find the high-level vulnerability, try to use it to read the flag at '/flag.txt'

Scanning

First run a Spider after visiting the target domain (used HUD)

Pasted image 20251010165144.png|500

Next, start an Active Scan, this will definitely take some time, flags will start to populate while the active scan is running.

Once a red flag appears (high-level vulnerability) click on it to see its details on ZAP

Pasted image 20251015133931.png|500

After waiting a few more minutes for the scan to move forward a little bit (Reached about 80%) the following pops up:
Pasted image 20251015135543.png|500

Exploit (through ZAP)

Note that if we double-click on the red flag we see the following:
Pasted image 20251015135819.png|250

What if we can change this to instead of just sending an sleep command send some kind of instruction in order to get our flag?

Once we have sent that request, we will get the response:
Pasted image 20251015141806.png|425

flag: HTB