how many session-keys while man-in-the-middle-attack

71 Views Asked by At

Hey everyone we got a cheeky question, can you help me please?

How many sessions keys would be created, if there where two man-in-the-middle-attackers on a TTP connection between a Webrowser and a Webserver? And would the attackers see each other? Explain you answer.

I think there would be 4 keys, one for each connection. But im not sure.

1

There are 1 best solutions below

0
On BEST ANSWER

original communication:
Alice<------->Bob

intercepted communication:
Alice<-->Mallet<-->Marvin<-->Bob

as you can see there are 3 channels, which would lead us to 3 separate communication channels that would require keys in respect to the used protocol

for example if the communication was RSA encrypted on each channel there would be 2 keys ...

since you mentioned communication between a browser and a webserver i suppose TTP shall mean HTTP ... now here is the cheeky problem: HTTP does not feature encryption at all... that would be HTTPS ... so if you are asking for HTTP the answer is "0 session keys are used because there is no encryption. MITM attacks in this setup are transparent, so the attackers do not know of each other just by looking at the connection data"

in the HTTPS case for each connection the two parties calculate a pre-master secret and then derive the master secret which can be seen as the session key since all relevant other secrets are derived from it.... so there is one such master secret per channel, times 3 channels => 3

the thing about "do the attackers see each other?" gets a little bit more tricky here, it depends on what they know about the PKI and the webserver: let's assume the attacker do not have any other secret information from the PKI, especially they do not have access to a valid and trusted CA secret key, and noone in the whole scenario does something like certificate pinning.

in sthis case the browser will notice that the connection has been tempered with and will show a warning (the client knows... that the connection is being tampered with, but does not know how many attackers there are)

the first attacker as seen from client side knows like the client, that the connection is being manipulated, since he knows that he is manipulating the connection he knows that at least one more party is involved on the upstream path to the server. (in out setup, this attacker is the only attacker knowing of 2 attacks)

the second attacker can not distinguish between the client and the first attacker... he sees the server traffic is unmodified and will most likely suspect that this is a single MITM scenario (does not see attacker 1)

the server does not see any of this...

let's change the things a bit: from now on the attackers have access to a trusted CA secret key

now both attackers can issue their own valid certificates

as long as noone is actually monitoring the certificates and looking for changes in the certificates being used, everything is as transparent as in the plain HTTP case ... the client will not notice anything ... both attackers will only know of their own manipulation

but ... since this looks like homework ... maybe i added a mistake here and there ... maybe not ... there is only one way to be sure: check it...