[HELP]Hijack the session that has HTTP-Only Cookies

[removed]

Posted Jun 9, 2019, 4:28 AM UTC

24
smodnix•

Which type of xss reflected or stored or self?

1
dn3t•

On modern browsers and correctly configured web servers (e.g. no XST, no debug page that echoes back request headers) you can only "hijack" a session as long as the victim is still logged in on their browser by using said browser as a proxy: sending each request using JS running in that browser, thus httponly cookies are sent as usual. This project automates this type of attack nicely: https://beefproject.com/

1
DrinkJavaSeeSharpOP•

Thanks! I want to actually learn the hijack process by writing actual JS code. Could you point me where I can find such code?

1
dn3t•

Well, BeEF is open source ;)

The main points are:

  1. Establishing a two-way channel between the victim browser (origin: vulnerable page) and the attacker -- can be as simple as polling a URL

  2. Upon receiving a request over said channel, sending that request within the context of the vulnerable page loaded in the victim browser and sending the response back over the channel.

  3. Presenting a sensible UI on the attacker end of the channel, this could be as simple as a curl-like command line interface dumping HTML source code as output or a full blown browser interface like what BeEF provides.

1