Friday, August 24, 2001
Polyglut Assembly Language Programming
The general idea behind an architecture spanning shellcode is trying to come up with a sequence of bytes that would execute a jump instruction on one architecture while executing a nop-like instruction on another architecture. That way we can branch to architecture specific code depending on the platform our code is running on.
Architecture Spanning Shellcode
I've been reading Phrack since the early 90s and I must say, the technical articles are getting better (but the publishing frequency could use some work). I've heard of polyglot programs, in which you attempt to write a single source file that can compile under multiple language compilers and/or assemblers. The trick to that is to find a combination of comments and statements to weed yourself to the appropriate code.
I've never heard of this being done, but it is an extention of the polyglot program idea—only here, you have to find a sequence of instructions that do nothing on one CPU while implementing a jump instruction for another CPU. And in this article, they manage to write common assembly code for the Intel x86, MIPS, Sparc and PCC CPUs. Very impressive.
Okay, so the goal is to write exploit code for multiple platforms, but as a purely intellectual exercise, it's pretty neat!