Shellcode
Shellcode, bytecode, or machine code is represented in hexadecimal. Every programming language eventually becomes binary. Assembly translates to binary machine code. When writing a buffer overflow there are many obstructions from network security, such as DEP, ASLR, firewalls, or SIMS.
This is just one of many shellcoding concepts. Ultimately, the most important concepts are anti-heuristics, shellcode obfuscation, and IDS/IPS/Firewall evasion. |
- Evading heuristics - evading debuggers, tricking the programmers, attacking debuggers, and evading/attacking virtual machines are all part of this technique. Anti-heuristics rely on the code's ability to protect itself from user, administrator, or even programmer and debugger intervention.
Obfuscation:
- "Uglifying" one's code - obfuscation includes utilization of polymorphism and metamorphism, and describes anything that makes the code appear to do one thing or hold certain data when in fact the code does something else or holds different data.
- Evading detection engines is currently best done by using alphanumeric shellcode. Alphanumeric and ascii shellcode appear within standard user-printable data, making your arbitrary code appear as standard user inputted data in stead of malicious machine code. Generally it is hard for an admin to detect that this is actually a payload to begin with.
Machine code is just as powerful as any other programming language. Machine code can be used by a programmer to write any application with an assembly approach.
Self-linking shellcode refers to machine code's ability to use what functions are already present in memory as opposed to carrying all of its functionality within itself. From a general perspective, a linker is comprised of two parts. One part of the linker must be able to isolate the base pointer of any given library loaded into memory, and the other part of the linker must be able to parse the library and return the memory address for the start of any given function. This happens through the export table of the binary.
This is called self-linking shellcode or self-linking machine code because it does not rely on being linked with any kernel, in stead it finds the functionality it needs within the run- time environment and calls already existing functions out of memory. This will save the programmer time and size, and potentially even allow the programmer to write a cross-OS machine code application that is fully capable of using pre-built-in functionality of the operating system by linking itself in stead of relying on an external linker to both link and format the binary properly. Everything is possible in the world of technology today, and so I wish you and your shellcoding the best of luck.