- "how many cookies does the application create?"
- The way I did this is by first clearing all the cookies in my browser, and then visiting the application. Then, I check the cookie list. Doing this tells me about all the cookies created when accessing the application.
- "which parts of the application generates a cookie?"
- Go to different parts of the web application and check the browser to see if any cookies are created.
- "which parts of the application causes a modification of the cookie?".
- Same as above - when we're messing around with the application, see if the status of any of the cookies has changed.
Our next step is to
analyze the cookie. For example, look at the session ID of multiple cookies.
Are they just linearly made? Are they random? Does duplicates exists? We can also examine the value of the cookie.
Often times, developers make the mistake of storing actual sensitive data in
the cookie. What their actually suppose to do is store a generic value and
reference the real data using the generic value. Some developers store real
data in cookies and just encode various methods like Hex, Base64, or MD5. What
they fail to understand is that these strings can easily be decoded and the
real data can be seen by unwanted eyes.
If tokens are in fact encoded, they could
contain multiple sets of data in one long string. For example, if the token is
32 bit string, the first 16 bits could represent something static like a
username or IP address and the next 16 bits could by dynamic. If this second 16
bit string changes incrementally, this could represent a date or time for each
access. One way to verify this is access
the site at the same time using different browsers and using the same
username/IP address. In that case, the cookies from each browser should be
almost the same.