Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <unistd.h>
- void overflow(char *source) {
- char buf[128];
- strcpy(buf, source);
- printf("Buf: %s\n", buf);
- }
- int main(int argc, char **argv) {
- setuid(0);
- printf("Arg: %s\n", argv[1]);
- overflow(argv[1]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement