summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2024-10-01 10:39:52 +0000
committerjerome <jerome@xlinfo.fr>2024-10-01 10:39:52 +0000
commitab03754617b30c830ce3d0324da7ef6b6887094e (patch)
tree30548ac628920de76aa025289b4d4259e0361300 /elf
parentd12802d6a94e22ef5a606b743f3d8f45384347ad (diff)
downloadforensic-ab03754617b30c830ce3d0324da7ef6b6887094e.tar.gz
forensic-ab03754617b30c830ce3d0324da7ef6b6887094e.zip
bufferflow.c
Diffstat (limited to 'elf')
-rw-r--r--elf/bufferflow.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/elf/bufferflow.c b/elf/bufferflow.c
new file mode 100644
index 0000000..924c3ae
--- /dev/null
+++ b/elf/bufferflow.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(void)
+{
+ int pass=0;
+ char buff[10];
+
+ printf("\nDonne le mot de passe pour avoir le flag : \n");
+ scanf("%s",buff);
+
+ if(!strcmp(buff,"s3cr3t"))
+ {
+ pass = 1;
+ }
+
+ if(pass)
+ {
+ printf ("\nBien joué !\nVoilà ton flag\n");
+ }
+ else
+ {
+ printf("\nMauvais mot de passe.\nBye\n");
+ }
+
+ return 0;
+}
+