I understood the XOR trick that allows an attacker to guess a block of a previously sent message from the client to the server: the attacker forces the client to send the message $\tilde{m} = c_n \oplus m_g \oplus c$ where
- $c_n$ is the last block of the last ciphertext;
- $m_g$ is the attacker guess of the decryption of an arbitrary block of a previously sent message;
- $c$ is the encrypted block that was chained with the real plaintext block $m$ (i.e., the one that attacker is trying to guess).
When the client sends $\tilde{m}$ to the server the result is
$$E_K(c_n \oplus \tilde{m}) = E_K(c \oplus m_g)$$
that is equal to $E_K(c \oplus m)$ iff the block $m = m_g$. Iterating this attack on all the blocks of a message $M$, the attacker can say if the message $M = M_g$.
So far, so good. What I can't figure out from now on, is how can he change his attack to decrypt a message, without doing a guessing attack. In particular, the problem is that if he tries to guess the block, he only has $2^{-64}$ (supposing to use a 8 byte block cipher) chance of success.
The articles that explain this second part of the attack say: "suppose you already know 7 byte out of 8, you only got a few more guessing to try ($2^8$)", but I don't understand how an attacker can know the first 7 byte of the block he want to decrypt.
As an example, this is an article that goes into the details of the attack. In the last part, he gives the following example
GET /index.html HTTP/1.1
Host: mysite.com
Cookie: Session=123456
Accept-Encoding: text/html
Accept-Charset: utf-8
How could an attacker find out the session number? This message would be encrypted as
GET /ind ex.html HTTP/1.1 \r\nHost : mysite .com\r\n Cookie: Session= 12345678
a7d25abbd67b2dbf e2ade7246ea5ed5 e99063ebe430b75b 746ae5eca36e2bc3 f6f62f99a076056f 6b14704973a779ae 7fa9300d4e490cba b6040b9542a59ad5 f9bb888ac3763722b
It's not clear (to me) how they achieved this result in the article.
Other resources that I've checked out are