More details and documentation will come in the following days. But, in the meantime, feel free to ask any questions that you might have.
Cheers,
Hi Cosmin,
I’m currently working on a scenario in which a user enters the URL of his/her web app to be scanned. What I do is that I get the URL and try to crawl the whole web app based on that, using spider functionality in ZAP. Then I use active scanner to scan the web app, finally I get the alert results from ZAP in xml format and show that to the user. I’ve attached the code which does the above scenario.
BUT,
I tested the code with DVWA, and noticed something. Despite the fact that the spider can crowl the web app and finds URLs as much as it can, the scanner does not report any serious (high priority) vulnerability such as XSS or SQL injection. As we all know, the DVWA already has those vulnerabilities. So I think what is missing here is the login (authentication) part, that I don’t do it.
My Question is:
Is there any way that we can get the login information from the user and enter that into web app through java code?
Regards.
Then you can spider from the point of view of the user defined at 3, via Spider -> scanURLAsUser. Or you can set it as a 'ForcedUser' and any request sent to the DVWA will be sent from the perspective of that user. Logouts are detected automatically and ZAP logs in by itself.
Let me know if you bump into something.
I admit that the documentation is still a bit behind, but it's something I'm working on right now. Also, in a couple of days I'm hoping to finish a few 'tutorial' style videos presenting the new features and how should they be used.
Cosmin
Hi Cosmin,
I’m currently working on a scenario in which a user enters the URL of his/her web app to be scanned. What I do is that I get the URL and try to crawl the whole web app based on that, using spider functionality in ZAP. Then I use active scanner to scan the web app, finally I get the alert results from ZAP in xml format and show that to the user. I’ve attached the code which does the above scenario.
BUT,
--I tested the code with DVWA, and noticed something. Despite the fact that the spider can crowl the web app and finds URLs as much as it can, the scanner does not report any serious (high priority) vulnerability such as XSS or SQL injection. As we all know, the DVWA already has those vulnerabilities. So I think missing here is the login (authentication) part, that I don’t do it.
My Question is:
Is there any way that we can get the login information from the user and enter that into web app through java code?
Regards.
You received this message because you are subscribed to the Google Groups "OWASP ZAP Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zaproxy-devel...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I tried the method you proposed, trying to login using Selenium HtmlUnitDriver. I’ve attached my updated source code. But despite the fact that I had added the selenium jar files to the Build Path libraries in Eclipse (also attached a picture of my libraries), each and every time I try to run my code I get the following error, no matter what WebDriver I use (either FirefoxDriver, HtmlUnitDriver, etc) :
java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebWindowListener
at mostafa.DVWATest.login(DVWATest.java:168)
at mostafa.DVWATest.scanDVWA(DVWATest.java:190)
at mostafa.DVWATest.main(DVWATest.java:227)
Caused by: java.lang.ClassNotFoundException: com.gargoylesoftware.htmlunit.WebWindowListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Any idea what causes this error or how it could be solved?
Furthermore,
by ZAPPROXY do you mean http://localhost:8090 ? Did I set it right in my code?
Plus
how to ensure spider doesn't find the logout link?
Thanks in advance.
Hi Stephan,
I've added both HtmlUnit jar driver and selenium-server-standalone-2.35.0 in my
buildpath library (as you can see it in the attached file). But when the code
reaches this line
htmlUnitDriver.get("http://localhost/dvwa");
in the “login” method where I want to get the login page, I always receive this error:
17679 [main] ERROR org.zaproxy.zap.ZAP$UncaughtExceptionLogger - Exception in thread "main"
java.lang.NoSuchMethodError: org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V
at org.apache.http.impl.conn.PoolingClientConnectionManager.createConnectionOperator(PoolingClientConnectionManager.java:140)
at org.apache.http.impl.conn.PoolingClientConnectionManager.<init>(PoolingClientConnectionManager.java:114)
at org.apache.http.impl.conn.PoolingClientConnectionManager.<init>(PoolingClientConnectionManager.java:99)
at org.apache.http.impl.conn.PoolingClientConnectionManager.<init>(PoolingClientConnectionManager.java:85)
at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:557)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:518)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:155)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1486)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1403)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:305)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:374)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:366)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:355)
at mostafa.DVWATest.login(DVWATest.java:175)
at mostafa.DVWATest.scanDVWA(DVWATest.java:212)
at mostafa.DVWATest.main(DVWATest.java:249)
Do you have a clue for what might cause this error?
Thanks.