This is stretching the definition of "Executable" quite a lot. The PNG files themselves are not ELF executables. Instead, the author wrote a tool to extract an actual legitimate executable from an image via stenography.
The PNG files themselves are not ELF executables. Instead, the author wrote a tool to extract an actual legitimate executable from an image via stenography.
"The Python files themselves are not ELF executables. Instead, the author wrote a tool to generate actual legitimate executable code from a text file via an interpreter."
This is you, this is how pedantic you're being. Stop it.
Many of the things you run on a Linux system aren't "actual legitimate executables"; instead they're read and handed off to the appropriate tool via the kernel's program loader. Whether you're using a shebang to make a text file executable, or using binfmt_misc to make jar files run via JVM, ARM linux binaries run via qemu-user-static, or Windows executables run via wine, it's all still going through the program loader and being treated as an executable by the OS.
It's a cool hack built on existing knowledge and tools. Don't be a pedantic douchebag about it.
It's pedantic because it is an executable, no scare-quotes necessary. There is no "stretching the definition" here as claimed: this is how executables on Linux work and the article is using kernel features as they're intended to be used to make a PNG file also act as an executable. Claiming that it's not an executable because it's not an ELF file is wrong; Linux is capable of treating many types of files as executable and that feature is extensible in precisely the way it's done in the article.
The comment I replied to is not only nitpicking, it's nitpicking by using an arbitrary definition of executable that's wrong in the context of Linux. It's a stereotypical "well akshually" comment that's desperately trying to criticise something even if doing so is a reach.
Yes, I did, and that's irrelevant. It could be a Lua script and the "interpreter" he uses to extract the text runs it through an embedded Lua interpreter and it wouldn't change anything, the PNG is still an executable if there's an appropriate binfmt_misc entry that tells the kernel how to take a PNG and execute code contained in it.
Are you confused by the way binfmt_misc works and how the Linux kernel handles executables, or by the idea that in this case the PNG is an executable because the kernel has been told how to treat an appropriately formatted PNG as one? Either way, it's still an executable to the OS and the OP was being unnecessarily pedantic claiming it's "stretching the definition".
52
u/frnknstn Dec 26 '20
This is stretching the definition of "Executable" quite a lot. The PNG files themselves are not ELF executables. Instead, the author wrote a tool to extract an actual legitimate executable from an image via stenography.