Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[HELP]Turn executable into shellcode

I used c++ to compile my payload and now I have an executable file.From here how do I turn this into shellcode.

Answers are appreciated! :p
A shellcode is a result of opcode such as \xcd\x80 in hexadecimal and int 0x80 (system call) in assembly. If you want to execute a shellcode code through a binary that contains a vulnerabilty such as buffer overflow you have to write you code in assembly language then extract these opcodes without any nullbytes that means you have to know the basics of assembly to play with the different size of register.

Amazing video series : http://www.securitytube.net/groups?opera...&groupId=4

I hope you understand what i meant, i'm french.
(Dec 23, 2012 04:33 AM)Illicit Wrote:  I used c++ to compile my payload and now I have an executable file.From here how do I turn this into shellcode.

Answers are appreciated! :p

You can get opcode using some tools like objdump. There are some restriction if you write your shellcode in C . For example the variable in C which is in section .data in ASM and should not followed by shellcode. The shellcode should be within section .text . For example :

section .text
global _start
_start:
mov al,0x1 ;not eax since it is 32bytes wheres 0x01 is not.

In my opinion you should write your shellcode in ASM (Perhaps not that hard if you keep your shellcode small and always should be).

How many lines in your C sources and perhaps talking with system calls?
Ethical Hacker For Hire!
Slap your code into a dll file and use some pre-made staged shellcode bro...
Thanks guys :P I found a way before I read this though lawl.
Im using objdump btw.
You have in your signature a guide you wrote called a beginners guide to shellcoding and you're here asking about how to write shellcode....

420 yolo swag.
Doesn't metasploit have a feature that can do this for you?


Possibly Related Threads...
Thread / Author Replies Views Last Post
by ĐĮΜĘOct 23, 2023 04:55 AM 2 254 Oct 23, 2023 04:55 AM
Last Post: Tentco
by ĐĮΜĘFeb 6, 2023 02:45 PM 0 150 Feb 6, 2023 02:45 PM
Last Post: ĐĮΜĘ
by ĐĮΜĘJul 24, 2021 12:18 AM 9 607 Jul 24, 2021 12:18 AM
Last Post: ĐĮΜĘ