<div dir="ltr">There aren't actually trusted tools on the system to get the source from an ELF. There may be tools, but they are not trusted, because nobody uses them in their normal lives. Put 512 bytes in front of a TAR archive, with the "#! /bin/source_embedded\n" string at the start, and you are done. The interpreter just extracts and runs the executable from the first file in the archive. You can use "dd" to strip off the header and use the "tar" command, both of which you ARE familiar with, unlike some odd flag to a tool to extract an ELF segment.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 7, 2019 at 1:08 PM Karan, Cem F CIV USARMY CCDC ARL (USA) <<a href="mailto:cem.f.karan.civ@mail.mil">cem.f.karan.civ@mail.mil</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Bruce Perens <<a href="mailto:bruce@perens.com" target="_blank">bruce@perens.com</a>> wrote on Monday, October 7, 2019 3:52 PM:<br>
> Rather than do this, why not just make an existing <br>
> archive format executable? Just sticking #! and the <br>
> interpreter name at the front should be sufficient. <br>
> If you execute it, it extracts and runs a native <br>
> executable for your architecture, or one for any <br>
> interpreter such as the JVM. That can be the first <br>
> file. Then the rest of the files are the source.<br>
<br>
Yeah, but the advantage of having it in the ELF file is that you don't need to execute the file to get at the source; you use trusted tools you already have on your system. For the security conscious, you can do the following:<br>
- Download the untrusted binary<br>
- Mount the source portion of the ELF file using your trusted mounter<br>
- Inspect the code, and at your option:<br>
- Ignore the binary entirely, and compile from source<br>
- Compile from source, recalculate the checksum, and if the checksums don't match, start warning everyone you can find.<br>
<br>
SEAs require you to trust that the archive is not malicious.<br>
<br>
Thanks,<br>
Cem Karan<br>
<br>
---<br>
Other than quoted laws, regulations or officially published policies, the views expressed herein are not intended to be used as an authoritative state of the law nor do they reflect official positions of the U.S. Army, Department of Defense or U.S. Government.<br>
<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Bruce Perens - Partner, <a href="http://OSS.Capital" target="_blank">OSS.Capital</a>.</div></div></div></div>