diff options
author | dev0 <matzeton@googlemail.com> | 2012-01-30 16:10:35 +0100 |
---|---|---|
committer | dev0 <matzeton@googlemail.com> | 2012-01-30 16:10:35 +0100 |
commit | 8d64f054048f6402dedbaef11ea5d0f7bd8d530f (patch) | |
tree | 87595d67270dc83ac4781a3815a743ded628b183 /overflow.c |
first commit
Diffstat (limited to 'overflow.c')
-rw-r--r-- | overflow.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/overflow.c b/overflow.c new file mode 100644 index 0000000..de2a1ab --- /dev/null +++ b/overflow.c @@ -0,0 +1,34 @@ +/* + * overflow.c + * + * Created on: 27.01.2012 + * Author: druid + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#define ENV_VAR "EXPLOIT" +#define BUFLEN 256 + +u_char buf[BUFLEN]; +u_char *env; + +int +main() +{ + if (env = getenv(ENV_VAR)) + { + fprintf(stderr, "env: "ENV_VAR" set\n"); + fprintf(stderr, "env: %s\n", env); + + strcpy(buf, env); + } + else + { + fprintf(stderr, "env: "ENV_VAR" not set, abort!\n"); + } + + return 0; +} |