Skip to content

Instantly share code, notes, and snippets.

View procinger's full-sized avatar
👻

Adam Hukalowicz procinger

👻
View GitHub Profile
@procinger
procinger / shell_exec.c
Last active June 18, 2023 00:27
GNU/Linux x86_64 Hello World Shellcode
/*
* Shellcode executer
* gcc -fno-stack-protector -z execstack shell.c -o shell
*/
char shellcode[] = "\xeb\x20\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\xb0\x01\x40\xb7\x01\x5e\xb2\x0c\x0f\x05\x48\x31\xc0\xb0\x3c\x40\xb7\x00\x0f\x05\xe8\xdb\xff\xff\xff\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21";
int main(int argc, char **argv)
{
int (*exeshell)();