forked from open-education-hub/binary-security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d21544
commit 24ba698
Showing
15 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+8.54 KB
.../binary-analysis/executables-and-processes/drills/05-challenge-print-flag/src/get_message
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+2.77 KB
...ry-analysis/executables-and-processes/drills/06-challenge-matryoshka/sol/do_xor_encrypt.o
Binary file not shown.
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
...ters/binary-analysis/executables-and-processes/drills/06-challenge-matryoshka/sol/inner.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
static const unsigned char key[] = "I laugh in the face of danger"; | ||
static const unsigned char enc_msg[] = { 0x1a, 0x73, 0x3f, 0x3e, 0x36, 0x33, 0x2e, 0x5b, 0x00, 0x00, 0x7f, 0x07, 0x18, 0x04, 0x43, 0x03, 0x3e, 0x0d, 0x0a, 0x7f, 0x00, 0x08, 0x45, 0x3b, 0x02, 0x0f, 0x09, 0x3a, 0x1a, 0x2c, 0x41, 0x1e, 0x3e, 0x0c, 0x08, 0x1d, 0x7f, 0x0b, 0x0b, 0x4c, 0x17, 0x00, 0x18, 0x2a, }; | ||
|
||
static void xor_encrypt(const unsigned char *in, unsigned char *out, | ||
size_t len, const unsigned char *key, size_t key_len) | ||
{ | ||
size_t i; | ||
|
||
for (i = 0; i < len; i++) | ||
out[i] = in[i] ^ key[i % key_len]; | ||
} | ||
|
||
int main(void) | ||
{ | ||
unsigned char *dec_msg; | ||
|
||
dec_msg = calloc(sizeof(enc_msg) + 1, sizeof(enc_msg[0])); | ||
|
||
xor_encrypt(enc_msg, dec_msg, sizeof(enc_msg) / sizeof(enc_msg[0]), | ||
key, strlen((const char *) key)); | ||
|
||
printf("Flag is: %s\n", dec_msg); | ||
|
||
return 0; | ||
} |
Binary file added
BIN
+1.86 KB
...ters/binary-analysis/executables-and-processes/drills/06-challenge-matryoshka/sol/inner.o
Binary file not shown.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...binary-analysis/executables-and-processes/drills/06-challenge-matryoshka/sol/matryoshka.c
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...binary-analysis/executables-and-processes/drills/06-challenge-matryoshka/sol/matryoshka.o
Binary file not shown.
File renamed without changes.
Binary file added
BIN
+27.6 KB
...s/binary-analysis/executables-and-processes/drills/06-challenge-matryoshka/src/matryoshka
Binary file not shown.