advanced-exploitation-techniques-x86 / ret2txt / ret2txt.c
ret2txt.c
Raw
#include<stdio.h>
#include<string.h>
void public(char * args){
	char buff[12];
	strcpy(buff,args);
	printf("public\n");
}
void secret(void){
	printf("secret\n");
}
int main(int argc, char* argv[]){
	if(getuid()==0) secret();
	else public(argv[1]);
}