• Hardening ELF files

    This post describes meth­ods to transform/obfuscate/minimize Lin­ux ELF files. sstrip The sec­tions are used for debug­ging and not nec­ces­sary for a pro­gram’s exe­cu­tion. The com­mand sstrip removes all sec­tions from the file. sstrip bin.elf After the com­mand, it can be ver­i­fied with readelf --sections bin.elf that there are not sec­tions are in the file.

  • Concepts A seg­ment is a piece of a infor­ma­tion which is mapped into the mem­o­ry (of a process). A ELF bina­ry can have zero or mul­ti­ple seg­ments. It defines also where the OS should put it into the mem­o­ry. Each seg­ment has a Pro­gram Head­er which describes the sec­tions within. A sec­tion is a dis­tinc­tive…