Compare commits
0
Commits
master
..
619056a0a7
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ version: "3.3"
|
|||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
restart: always
|
restart: always
|
||||||
image: nginx:alpine
|
image: nginx:1.21.4
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
+6
-1
@@ -66,8 +66,13 @@ enableEmoji = true
|
|||||||
[languages]
|
[languages]
|
||||||
[languages.en]
|
[languages.en]
|
||||||
title = "Juju"
|
title = "Juju"
|
||||||
|
subtitle = ""
|
||||||
|
keywords = "Crypto, Reverse"
|
||||||
|
copyright = '<a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a>'
|
||||||
|
readOtherPosts = "Read other posts"
|
||||||
|
|
||||||
[languages.en.params.logo]
|
[languages.en.params.logo]
|
||||||
logoMark = "juju@pwningway ~$ "
|
logoMark = "juju@synacktiv ~$ "
|
||||||
logoText = "objdump -d"
|
logoText = "objdump -d"
|
||||||
logoHomeLink = "/"
|
logoHomeLink = "/"
|
||||||
logoCursorColor = "#3884FF"
|
logoCursorColor = "#3884FF"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ known cryptosystem to encrypt data, let's find this out.
|
|||||||
{{< image src="/EXTerminated/panik.png" style="border-radius: 8px;" >}}
|
{{< image src="/EXTerminated/panik.png" style="border-radius: 8px;" >}}
|
||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
`reverse` | `472 pts` `12 solves` :star::star:
|
`reverse` | `472 pts` `12 solves` `:star::star:`
|
||||||
```
|
```
|
||||||
Un client a détecté un seveur compromis sur son parc. Ce serveur semble avoir
|
Un client a détecté un seveur compromis sur son parc. Ce serveur semble avoir
|
||||||
perdu l'ensemble de ses données suite à une infection. Il nous indique que les
|
perdu l'ensemble de ses données suite à une infection. Il nous indique que les
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ the flag without actually solving the intended puzzle, but more on that later.
|
|||||||
{{< image src="/diplodocus/yee-dinosaur.gif" style="border-radius: 8px;" >}}
|
{{< image src="/diplodocus/yee-dinosaur.gif" style="border-radius: 8px;" >}}
|
||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
`reverse` | `477 pts` `10 solves` :star::star::star:
|
`reverse` | `477 pts` `10 solves` `:star::star::star:`
|
||||||
```
|
```
|
||||||
Trouvez une entrée qui valide, et soumettez-la au service en ligne pour obtenir
|
Trouvez une entrée qui valide, et soumettez-la au service en ligne pour obtenir
|
||||||
le flag.
|
le flag.
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ here, but in solving the underlying problem.
|
|||||||
{{< image src="/brachiosaure/meme.jpg" style="border-radius: 8px;" >}}
|
{{< image src="/brachiosaure/meme.jpg" style="border-radius: 8px;" >}}
|
||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
|
`reverse` | `477 pts` `10 solves` `:star::star:`
|
||||||
`reverse` | `477 pts` `10 solves` :star::star:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
Vous aimez les QR Codes ? On vous demande d'écrire un générateur d'entrées
|
Vous aimez les QR Codes ? On vous demande d'écrire un générateur d'entrées
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ the solver algorithm for the first puzzle so here you go.
|
|||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
|
|
||||||
`reverse` | `482 pts` `8 solves` :star::star::star:
|
`reverse` | `482 pts` `8 solves` `:star::star::star:`
|
||||||
|
|
||||||
```
|
```
|
||||||
Trouvez une entrée permettant d'afficher le message de réussite, et envoyez-la
|
Trouvez une entrée permettant d'afficher le message de réussite, et envoyez-la
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Black box reversing | Archiver @ FCSC 2024"
|
title: "Black box reversing | Archiver @ FCSC 2024"
|
||||||
date: "2024-04-14 22:00:00"
|
date: "2024-04-13 22:00:00"
|
||||||
author: "Juju"
|
author: "Juju"
|
||||||
tags: ["Reverse", "Writeup", "fcsc"]
|
tags: ["Reverse", "Writeup", "fcsc"]
|
||||||
toc: true
|
toc: true
|
||||||
@@ -30,7 +30,7 @@ do without reading the code or debugging.
|
|||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
|
|
||||||
`reverse` | `490 pts` `5 solves` :star::star:
|
`reverse` | `490 pts` `5 solves` `:star::star:`
|
||||||
|
|
||||||
```
|
```
|
||||||
Notre équipe SIGINT a intercepté un e-mail contenant une pièce jointe
|
Notre équipe SIGINT a intercepté un e-mail contenant une pièce jointe
|
||||||
@@ -290,7 +290,7 @@ Remember that I know that filename is `flag.txt`, and that I have
|
|||||||
an associated ciphertext.
|
an associated ciphertext.
|
||||||
|
|
||||||
With a little bit of luck, the IV of the filename cipher text
|
With a little bit of luck, the IV of the filename cipher text
|
||||||
is generated with the same key:
|
is generated with the key:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
>>> 0x82 ^ ord('f')
|
>>> 0x82 ^ ord('f')
|
||||||
@@ -299,8 +299,10 @@ is generated with the same key:
|
|||||||
|
|
||||||
Looks like it does.
|
Looks like it does.
|
||||||
|
|
||||||
Since I have a known plaintext and example cipher text, I can simply, xor
|
Since I have a known plaintext, example cipher text.
|
||||||
the plaintext with the filename IV to recover the xor key.
|
|
||||||
|
I can simply, xor the plaintext with the filename IV to recover
|
||||||
|
the xor key.
|
||||||
|
|
||||||
Then apply the same key to the file data IV to recover the
|
Then apply the same key to the file data IV to recover the
|
||||||
plain text:
|
plain text:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "Decompiling a multi-process VM back to C | Megalosaure @ FCSC 2024"
|
title: "Decompiling a nanomites based VM back to C | Megalosaure @ FCSC 2024"
|
||||||
date: "2024-04-14 22:00:00"
|
date: "2024-04-14 22:00:00"
|
||||||
author: "Juju"
|
author: "Juju"
|
||||||
tags: ["Reverse", "Writeup", "fcsc"]
|
tags: ["Reverse", "Writeup", "fcsc"]
|
||||||
@@ -19,7 +19,7 @@ We are instead met with a program that takes 20 minutes to validate the input an
|
|||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
|
|
||||||
`reverse` | `487 pts` `6 solves` :star::star::star:
|
`reverse` | `487 pts` `6 solves` `:star::star::star:`
|
||||||
|
|
||||||
```
|
```
|
||||||
Voici un binaire qui vérifie si ce qu'on lui passe est le flag. À vous de jouer !
|
Voici un binaire qui vérifie si ce qu'on lui passe est le flag. À vous de jouer !
|
||||||
@@ -29,7 +29,7 @@ Author: `Cryptanalyse`
|
|||||||
|
|
||||||
## Given files
|
## Given files
|
||||||
|
|
||||||
[megalosaure](/megalosaure/src/megalosaure)
|
[megalosaure](/megalosaure/megalosaure)
|
||||||
|
|
||||||
|
|
||||||
# Writeup
|
# Writeup
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ not looking at it, so stay alert :eyes:.
|
|||||||
|
|
||||||
## Challenge description
|
## Challenge description
|
||||||
|
|
||||||
`reverse` | `467 pts` `14 solves` :star::star::star:
|
`reverse` | `467 pts` `14 solves` `:star::star::star:`
|
||||||
|
|
||||||
```
|
```
|
||||||
Trouvez le flag accepté par le binaire.
|
Trouvez le flag accepté par le binaire.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import struct
|
|||||||
from pwn import *
|
from pwn import *
|
||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
from Crypto.Util.number import inverse
|
from Crypto.Util.number import inverse
|
||||||
#from z3 import *
|
from z3 import *
|
||||||
|
|
||||||
|
|
||||||
opcodes = {
|
opcodes = {
|
||||||
@@ -210,6 +210,7 @@ class Child:
|
|||||||
self.depends = []
|
self.depends = []
|
||||||
self.unlocks = []
|
self.unlocks = []
|
||||||
self.inputs = []
|
self.inputs = []
|
||||||
|
self.forced = False, 0
|
||||||
self.main_instr = None
|
self.main_instr = None
|
||||||
while True:
|
while True:
|
||||||
instr = Instruction.disassemble(self.code)
|
instr = Instruction.disassemble(self.code)
|
||||||
@@ -254,6 +255,59 @@ class Child:
|
|||||||
for unlock in self.unlocks:
|
for unlock in self.unlocks:
|
||||||
locks[unlock] = (False, self)
|
locks[unlock] = (False, self)
|
||||||
|
|
||||||
|
|
||||||
|
def invert(self, desired):
|
||||||
|
instr = self.main_instr
|
||||||
|
op = instr.name
|
||||||
|
inputs = self.inputs
|
||||||
|
|
||||||
|
if len(inputs) == 0:
|
||||||
|
if op == 'push_m':
|
||||||
|
return desired
|
||||||
|
elif op == 'push32_i_i':
|
||||||
|
print(self.forced)
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
print(op)
|
||||||
|
|
||||||
|
elif len(inputs) == 1:
|
||||||
|
inp = inputs[0]
|
||||||
|
if op == "pop_m":
|
||||||
|
return inp.invert(desired)
|
||||||
|
if op == "not":
|
||||||
|
return inp.invert((~desired) % N)
|
||||||
|
else:
|
||||||
|
print(op)
|
||||||
|
else:
|
||||||
|
forced0 = inputs[0].forced
|
||||||
|
forced1 = inputs[1].forced
|
||||||
|
|
||||||
|
if not forced0 and not forced1:
|
||||||
|
return
|
||||||
|
|
||||||
|
forced_child = inputs[0] if forced0[0] else inputs[1]
|
||||||
|
unk_child = inputs[1] if forced0[0] else inputs[0]
|
||||||
|
|
||||||
|
if op == 'xor':
|
||||||
|
return unk_child.invert(desired ^ forced_child.forced[1])
|
||||||
|
elif op == 'sub':
|
||||||
|
if forced0:
|
||||||
|
return unk_child.invert((desired + forced_child.forced[1]) % N)
|
||||||
|
else:
|
||||||
|
return unk_child.invert((-desired + forced_child.forced[1]) % N)
|
||||||
|
elif op == 'add':
|
||||||
|
return unk_child.invert((desired - forced_child.forced[1]) % N)
|
||||||
|
elif op == 'and':
|
||||||
|
return unk_child.invert(desired & forced_child.forced[1])
|
||||||
|
elif op == 'or':
|
||||||
|
return unk_child.invert(desired | forced_child.forced[1])
|
||||||
|
elif op == 'mul':
|
||||||
|
return unk_child.invert(((desired) * inverse(forced_child.forced[1], N)) % N)
|
||||||
|
elif op == 'shl':
|
||||||
|
return unk_child.invert(((desired) * inverse(forced_child.forced[1], N)) % N)
|
||||||
|
else:
|
||||||
|
print(op)
|
||||||
|
|
||||||
def transpile(self, indent=0):
|
def transpile(self, indent=0):
|
||||||
code = "(\n"
|
code = "(\n"
|
||||||
indent += 4
|
indent += 4
|
||||||
|
|||||||