> <mailto:zaproxy-scripts+unsub...@googlegroups.com>.
lt=undefinedexecution=undefined_eventId=undefined
get: verified that it gets the right page.
lt=has valueexecution=has value_eventId=has value
post: is empty, nothing displayed here
j_spring_cas_security_check page also get's a parameter called ticket via POST, where would that get included?The request to the page looks like this:GET https://apps1.test.domain.ca/testapp/j_spring_cas_security_check?ticket=myawesomeuniquetoken-cas.test.domain.ca.cas1 HTTP/1.1User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: en-US,en;q=0.5Cookie: JSESSIONID=uniquejsessionidtokenConnection: keep-aliveHost: apps1.test.domain.caand the ResponseHTTP/1.1 302 FoundDate: Tue, 24 Nov 2015 16:43:31 GMTContent-Length: 0Cache-Control: max-age=0, no-cache, no-store, must-revalidatePragma: no-cacheExpires: Thu, 01 Jan 1970 00:00:00 GMTKeep-Alive: timeout=5, max=100Connection: Keep-AliveContent-Type: text/plain; charset=UTF-8
https://www.mywebsite.com/MyWebAppLet's say there is a JSP file
https://www.mywebsite.com/MyWebApp/protected/index.jspand I need to retrieve
https://www.mywebsite.com/MyWebApp How do I actually retrieve the application name "MyWebApp"? Is there a function part of HTTP Message or ZAP that i can use to decode the URI into it's various parts?
fyi: script works great, just making some fine tuning and trying to get rid of the hard coded values :D
https://groups.google.com/forum/#!msg/zaproxy-scripts/a7Tv8VE5C4Q/6tWCRPLyBgAJ
CAS has authenticated, but not redirecting to my app: https://webapp1.eg.com/login.action.Hi,We've been working a lot with ZAP here at Softplan and our first challenge was to be able to run an authenticated attack on applications that use CAS. This script is the solution we came up with.When working with CAS, a single POST request with the credentials is not enough to trigger the authentication. When we GET the login page, some input values used by CAS are generated (the login ticket and some Spring Web Flow related parameters), and they must be included in the POST request for the authentication to work. So the script basically sends a GET to the login page, parses its response looking for the values generated by CAS and sends a POST request with these values and the credentials.This is enough to trigger the authentication, but it's not enough to enable a successfull authenticated scan with ZAP. There is one more step needed because of redirects: CAS loves them and ZAP doesn't. More details on that can be found in the comments within the script.Reauthentication works and a good way to achieve this is with a Logged Out Regex as something like "\QLocation: http://your.domain/cas-server/\E.*". Unauthenticated responses will be 302 redirects to the CAS server, so this is the easiest way to identifiy that there was a redirection to the CAS server and thus the user is not logged in.Here's a step-by-step guide on how to use it:- Import the script in ZAP;- Include your target to a ZAP context;- Set the script-based authentication method for that context;- Fill the login URL with the CAS server login page (i.e. http://your.domain/cas-server/login);- Provide one protected page for each application that will be analyzed separated by comma (i.e. http://your.domain/your-app/protected/index.html);- Optionally define any extra post data that is needed to be sent to your application in the login POST request;- Optionally provide a logged in/out regex (i.e. \QLocation: http://your.domain/cas-server/\E. as the logged out regex);- Create an user providing his username and password;- Activate Forced User Mode or run the Spider/Active Scan as the user you just created.Any suggestions will be deeply appreciated, specially those related to the last step of the script.Here is the script, by the way:
Good
morning.
Sorry for the necroposting; but we are really stuck in
a Cas Auth, and we are unable to make the script run properly.
Our
application is divided in a very similar way like the other users.
The
application is using
a
SSO
authentication by
calling CAS.
After
providing ZAP
with
the
entry point url, it redirects to the CAS, authenticates
correctly
(CAS ticker obtained),
and redirect us again to the aplication’s
internal pages.
After the redirection takes place, the ZAP spider is not able to scan the internal pages from the URL stated at the script configuration, then creating a circular loop of re-authentication attempts which generated new sessions all the time.
This is the basic sketch of what we see:
· Sites
When
we make the login; the app redirects us to the SSO, and after the
authentication it redirects again to the protected pages of the app.
When we do a manual scan with zap it register the directory
flawlessly, but when we try to launch a crawler or a active scan with
the script it can't handle the authentication and doesn't reach to
the directory ubications it should, and seems like the script it's
stuck with the session management and it runs again and again
creating a lot of sessions.
At this point we have tried
different aproachs to the problem, changing various parameters in the
script authentication configuration. We tried:
- Different addresses for the protected pages;
- Setting of the parameters in encoded form (as suggested by another user in the forum) and in a plane text form,
- Using a regex pattern in a url form and different coded strings (^(?=.*[A-Za-z0-9]$)[A-Za-z][A-Za-z\d.-]{0,19}$).
After
testing all the aforementioned things
the
script looks like working
in
a way that it takes the session data and shows it in the command
sequence console of zap ( a script Post with the username, password,
lt, execution and eventId) and indicates that the CAS authentication
script has finished. But looks like the script runs over and
over
(in
an endless loop) creating
different sessions each time.
Besides, the crawler isn’t deploying the tree correctly, getting usually stuck in a session authentication loop.
At this point we have read a lot of threads in various forums about this problem, but seems like we are unable to hit the nail on the head.
Anyone has a suggestion of why could this been failing?
And another thing. ¿The script modified by ryerson is available somewhere?
Hi,We've been working a lot with ZAP here at Softplan and our first challenge was to be able to run an authenticated attack on applications that use CAS. This script is the solution we came up with.When working with CAS, a single POST request with
...