-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
156 changed files
with
6,868 additions
and
1 deletion.
There are no files selected for viewing
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,14 @@ | ||
/* wyn: whats your name program v1 */ | ||
|
||
#include <stdio.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
char buffer[10] = {0}; /* create a 10 byte buffer */ | ||
printf("What's your name?\n"); | ||
read(STDIN_FILENO, buffer, 10); /* read 10 bytes from STDIN(0) into our buffer array */ | ||
printf("Hello %s\n", buffer); /* print the buffer */ | ||
|
||
return 0; | ||
} |
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,14 @@ | ||
/* wyn2: whats your name program v2 */ | ||
|
||
#include <stdio.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
char buffer[10] = {0}; /* create a 10 byte buffer */ | ||
printf("What's your name?\n"); | ||
read(STDIN_FILENO, buffer, 100); /* read 10 bytes from STDIN(0) into our buffer array */ | ||
printf("Hello %s\n", buffer); /* print the buffer */ | ||
|
||
return 0; | ||
} |
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,6 @@ | ||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
printf("Hello World!\n"); | ||
} |
Binary file not shown.
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,7 @@ | ||
#include <windows.h> | ||
|
||
int main() | ||
{ | ||
MessageBox(0, "Hello World!", "a simple PE executable", 0); | ||
ExitProcess(0); | ||
} |
Binary file not shown.
Binary file not shown.
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,15 @@ | ||
int foo(int a, int b, int c) | ||
{ | ||
int x; | ||
int y; | ||
int z; | ||
|
||
x=y=z=0; | ||
z=x+y+a+b+c; | ||
return z; | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
foo(1,2,3); | ||
} |
Binary file not shown.
Binary file added
BIN
+994 KB
0x03 - Extended Reverse Engineering Lab/challenges/ELF-Walkthrough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,33 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <stdlib.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
int local_18; | ||
char *param_1; | ||
unsigned int local_14; | ||
|
||
if (argc != 2) { | ||
printf("%s <lastname>\n", argv[0]); | ||
exit(-1); | ||
} | ||
|
||
param_1 = argv[1]; | ||
|
||
/* recreated algorithm from Ghidra */ | ||
local_14 = (param_1[3] ^ 0x1337U) + 0x5eeded; | ||
local_18 = 0; | ||
|
||
while (local_18 < strlen(param_1)) | ||
{ | ||
if (param_1[local_18] < ' ') | ||
return 1; | ||
|
||
local_14 = local_14 + (param_1[local_18] ^ local_14) % 0x539; | ||
local_18 = local_18 + 1; | ||
} | ||
printf("%d\n", local_14); | ||
|
||
return 0; | ||
} |
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,20 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#define EAX 0x12 | ||
|
||
int main() | ||
{ | ||
int c; | ||
char str[]= "Q}|u`sfg~sf{}|a3"; | ||
|
||
for (int i = 0; i < 0x10; i++) { | ||
c = str[i]; | ||
printf("XOR %c,0x%x = %c\n", | ||
c, | ||
EAX, // EAX after SUB EDX,EAX; MOV EAX, EDX | ||
(c^EAX) // XOR CHAR BYTE, EAX | ||
); | ||
} | ||
} |
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,20 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if(argc != 2) | ||
{ | ||
printf("You gave %d arguments, which is not 1\n", argc-1); | ||
return 1; | ||
} | ||
printf("Your input as a string: \'%s\'\n", argv[1]); | ||
printf("The first 4 bytes of your input as characters: \'%c%c%c%c\'\n", argv[1][0], argv[1][1], argv[1][2], argv[1][3]); | ||
printf("The first 4 bytes of your input as hex bytes: 0x%02x%02x%02x%02x\n", (unsigned char)argv[1][0], (unsigned char)argv[1][1], (unsigned char)argv[1][2], (unsigned char)argv[1][3]); | ||
int* i = (int*)(argv[1]); | ||
printf("The first 4 bytes of your input interpreted as an integer: %d\n", *i); | ||
unsigned int* j = (unsigned int*)(argv[1]); | ||
printf("The first 4 bytes of your input interpreted as an unsigned integer: %u\n", *j); | ||
|
||
return 0; | ||
} |
Binary file not shown.
Binary file added
BIN
+17.6 KB
...ction to Memory Corruption/intro_to_memory_corruption/0-overflow_example/overflow_example
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
...ion to Memory Corruption/intro_to_memory_corruption/0-overflow_example/overflow_example.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,21 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
int value = 5; | ||
char buffer_one[8], buffer_two[8]; | ||
|
||
strcpy(buffer_one, "one"); /* put "one" into buffer_one */ | ||
strcpy(buffer_two, "two"); /* put "two" into buffer_two */ | ||
|
||
printf("[BEFORE] buffer_two is at %p and contains \'%s\'\n", buffer_two, buffer_two); | ||
printf("[BEFORE] buffer_one is at %p and contains \'%s\'\n", buffer_one, buffer_one); | ||
printf("[BEFORE] value is at %p and is %d (0x%08x)\n", &value, value, value); | ||
|
||
printf("\n[STRCPY] copying %d bytes into buffer_two\n\n", strlen(argv[1])); | ||
strcpy(buffer_two, argv[1]); /* copy first argument into buffer_two */ | ||
|
||
printf("[AFTER] buffer_two is at %p and contains \'%s\'\n", buffer_two, buffer_two); | ||
printf("[AFTER] buffer_one is at %p and contains \'%s\'\n", buffer_one, buffer_one); | ||
printf("[AFTER] value is at %p and is %d (0x%08x)\n", &value, value, value); | ||
} |
Binary file added
BIN
+17.7 KB
...ntroduction to Memory Corruption/intro_to_memory_corruption/1-auth_overflow/auth_overflow
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
...roduction to Memory Corruption/intro_to_memory_corruption/1-auth_overflow/auth_overflow.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,32 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int check_authentication(char *password) { | ||
int auth_flag = 0; | ||
char password_buffer[16]; | ||
|
||
strcpy(password_buffer, password); | ||
|
||
if(strcmp(password_buffer, "brillig") == 0) | ||
auth_flag = 1; | ||
if(strcmp(password_buffer, "outgrabe") == 0) | ||
auth_flag = 1; | ||
|
||
return auth_flag; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
if(argc < 2) { | ||
printf("Usage: %s <password>\n", argv[0]); | ||
exit(0); | ||
} | ||
if(check_authentication(argv[1])) { | ||
printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); | ||
printf(" Access Granted.\n"); | ||
printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); | ||
} else { | ||
printf("\nAccess Denied.\n"); | ||
} | ||
} | ||
|
Binary file added
BIN
+17.5 KB
...roduction to Memory Corruption/intro_to_memory_corruption/2-arg_input_echo/arg_input_echo
Binary file not shown.
20 changes: 20 additions & 0 deletions
20
...duction to Memory Corruption/intro_to_memory_corruption/2-arg_input_echo/arg_input_echo.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,20 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if(argc != 2) | ||
{ | ||
printf("You gave %d arguments, which is not 1\n", argc-1); | ||
return 1; | ||
} | ||
printf("Your input as a string: \'%s\'\n", argv[1]); | ||
printf("The first 4 bytes of your input as characters: \'%c%c%c%c\'\n", argv[1][0], argv[1][1], argv[1][2], argv[1][3]); | ||
printf("The first 4 bytes of your input as hex bytes: 0x%02x%02x%02x%02x\n", (unsigned char)argv[1][0], (unsigned char)argv[1][1], (unsigned char)argv[1][2], (unsigned char)argv[1][3]); | ||
int* i = (int*)(argv[1]); | ||
printf("The first 4 bytes of your input interpreted as an integer: %d\n", *i); | ||
unsigned int* j = (unsigned int*)(argv[1]); | ||
printf("The first 4 bytes of your input interpreted as an unsigned integer: %u\n", *j); | ||
|
||
return 0; | ||
} |
11 changes: 11 additions & 0 deletions
11
...- Introduction to Memory Corruption/intro_to_memory_corruption/2-arg_input_echo/table.txt
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,11 @@ | ||
+---------------------------------------+ | ||
| command (ALL OUTPUT ABCD) | | ||
+---------------------------------------+ | ||
| echo -ne "\x41\x42\x43\x44" | | ||
+---------------------------------------+ | ||
| printf '\x41\x42\x43\x44' | | ||
+---------------------------------------+ | ||
| python -c 'print "\x41\x42\x43\x44"' | | ||
+---------------------------------------+ | ||
| perl -e 'print "\x41\x42\x43\x44";' | | ||
+---------------------------------------+ |
Binary file added
BIN
+17.7 KB
...roduction to Memory Corruption/intro_to_memory_corruption/3-auth_overflow2/auth_overflow2
Binary file not shown.
32 changes: 32 additions & 0 deletions
32
...duction to Memory Corruption/intro_to_memory_corruption/3-auth_overflow2/auth_overflow2.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,32 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int check_authentication(char *password) { | ||
char password_buffer[16]; | ||
int auth_flag = 0; | ||
|
||
strcpy(password_buffer, password); | ||
|
||
if(strcmp(password_buffer, "brillig") == 0) | ||
auth_flag = 1; | ||
if(strcmp(password_buffer, "outgrabe") == 0) | ||
auth_flag = 1; | ||
|
||
return auth_flag; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
if(argc < 2) { | ||
printf("Usage: %s <password>\n", argv[0]); | ||
exit(0); | ||
} | ||
if(check_authentication(argv[1])) { | ||
printf("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); | ||
printf(" Access Granted.\n"); | ||
printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"); | ||
} else { | ||
printf("\nAccess Denied.\n"); | ||
} | ||
} | ||
|
Binary file added
BIN
+19.1 KB
0x05 - Introduction to Memory Corruption/intro_to_memory_corruption/3-auth_overflow2/test
Binary file not shown.
Binary file added
BIN
+30.2 KB
...roduction to Memory Corruption/intro_to_memory_corruption/4-game_of_chance/game_of_chance
Binary file not shown.
Oops, something went wrong.