Skip to content

Instantly share code, notes, and snippets.

@mikla
Created March 24, 2017 12:01
Show Gist options
  • Select an option

  • Save mikla/ec8759c49731e639ab447c04fe257620 to your computer and use it in GitHub Desktop.

Select an option

Save mikla/ec8759c49731e639ab447c04fe257620 to your computer and use it in GitHub Desktop.
#include <string.h>
#include <stdio.h>
void func(char *arg1) {
int authenticated = 0;
char buffer[4];
strcpy(buffer, arg1);
if (authenticated) {
printf("Authenticated via buffer overflow");
}
}
void main() {
char *mystr1 = "AuthMe!";
func(mystr1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment