0
0
Computer Networksknowledge~10 mins

Man-in-the-middle attacks in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Man-in-the-middle attacks
User sends message
Attacker intercepts message
Attacker reads or alters message
Attacker forwards message to receiver
Receiver gets altered message
Receiver replies
Attacker intercepts reply
Attacker reads or alters reply
Attacker forwards reply to user
This flow shows how an attacker secretly intercepts and changes messages between two parties without their knowledge.
Execution Sample
Computer Networks
User -> Attacker -> Receiver
Receiver -> Attacker -> User
Shows the message path being intercepted and forwarded by the attacker.
Analysis Table
StepActionMessage ContentWho Has ItEffect
1User sends messageHelloUser -> AttackerMessage intercepted
2Attacker reads messageHelloAttackerAttacker sees original message
3Attacker alters messageHello, please send moneyAttackerMessage changed
4Attacker forwards messageHello, please send moneyAttacker -> ReceiverReceiver gets fake message
5Receiver repliesOkay, sending moneyReceiver -> AttackerReply intercepted
6Attacker reads replyOkay, sending moneyAttackerAttacker sees reply
7Attacker alters replyOkay, sending money tomorrowAttackerReply changed
8Attacker forwards replyOkay, sending money tomorrowAttacker -> UserUser gets fake reply
9EndN/AN/ACommunication compromised
💡 Attack ends when attacker finishes intercepting and forwarding messages without detection.
State Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 6After Step 7Final
Message ContentHelloHelloHello, please send moneyHello, please send moneyOkay, sending moneyOkay, sending money tomorrowOkay, sending money tomorrow
HolderUserAttackerAttackerReceiverAttackerAttackerUser
Key Insights - 3 Insights
Why does the receiver not know the message was altered?
Because the attacker forwards the changed message as if it came directly from the user, hiding their presence (see execution_table step 4).
How can the attacker read the messages if they are supposed to be private?
The attacker intercepts the messages before they reach the receiver, so they see the message in transit (see execution_table step 2 and 6).
Why does the user trust the altered reply from the attacker?
Because the attacker forwards the reply pretending to be the receiver, so the user thinks it is genuine (see execution_table step 8).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the message content after step 3?
A"Okay, sending money"
B"Hello"
C"Hello, please send money"
D"Okay, sending money tomorrow"
💡 Hint
Check the 'Message Content' column at step 3 in the execution_table.
At which step does the attacker first alter a message?
AStep 2
BStep 3
CStep 5
DStep 7
💡 Hint
Look for the first 'Action' mentioning altering message in the execution_table.
If the attacker did not forward the altered message at step 4, what would happen?
AReceiver would get no message
BUser would get the reply early
CReceiver would get the original message
DAttacker would lose the message
💡 Hint
Consider the flow in concept_flow and what happens if forwarding stops.
Concept Snapshot
Man-in-the-middle attack:
- Attacker secretly intercepts communication
- Reads or changes messages before forwarding
- Both parties think they communicate directly
- Leads to data theft or misinformation
- Protection needs encryption and authentication
Full Transcript
A man-in-the-middle attack happens when an attacker secretly intercepts messages between two people communicating. The attacker reads or changes the messages and then forwards them, so both people think they are talking directly. This can cause stolen information or false messages. The attacker acts like a hidden middleman. The attack ends when the attacker stops intercepting messages. To prevent this, secure methods like encryption and verifying identities are needed.