I ran file
on some Linux malware ELF files that I've acquired over the last
couple of years. I noticed some oddities:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.0.0, not stripped
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.15, not stripped
ERROR: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linkederror reading (Invalid argument)
ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, stripped
One ELF file has an entry point of 0xc07068, but it's some kind of "packer", the unpacked executable (a Kaiten botnet executable) is at the usual entry point.
The "ERROR" noted above is from an ELF file with PHeaders, but not SHeaders. The "section headers" have been carefully mangled so as not to be readable by any program that believes in ELF headers The ELF loader in Linux kernels only reads the PHeaders, so that file can be executed.
My question is: who compiles this way, and how? I mean, Linux 2.0.0 was released 12-Jun-1996 according to kernel.org. An executable for Linux 2.0.0 might or might not be very portable, but how would you keep an ancient system for compiling malware running? It's not impossible to get an executable's entry point at some arbitrary address, but you do have to go out of your way, just like you'd have to go out of your way to mangle an executable's SHeaders.