Is it possible to have a (small) shellcode with unique bytes only?

So far I noticed the smallest shellcode I can find online is 19 bytes for Linux x86, but it does repeat bytes, especially the "/" from "/bin/sh" and even some opcodes contain repeating bytes. Noticed a nice trick on x86_64 where you can

mov rax, 0xFF978CD091969DD1 ; garbage at first look
neg rax                     ; rax = /bin/sh

But still some bytes from the opcodes repeat. Does anyone know a solution for either x86 or x86_64?

| improve this question | | | | |

Came up with this in the mean time which respects the conditions and is quite short:

mov rbx, 0x68732f6e696221
or r8b, 0xe
add rbx, r8
push rbx    
push rsp
pop rdi
mov al, 0x3b
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.