ELI5, How does cookie logging work?

r/

how do hackers get your cookies and how do they login to your accounts using the cookies

Comments

  1. Vanthiar Avatar

    How they get them is usually personal ineptitude. An email or website you shouldn’t have clicked on, that type of deal, that’s true for almost all cybercrime.

    Cookies contain information about how and when you used the internet. They shouldn’t have passwords, but sometimes it be like that.

    Once the floodgate is opened, and you have an intruder with access, your cookies (with your info and history) can be highjacked to simulate your presence on a site.

  2. michalsrb Avatar

    Cookies are stored on your computer and sent to the server every time you visit the webpage. So they either need to steal it from your computer (like tricking you to download and run some program that will send it to them) or capture it in transit. Most pages use encryption (https), but some don’t. And if the attacker has control over the network (e.g. you connect to their wifi), they can place themselves between your computer and the server. Your browser will warn you that the site is using the wrong or no certificate, but if you choose to continue, they’ll get to see the cookie.

    Cookies can store all kinds of things, most interesting to the hacker is a session key. It’s typically some random text that marks your session. The server knows that on this session you’re logged in and it should show you your stuff. If the attacker sends it themselves, they will be logged in like you were. Some webs add extra protection and only allow each session if the IP address matches (but that logs you out when internet connection changes, like on mobile phone), or they require you to enter password again when doing something important, like changing password or sending money.

  3. Clojiroo Avatar

    A cookie is just a token. A bit of text + information about who (the site) issued it and how it should be treated.

    When you visit a website, each request your browser makes has a bunch of data attached. This includes all of the cookies that can be included according to each cookie’s properties.

    Things like tracking cookies are set to just be included all the time. The site logs your behaviour with the token. Then shares that with other sites. Then they can compare the behaviour for the same token. It can get more sophisticated than that with device fingerprinting but that’s a good simple version.

    Cookies are also a way to maintain a session (being logged in). You will have a cookie that is a session token. A big piece of text that represents you having logged in. It’s like attaching an ID badge to the browser. Every time you request something from the site you also show the ID badge.

    All of this is normally protected with HTTPS. The requests between you and the server that contain cookies are encrypted.

    In order to steal someone’s cookies you need to install malware or compromise the network security by being on the middle so that you can read the encrypted messages.