PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Man-in-the-Middle (MitM) Attacks and Session Hijacking (मैन-इन-द-मिडिल (MitM) अटैक और सेशन हाईजैकिंग तकनीक) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: Man-in-the-Middle (MitM) attacks position an adversary covertly along the communication path to intercept or alter traffic, while Session Hijacking steals or fixates authenticated session tokens to impersonate logged-in users.
अध्याय सार: मैन-इन-द-मिडिल (MitM) हमले में हमलावर क्लाइंट और सर्वर के बीच चुपके से बैठकर डेटा पढ़ता या बदलता है, जबकि सेशन हाईजैकिंग में वैध लॉगिन सेशन ID या कुकी चुराकर यूज़र के खाते पर कब्जा किया जाता है।
Man-in-the-Middle (MitM) Attacks and Session Hijacking: Detailed Notes & Architecture (मैन-इन-द-मिडिल (MitM) अटैक और सेशन हाईजैकिंग तकनीक)
1. MitM Interception: ARP Spoofing & Evil Twin Wi-Fi (MitM अवरोधन: ARP स्पूफिंग और ईविल ट्विन Wi-Fi)
[EN] On Local Area Networks, Address Resolution Protocol (ARP, Layer 2) is completely stateless and accepts unsolicited ARP replies without authentication. Attackers send forged Gratuitous ARP packets telling the victim that the attacker's MAC belongs to the Default Gateway IP—and telling the gateway the attacker's MAC belongs to the victim—intercepting all traffic silently. Over wireless networks, attackers deploy 'Evil Twin' rogue Access Points mimicking public SSIDs to capture unencrypted sessions.
[HI] लोकल नेटवर्क (LAN) में लेयर-2 प्रोटोकॉल ARP बिना प्रमाणीकरण के काम करता है। हमलावर नकली Gratuitous ARP संदेश भेजकर विक्टिम को खुद को गेटवे बताता है और गेटवे को खुद को विक्टिम बताता है, जिससे सारा ट्रैफिक हमलावर के कंप्यूटर से गुजरता है। वहीं Wi-Fi में फर्जी 'Evil Twin' हॉटस्पॉट बनाकर डेटा इंटरसेप्ट किया जाता है।
2. SSL Stripping & HSTS Downgrade Protection (SSL स्ट्रिपिंग और HSTS डाउनग्रेड सुरक्षा)
[EN] Demonstrated by Moxie Marlinspike, SSL Stripping exploits the initial unencrypted HTTP request before a redirect to HTTPS occurs: an on-path attacker intercepts HTTP port 80 traffic, maintains an HTTPS session with the real server, and strips links/redirects back down to plaintext HTTP for the victim. HTTP Strict Transport Security (HSTS) defeats SSL stripping by sending 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload', forcing browsers never to connect over plaintext HTTP.
[HI] SSL स्ट्रिपिंग में जब यूज़र पहले HTTP (पोर्ट 80) पर जाता है, तो बीच में बैठा हमलावर सर्वर से तो HTTPS पर जुड़ता है लेकिन यूज़र को सादा HTTP पेज ही दिखाता रहता है। इसे रोकने के लिए सर्वर HSTS हेडर ('Strict-Transport-Security') भेजता है जो ब्राउज़र को हमेशा केवल HTTPS उपयोग करने को बाध्य करता है।
3. Session Hijacking: Sniffing, Fixation & TCP Takeover (सेशन हाईजैकिंग: स्निफिंग, फिक्सेशन व TCP टेकओवर)
[EN] Since HTTP is stateless, websites maintain login state via cookies such as PHPSESSID or JSESSIONID. Attackers hijack sessions through Sidejacking (sniffing plaintext session cookies on open Wi-Fi), XSS exfiltration ('document.cookie'), or Session Fixation—where the attacker forces a pre-known Session ID onto the victim before login and reuses it once the victim authenticates. At Layer 4, TCP Session Hijacking injects spoofed segments by guessing or sniffing sequence and acknowledgment numbers.
[HI] HTTP स्टेटलेस होने के कारण लॉगिन की पहचान कुकीज़ (जैसे PHPSESSID) से होती है। हमलावर असुरक्षित Wi-Fi पर कुकी स्निफ करके (Sidejacking), XSS के जरिए या 'Session Fixation' (लॉगिन से पहले हमलावर द्वारा दी गई सेशन ID को ही लॉगिन के बाद वैध मान लेना) द्वारा सेशन हाईजैक करते हैं। लेयर-4 पर TCP अनुक्रम संख्या का अनुमान लगाकर भी सेशन टेकओवर होता है।
4. End-to-End Defenses: TLS 1.3, DAI & Secure Cookie Flags (सुरक्षा कवच: TLS 1.3, DAI और सुरक्षित कुकी फ्लैग्स)
[EN] Defending against MitM and Session Hijacking requires layered controls: switches enforce DHCP Snooping and Dynamic ARP Inspection (DAI) to reject spoofed ARP packets on LANs; applications enforce TLS 1.3 with authenticated certificates (plus mutual TLS or pinning in mobile apps); servers regenerate a fresh Session ID immediately upon login to stop Session Fixation; and session cookies must carry 'Secure', 'HttpOnly', and 'SameSite' attributes.
[HI] बचाव के लिए स्विच पर DHCP Snooping और Dynamic ARP Inspection (DAI) लागू किया जाता है। वेब सुरक्षा में TLS 1.3 और HSTS के साथ लॉगिन होते ही तुरंत नया Session ID जनरेट (Regenerate) करना अनिवार्य है, तथा कुकी में Secure, HttpOnly व SameSite फ्लैग्स लगाए जाते हैं।
Syntax, Formula & Technical Example (Man-in-the-Middle (MitM) Attacks and Session Hijacking)
# 1. MitM-Resistant HTTP Response Headers (HSTS + Secure Session Cookie)
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Set-Cookie: SESSIONID=9f8a7b6c5d4e; Path=/; Secure; HttpOnly; SameSite=Lax
# 2. Defeating Session Fixation (Python/Flask-style Login Handler)
def handle_login(user, session):
if verify_credentials(user):
session.regenerate_id() # MUST issue new ID post-auth to stop fixation
session['uid'] = user.id
# 3. Cisco Switch Layer-2 ARP Spoofing Defense
ip dhcp snooping
ip arp inspection vlan 10
Man-in-the-Middle (MitM) Attacks and Session Hijacking Quick Reference & Comparison Table
| Attack / Defense Concept | Layer & Target Mechanism | Primary Impact / Rule |
|---|---|---|
| ARP Cache Poisoning | Layer 2 (Gratuitous ARP Replies) | Redirects LAN gateway traffic through attacker MAC |
| SSL Stripping | Layer 7 (HTTP-to-HTTPS Redirect Downgrade) | Forces victim onto plaintext HTTP while attacker uses HTTPS |
| Session Fixation | Web Auth Flow (Pre-login Session ID) | Reuses attacker-supplied SID after victim logs in |
| HttpOnly + Secure Cookie | Browser Set-Cookie Security Flags | Blocks JS document.cookie access & plaintext HTTP transit |
Man-in-the-Middle (MitM) Attacks and Session Hijacking Top 20 Bilingual MCQs with Answers
Q1. Why is the Address Resolution Protocol (ARP) inherently vulnerable to Man-in-the-Middle poisoning on a LAN?
(लोकल नेटवर्क (LAN) में ARP प्रोटोकॉल MitM पॉइजनिंग के प्रति संवेदनशील क्यों होता है?)
(A) ARP packets are always broadcast across the global Internet
(B) ARP is stateless and hosts blindly update their IP-to-MAC cache upon receiving unauthenticated ARP replies
(C) ARP encrypts MAC addresses using weak 40-bit DES keys
(D) ARP operates exclusively over unencrypted HTTP port 80
Correct Answer: (B)
[EN] Hosts accept unsolicited Gratuitous ARP replies even without sending a prior ARP Request, allowing trivial MAC spoofing.
[HI] ARP स्टेटलेस प्रोटोकॉल है जिसमें बिना किसी प्रमाणीकरण के ही प्राप्त अनचाहे ARP उत्तर (Gratuitous ARP) के आधार पर MAC टेबल अपडेट हो जाती है।
Q2. In an 'SSL Stripping' MitM attack, what connection exists between the victim and the attacker versus the attacker and the real server?
('SSL स्ट्रिपिंग' MitM हमले में पीड़ित-से-हमलावर और हमलावर-से-असली सर्वर के बीच कौन से कनेक्शन होते हैं?)
(A) Victim <-> Attacker uses HTTPS, while Attacker <-> Server uses FTP
(B) Victim <-> Attacker uses unencrypted HTTP, while Attacker <-> Server uses genuine HTTPS
(C) Both links use unencrypted Telnet on port 23
(D) Both links use mutual TLS 1.3 certificates
Correct Answer: (B)
[EN] The attacker intercepts the HTTP redirect, maintains an encrypted TLS connection with the server, and relays plaintext HTTP to the victim.
[HI] हमलावर असली सर्वर से HTTPS द्वारा जुड़ता है लेकिन बीच में SSL हटाकर पीड़ित को असुरक्षित HTTP पेज ही भेजता है।
Q3. Which HTTP response header prevents SSL Stripping by instructing browsers to never make unencrypted HTTP requests to that domain?
(कौन सा HTTP रिस्पॉन्स हेडर ब्राउज़र को किसी डोमेन के लिए कभी भी असुरक्षित HTTP कनेक्शन न बनाने का निर्देश देकर SSL स्ट्रिपिंग रोकता है?)
(A) Access-Control-Allow-Origin
(B) X-Content-Type-Options
(C) Content-Disposition
(D) Strict-Transport-Security (HSTS)
Correct Answer: (D)
[EN] HSTS caches a strict policy (especially when compiled into browser preload lists) forcing automatic HTTPS upgrades before any packet leaves the browser.
[HI] HSTS (Strict-Transport-Security) ब्राउज़र में यह नियम सेव कर देता है कि उस वेबसाइट पर हमेशा HTTPS का ही उपयोग हो।
Q4. What specifically distinguishes 'Session Fixation' from 'Session Sidejacking'?
('Session Fixation' और 'Session Sidejacking' के बीच मुख्य अंतर क्या है?)
(A) Session Fixation happens at Layer 2 ARP, while Sidejacking uses SQL injection
(B) Session Fixation forces a victim to log in using an attacker-chosen Session ID, whereas Sidejacking sniffs an already-authenticated session cookie off the network
(C) Sidejacking only targets offline encrypted PDF files
(D) Session Fixation steals hardware tokens physically
Correct Answer: (B)
[EN] In Fixation, the attacker knows the SID beforehand; in Sidejacking, the attacker captures an active cookie transmitted over HTTP.
[HI] Fixation में हमलावर लॉगिन से पहले अपना Session ID यूज़र को थमा देता है, जबकि Sidejacking में खुले नेटवर्क पर लॉगिन हो चुकी कुकी स्निफ की जाती है।
Q5. How should a web application completely eliminate Session Fixation vulnerabilities?
(एक वेब एप्लिकेशन Session Fixation की कमजोरी को पूरी तरह कैसे समाप्त कर सकता है?)
(A) Accept Session IDs exclusively inside URL query strings (?PHPSESSID=)
(B) Invalidate the pre-authentication session and regenerate a brand-new random Session ID immediately after successful login
(C) Store the user's plaintext password inside the cookie name
(D) Disable HTTPS on the login submission page
Correct Answer: (B)
[EN] If the server rotates the session identifier upon any privilege boundary change (login/password change), the pre-login ID becomes useless.
[HI] सफल लॉगिन होते ही सर्वर को पुराना Session ID रद्द कर तुरंत नया रैंडम Session ID जनरेट (Regenerate) करना चाहिए।
Q6. Which Set-Cookie attribute prevents client-side JavaScript (such as an XSS payload) from reading a session cookie via document.cookie?
(कौन सा Set-Cookie एट्रिब्यूट क्लाइंट-साइड JavaScript (जैसे XSS हमला) को document.cookie से सेशन कुकी पढ़ने से रोकता है?)
(A) Secure
(B) HttpOnly
(C) Max-Age
(D) Domain
Correct Answer: (B)
[EN] The HttpOnly flag ensures the cookie is sent only in HTTP/HTTPS requests and remains invisible to JavaScript DOM APIs.
[HI] HttpOnly फ्लैग लगाने पर ब्राउज़र की JavaScript (document.cookie) उस सेशन कुकी को नहीं पढ़ सकती।
Q7. What does the 'Secure' attribute on an HTTP Set-Cookie directive enforce?
(HTTP Set-Cookie में 'Secure' एट्रिब्यूट क्या सुनिश्चित करता है?)
(A) The browser will transmit the cookie only over encrypted HTTPS connections, never over plaintext HTTP
(B) The cookie cannot be deleted by clearing browser history
(C) The cookie automatically enables Two-Factor Authentication
(D) The cookie is encrypted using the user's OS login password
Correct Answer: (A)
[EN] Without the 'Secure' flag, a session cookie issued on HTTPS could still be leaked if the user visits any HTTP sub-resource.
[HI] 'Secure' फ्लैग सुनिश्चित करता है कि कुकी केवल एन्क्रिप्टेड HTTPS चैनल पर ही भेजी जाए, सादा HTTP पर नहीं।
Q8. Which managed Ethernet switch security feature stops ARP Spoofing / MitM on enterprise LANs?
(एंटरप्राइज LAN स्विच पर कौन सा सुरक्षा फीचर ARP स्पूफिंग / MitM को रोकता है?)
(A) Port Mirroring (SPAN)
(B) VLAN Trunking Protocol (VTP)
(C) Dynamic ARP Inspection (DAI) paired with DHCP Snooping
(D) Spanning Tree Protocol (STP) FastPort
Correct Answer: (C)
[EN] DAI validates incoming ARP packets against the trusted IP-to-MAC binding table built dynamically by DHCP Snooping.
[HI] Dynamic ARP Inspection (DAI) और DHCP Snooping मिलकर विश्वसनीय IP-MAC टेबल के विरुद्ध नकली ARP पैकेट्स को ड्रॉप करते हैं।
Q9. What is an 'Evil Twin' attack in wireless networking?
(वायरलेस नेटवर्किंग में 'Evil Twin' (दुष्ट जुड़वां) हमला क्या होता है?)
(A) Two switches connected with redundant crossover cables
(B) A rogue Wi-Fi Access Point broadcasting the exact SSID of a legitimate public hotspot to intercept victim traffic via MitM
(C) Cloning an enterprise RAID hard drive remotely
(D) Sending duplicate TCP FIN packets to close a browser tab
Correct Answer: (B)
[EN] Devices with auto-connect enabled or unsuspecting users connect to the stronger rogue Evil Twin signal, routing traffic through the attacker.
[HI] हमलावर असली पब्लिक Wi-Fi जैसे ही नाम (SSID) वाला नकली हॉटस्पॉट बनाकर यूज़र्स का सारा इंटरनेट ट्रैफिक अपने सिस्टम से गुजारता है।
Q10. Why is unauthenticated Diffie-Hellman key exchange inherently vulnerable to a Man-in-the-Middle attack?
(बिना प्रमाणीकरण वाला Diffie-Hellman की-एक्सचेंज MitM हमले के प्रति संवेदनशील क्यों होता है?)
(A) DH only works over UDP broadcast frames
(B) An on-path attacker can independently perform separate DH exchanges with Alice and Bob without either knowing whom they agreed keys with
(C) DH transmits plaintext symmetric passwords in Base64
(D) DH keys are always fixed at 32 bits
Correct Answer: (B)
[EN] Without digital signatures/certificates (as provided in TLS via RSA/ECDSA), DH verifies math correctness, not peer identity.
[HI] बिना डिजिटल सर्टिफिकेट या सिग्नेचर के एलिस और बॉब यह सत्यापित नहीं कर सकते कि सामने वाला असली व्यक्ति है या बीच में बैठा हमलावर।
Q11. In TCP Session Hijacking at Layer 4, what critical 32-bit header values must an attacker predict or sniff to inject commands into an active TCP stream?
(लेयर-4 पर TCP सेशन हाईजैकिंग में सक्रिय कनेक्शन में डेटा इंजेक्ट करने के लिए हमलावर को किन 32-बिट मानों की जानकारी होनी चाहिए?)
(A) Current TCP Sequence Number (SEQ) and Acknowledgment Number (ACK)
(B) ICMP Type and Code
(C) UDP Length and Window Scale
(D) IP Fragment Offset and Header Checksum
Correct Answer: (A)
[EN] TCP rejects packets whose Sequence/Acknowledgment numbers fall outside the active receive window, forcing hijackers to sniff or predict ISNs.
[HI] TCP केवल सही SEQ और ACK नंबर वाले पैकेट्स स्वीकार करता है, इसलिए हाईजैकिंग के लिए इनका स्निफिंग या अनुमान आवश्यक है।
Q12. What does 'Firesheep' historically demonstrate about Session Sidejacking?
('Firesheep' टूल ने ऐतिहासिक रूप से Session Sidejacking के बारे में क्या साबित किया था?)
(A) AES-256 encryption can be broken in under 5 seconds
(B) Passing unencrypted session cookies over open Wi-Fi after login-only HTTPS lets anyone on the same LAN hijack accounts effortlessly
(C) Cookies cannot be stored inside SQLite databases
(D) WPA3 routers leak Wi-Fi passwords in plain beacon frames
Correct Answer: (B)
[EN] Before full-site HTTPS became universal, sites encrypting only the login POST left subsequent cookies exposed in plaintext on public Wi-Fi.
[HI] जब वेबसाइट केवल लॉगिन पेज को HTTPS करती थीं और बाकी पेज HTTP पर चलाती थीं, तो पब्लिक Wi-Fi पर कुकी चुराकर कोई भी खाता हाईजैक कर सकता था।
Q13. What does 'Mutual TLS (mTLS)' add beyond standard TLS to defeat MitM proxies?
(मानक TLS के अलावा 'Mutual TLS (mTLS)' MitM प्रॉक्सी को रोकने के लिए क्या अतिरिक्त सुरक्षा जोड़ता है?)
(A) It hides HTTP headers inside ICMP ping packets
(B) It disables certificate expiration checks for faster browsing
(C) Both the server AND the client present and verify X.509 cryptographic certificates during the handshake
(D) It shares one global private key across all mobile apps
Correct Answer: (C)
[EN] Even if a compromised device trusts a rogue corporate/MitM root CA, mTLS fails unless the proxy also possesses the client's private key.
[HI] mTLS में सर्वर के साथ-साथ क्लाइंट भी अपना X.509 सर्टिफिकेट प्रस्तुत करता है, जिससे नकली प्रॉक्सी सर्वर बीच में नहीं आ सकता।
Q14. Why is transmitting a Session ID inside the URL (URL Rewriting, e.g., /home?jsessionid=123) dangerous?
(URL के भीतर Session ID भेजना (जैसे /home?jsessionid=123) सुरक्षा के लिहाज से खतरनाक क्यों है?)
(A) URL parameters cannot contain alphanumeric characters
(B) URLs are limited strictly to 8 bytes in HTTP/1.1
(C) The Session ID leaks via browser history, server access logs, bookmarks, and external HTTP 'Referer' headers
(D) Browsers automatically convert URL parameters into MD5 hashes
Correct Answer: (C)
[EN] Clicking an external link on the page leaks the full URL containing the secret Session ID in the Referer header to third-party sites.
[HI] URL में मौजूद Session ID ब्राउज़र हिस्ट्री, सर्वर लॉग्स और बाहरी लिंक पर क्लिक करने पर Referer हेडर के माध्यम से लीक हो जाती है।
Q15. What is 'BGP Hijacking' as an Internet-scale Man-in-the-Middle vector?
(इंटरनेट स्तर पर MitM वेक्टर के रूप में 'BGP Hijacking' क्या है?)
(A) Poisoning a local Windows hosts file via USB drive
(B) Spoofing Ethernet MAC addresses inside a VirtualBox VM
(C) Modifying DNS A records on a home Wi-Fi router
(D) An Autonomous System falsely advertising more specific IP prefixes to route global traffic through its routers for interception or blackholing
Correct Answer: (D)
[EN] Because BGP historically lacked cryptographic route validation (addressed via RPKI/ROA), rogue announcements can detour global traffic.
[HI] BGP हाईजैकिंग में कोई नेटवर्क गलत IP रूट की घोषणा करके वैश्विक इंटरनेट ट्रैफिक को अपने राउटर से मोड़ लेता है।
Q16. Which statement about Man-in-the-Middle (MitM) and Session Hijacking is FALSE?
(MitM और सेशन हाईजैकिंग के बारे में निम्नलिखित में से कौन सा कथन असत्य (FALSE) है?)
(A) HSTS preload protects even a user's very first visit against SSL stripping
(B) Regenerating the session ID after authentication mitigates Session Fixation
(C) ARP cache poisoning exploits the lack of authentication in Layer 2 ARP
(D) Setting the 'HttpOnly' cookie flag completely prevents an attacker on open Wi-Fi from sniffing cookies transmitted over plaintext HTTP
Correct Answer: (D)
[EN] HttpOnly blocks JavaScript access (XSS), NOT network sniffing! Plaintext HTTP cookies require the 'Secure' flag and HTTPS/HSTS to stop sniffing.
[HI] HttpOnly केवल JavaScript (XSS) से कुकी बचाता है, सादा HTTP पर नेटवर्क स्निफिंग से नहीं; स्निफिंग रोकने के लिए 'Secure' फ्लैग और HTTPS/HSTS जरूरी हैं।
Q17. Within Man-in-the-Middle (MitM) Attacks and Session Hijacking, which attack / defense concept directly maps to: "Layer 2 (Gratuitous ARP Replies)"?
(Man-in-the-Middle (MitM) Attacks and Session Hijacking में कौन सा Attack / Defense Concept सीधे "Layer 2 (Gratuitous ARP Replies)" से संबंधित है?)
(A) SSL Stripping
(B) Session Fixation
(C) HttpOnly + Secure Cookie
(D) ARP Cache Poisoning
Correct Answer: (D)
[EN] In Man-in-the-Middle (MitM) Attacks and Session Hijacking, 'ARP Cache Poisoning' handles 'Layer 2 (Gratuitous ARP Replies)' (Redirects LAN gateway traffic through attacker MAC).
[HI] Man-in-the-Middle (MitM) Attacks and Session Hijacking में 'ARP Cache Poisoning' का कार्य/विवरण 'Layer 2 (Gratuitous ARP Replies)' (Redirects LAN gateway traffic through attacker MAC) है।
Q18. Which option accurately describes 'SSL Stripping' in Man-in-the-Middle (MitM) Attacks and Session Hijacking?
(Man-in-the-Middle (MitM) Attacks and Session Hijacking के संदर्भ में 'SSL Stripping' की सही विशेषता कौन सी है?)
(A) Web Auth Flow (Pre-login Session ID)
(B) Browser Set-Cookie Security Flags
(C) Layer 2 (Gratuitous ARP Replies)
(D) Layer 7 (HTTP-to-HTTPS Redirect Downgrade)
Correct Answer: (D)
[EN] 'SSL Stripping' provides 'Layer 7 (HTTP-to-HTTPS Redirect Downgrade)' — key point: Forces victim onto plaintext HTTP while attacker uses HTTPS.
[HI] 'SSL Stripping' का मुख्य विवरण 'Layer 7 (HTTP-to-HTTPS Redirect Downgrade)' है (Forces victim onto plaintext HTTP while attacker uses HTTPS)।
Q19. In Man-in-the-Middle (MitM) Attacks and Session Hijacking, identify the correct parameter for the specification: "Web Auth Flow (Pre-login Session ID)".
(Man-in-the-Middle (MitM) Attacks and Session Hijacking में "Web Auth Flow (Pre-login Session ID)" विवरण किस विकल्प के लिए सही है?)
(A) Session Fixation
(B) HttpOnly + Secure Cookie
(C) SSL Stripping
(D) ARP Cache Poisoning
Correct Answer: (A)
[EN] 'Session Fixation' corresponds to 'Web Auth Flow (Pre-login Session ID)' (Reuses attacker-supplied SID after victim logs in).
[HI] 'Session Fixation' का संबंध 'Web Auth Flow (Pre-login Session ID)' (Reuses attacker-supplied SID after victim logs in) से है।
Q20. Considering Man-in-the-Middle (MitM) Attacks and Session Hijacking, what key behavior defines 'HttpOnly + Secure Cookie'?
(Man-in-the-Middle (MitM) Attacks and Session Hijacking में 'HttpOnly + Secure Cookie' की मुख्य भूमिका या मान क्या है?)
(A) Layer 7 (HTTP-to-HTTPS Redirect Downgrade)
(B) Layer 2 (Gratuitous ARP Replies)
(C) Browser Set-Cookie Security Flags
(D) Web Auth Flow (Pre-login Session ID)
Correct Answer: (C)
[EN] 'HttpOnly + Secure Cookie' represents 'Browser Set-Cookie Security Flags' (Blocks JS document.cookie access & plaintext HTTP transit).
[HI] 'HttpOnly + Secure Cookie' का अर्थ/मान 'Browser Set-Cookie Security Flags' है (Blocks JS document.cookie access & plaintext HTTP transit)।
Man-in-the-Middle (MitM) Attacks and Session Hijacking — Exam FAQs
Q1: How does an attacker intercept HTTPS traffic if TLS encrypts everything?
यदि TLS सारा डेटा एन्क्रिप्ट करता है, तो हमलावर HTTPS ट्रैफिक को कैसे इंटरसेप्ट कर सकता है?
[EN] An active MitM either downgrades the initial HTTP visit via SSL stripping (if HSTS is absent), tricks the victim into installing a rogue root CA certificate, or exploits a compromised/forged CA.
[HI] यदि HSTS लागू न हो तो हमलावर SSL स्ट्रिपिंग से शुरुआती HTTP को डाउनग्रेड कर सकता है, या पीड़ित के डिवाइस में नकली रूट CA सर्टिफिकेट इंस्टॉल कराकर प्रॉक्सी बना सकता है।
Q2: Is Session Hijacking possible if a website uses full-site HTTPS with HSTS?
यदि वेबसाइट पूरे ट्रैफिक के लिए HTTPS और HSTS उपयोग करती है, तो क्या फिर भी सेशन हाईजैकिंग हो सकती है?
[EN] Yes—if the site suffers from XSS and lacks the HttpOnly cookie flag, or suffers from Session Fixation or malware stealing cookies directly from the browser's profile directory.
[HI] हाँ—यदि वेबसाइट में XSS की कमजोरी हो और कुकी में HttpOnly न लगा हो, या Session Fixation मौजूद हो अथवा सिस्टम में कुकी चुराने वाला मालवेयर हो।
Q3: What is the difference between Passive Eavesdropping and an Active MitM attack?
पैसिव ईव्सड्रॉपिंग और एक्टिव MitM हमले में क्या अंतर है?
[EN] Passive eavesdropping only listens silently to unencrypted traffic on a shared medium, whereas an active MitM alters routing/ARP/DNS and actively proxies or modifies packets in transit.
[HI] पैसिव ईव्सड्रॉपिंग में हमलावर केवल चुपचाप डेटा सुनता है, जबकि एक्टिव MitM में वह ARP/DNS बदलकर ट्रैफिक को अपने सिस्टम से मोड़ता और संशोधित भी कर सकता है।
Post a Comment
Post a Comment