Skip to content

Commit e1b4766

Browse files
committed
Update "Xor-as-a-Service" writeup
1 parent 2dac676 commit e1b4766

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

2020-09-05-confidence-finals/xaas/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ The `/app` directory contains files of interest that are owned by another user:
1414
* `flag.txt` with permissions "-r--------", and
1515
* `xaas` with permissions `-r-sr-xr-x`
1616

17-
The task is clearly to leak content of the text file by abusing executable.
17+
The task is clearly to leak content of the text file by abusing the executable.
1818

1919
The binary reads the secret from `flag.txt` file at startup and starts a simple service implementing the following commands:
2020
* `ResizeCommand` to resize an internal buffer,
2121
* `ReadSecretCommand` to copy an arbitrary slice of the secret into an arbitrary location within the buffer,
22-
* `ScrambleCommand` to xor an arbitrary slice of the buffer with provided key and store result into new location within the buffer, and
22+
* `ScrambleCommand` to xor an arbitrary slice of the buffer with provided key and store the result into a new location within the buffer, and
2323
* `StopCommand` to terminate the service.
2424

2525
There are no known programming bugs in the binary and the hint points to hardware issues.
2626

27-
Turns-out that Travis Downs posted a blog [Hardware Store Elimination](https://travisdowns.github.io/blog/2020/05/13/intel-zero-opt.html) a few months before the CTF that described an obscure optimization implemented by some Intel CPUs.
28-
The optimization is that CPU may significantly improve throughput of specific memory operations when operating on blocks of zeros.
27+
Turns-out that Travis Downs blogged about [Hardware Store Elimination](https://travisdowns.github.io/blog/2020/05/13/intel-zero-opt.html) a few months before the CTF, describing an obscure optimization implemented by some Intel CPUs.
28+
The optimization allows to significantly improve throughput of specific memory operations on blocks of zeros.
2929

30-
The above microarchitectural optimization can be abused as an oracle to leak the secret.
30+
The above microarchitectural optimization can be abused as an oracle to leak the secret from the analysed service.
3131

3232
## Exploitation
3333

34-
Our [solver](solver/solver.cxx) checks secret byte-by-byte.
34+
Our [solver](solver/solver.cxx) checks the secret byte-by-byte.
3535
For each position in the secret, all possible 256 xor keys are tested.
36-
The xor result is replicated multiple time within the buffer, such that we end-up with large block of zeros once the xor key matches the secret byte.
36+
The xor result is replicated multiple times within the buffer, such that we end-up with a large block of zeros once the xor key matches the secret byte.
3737
This is sufficient to affect the service performance, such that effect can be observed from another process.
3838

3939
And so we can successfully reveal the content of `flag.txt`:
@@ -45,4 +45,4 @@ p4{zero_values_move_faster}
4545

4646
While content-dependent optimizations may be risky in general, we cannot think of any practical abuse of _Hardware Store Elimination_ against real-world applications.
4747

48-
However Intel found some reasons to disable this with most recent [microcode update](https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00464.html).
48+
However Intel [reportedly](https://travisdowns.github.io/blog/2021/06/17/rip-zero-opt.html) found some reasons to [disable this optimization](https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00464.html) with the most recent microcode update.

0 commit comments

Comments
 (0)