Esempio n. 1
0
int main(int argc, char **argv){
    char buf[128];

    be_nice_to_people();

    read(0, buf, 128);

    ((function_ptr)buf)();
}
Esempio n. 2
0
int main(int argc, char **argv)
{
	char buf[128];

	be_nice_to_people();
	read(0, buf, 128);

	func_ptr func = (func_ptr) buf;
	func();

	return 0;
}
Esempio n. 3
0
int main(int argc, char **argv){
    int length;
    be_nice_to_people();

    puts("How long is your name?");
    scanf("%d", &length);

    if(length < BUFSIZE) //don't allow buffer overflow
        greet(length);
    else
        puts("Length was too long!");
}
Esempio n. 4
0
int main(int argc, char **argv)
{
	if (argc != 2)
	{
		printf("Usage: art_of_the_shell [str]\n");
		return 1;
	}

	be_nice_to_people();
	vuln(argv[1]);

	return 0;
}
Esempio n. 5
0
int main(int argc, const char **argv) {
    be_nice_to_people();
    char buf[80];
    bzero(buf, sizeof(buf));
    int k = read(STDIN_FILENO, buf, 80);
    printf(buf);
    printf("%d!\n", x); 
    if (x == 4) {
        printf("running sh...\n");
        system("/bin/sh");
    }
    return 0;
}
Esempio n. 6
0
int main(int argc, const char **argv) {
    be_nice_to_people();
    char buf[100];

  if(argc == 1) {
    errx(1, "please specify an argument\n");
  }

    memset(buf, '\0', sizeof(buf));
    memcpy(buf, argv[1], sizeof(buf)); 
    printf(buf);

    /* Call the exit function */
    (*exitFunc)(); 

    return 0;
}
Esempio n. 7
0
int main(int argc, char **argv){
    be_nice_to_people();
    if(argc > 1)
        vuln(argv[1]);
    return 0;
}
Esempio n. 8
0
int main(int argc, char** argv) {
        be_nice_to_people();
	vulnerable_function();
	write(STDOUT_FILENO, "Hello, World\n", 13);
}