It’s a simple x86 shellcode to call /bin/sh, but the first thing is understand how the sys_execve works, to do so you can access this site that gives to you a list with all the x86 syscalls, and the values you need to put in each register, just search for sys_execve.
The initial code bellow have all the comments to make it easy to understand how to use the sys_execve,
Just to test this code, lets compile it, link and execute the binary shell to get the /bin/sh
But this code is not nullbyte free and it’s a problem when we are working with shellcodes, so with some work I got this code,
To confirm if my code is free of nullbytes, I can use this site defuse.ca, that translate asm instructions to opcodes, and now I have a shellcode free of nullbytes with 25 bytes.