You can use the Firefox add-on to read all the cookies used by the browser, the browser knows which cookies it has, and the domain it belongs to. You can then modify Tamper-Data to sniff all outgoing HTTP requests and look for the cookie value, even more you can refuse the request or change it before it is transmitted.
This will never stop the attacker. For an attacker, the cookie value is trivial for Obfuscate / Encode / Encrypt before passing.
HttpOnlyCookies is the best (but not complete) solution to this problem. If this header element is set and the browser supports it, then javascript will not be able to access document.cookie. But an attacker can use XmlHttpRequest to pick up requests to the system, thus โridingโ in an authenticated session.
You must INVERT YOUR XSS , protect against XSRF, use https for the entire session, and enable HttpOnlyCookies. I recommended you read A3: Broken Authentication and Session Management in The Owasp Top 10 2010.
source share