CySCA 2015 - Web Application Pentest 4 - Business Excellence
November 19, 2015 • nickw
We need to gain access to the CVO (Angelina’s) account. In order to do this, we
most likely will need to steal a cookie. We take a look in the leave details
section and put in a leave request to see if it’s XSS protected. Additionally,
we notice that the session cookie on this website is not HTTPOnly
. Time
to steal.
The browser will prevent javascript accessing HTTPOnly
cookies, hence, if it
was HTTP Only, we would be looking in the wrong place.
We do the naive thing and just put <h1>Hello</h1>
in. However, the ticker spits
out WARNING: XSS detected! You have been reported.
. Additionally, it appears
the XSS is stripped client side too.
Lets take this to a PostMan session rather than mucking around with request stripping.
We also fire up a little flask web-app to steal the user’s session.
We send off the following request:
(Replacing x.x.x.x my your machine’s accessible IP address)
We notice that the ticker says “WARNING: XSS detected! You have been reported.” however, we still wait. Within 2 minutes, our javascript gets loaded, and we’ve stolen the user’s session cookie:
We replace our session cookie with this one, and now we’ve logged in, reavealing the flag in the ticker:
You’re an Executive! - FLAG{3a000000000000000000000000000000}