Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

Create Heap Memory Buffer Overflow Bug.c

Abdul Wahab Junaid2e52d194bdef
diff --git a/C Hacking Tools/Heap Memory Buffer Overflow Bug.c b/C Hacking Tools/Heap Memory Buffer Overflow Bug.c
new file mode 100644
index 0000000..1f572ff
--- /dev/null
+++ b/C Hacking Tools/Heap Memory Buffer Overflow Bug.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+int main(int argc, char *argv[])
+
+ {
+char *input = malloc (20);
+char *output = malloc (20);
+strcpy (output, "normal output");
+strcpy (input, argv[1]);
+
+printf ("input at %p: %s\n", input, input);
+printf ("output at %p: %s\n", output, output);
+
+printf("\n\n%s\n", output);
+}