Hi Simon,
I'm testing a web application with OWASP ZAP. I need to sign in as the system user so that I can access the whole system, otherwise, I can only scan the login page, and the scan will be finished within 5 mins.
So, here is the problem, the web application has CAPTCHA on login page to mitigate attack, we can create a demo testing environment (without CAPTCHA) or remove the CAPTCHA for OWASP ZAP's scanning, but we can't do this now. So we prepare use apikey to login the web application directly.
My environment and operation process as below:
My OS is Windows 7 SP1, 64 bit, 8GB RAM, I have installed the VirtualBox on my computer and added two virtual machine as below:
Environment 1: Ubuntu 16.04 LTS, 3GB RAM, 30GB Storage, 2 Core; ZAP 2.6.0
Environment 2: Kali GNOME 3.26.2, 4GB RAM, 20GB Storage, 2 Core; ZAP 2.7.0
I have installed the OWASP ZAP on Ubuntu by myself, and the Kali has preinstalled the ZAP (it's amazing).
I have replaced some privacy parameters in the following procedures, hopefully you can get my point, and sorry for my bad English.0. The default browser Firefox has proxy by ZAP,
http://127.0.0.1:80801. Open the OWASP ZAP and terminal.
2. Create a new session.
3. Execute the command line in terminal
curl -x http://127.0.0.1:8080 -d "apikey=MyApiKey&userid=TheUserName&password=TheUserPassword" http://TheUrlOfMyApiLogin/4. Terminal returned the following info:
{"message":"Invalid%20Login","result":false} (sometimes, the result can be true, and returned with a Token:XXXXXXX, but the scan result is no difference :( so sad)5. Back to the ZAP, I can see the path (i.e.
http://TheUrlOfMyApiLogin) in
Sites tab. The end path is
POST:PartOfMyUrl(apikey,password,userid)6. Then I right click the top node of my url and
Included in New Context.
7. Right click the node of point 5, and
Flag as Context
8. Then I selected the userid and password as the login parameters.
9. I didn't Flag Any Code as Context Logged In/Out Indicator.
10. Open the Session Properties, and add a new user in User section, meanwhile, Enable this user.
11. Go to Forced User section, and selected the user I just added in User section. Save the configuration.
12. Right click the top node of my url, and select Attack > Active Scan.
13. Start the scan.
After overview the scan result and request history, I know this api login is failed.
Could you help me figure out the problem? Thanks in advance.
Best regards,
Bob