Attacker wrote:This is no malware,
Would the defendant like to change their plea? To quote from the (auto-translated) article this code is originally from:
Hacker Magazine, December 2008 wrote:One of the main directions in the "battle of wits" between the authors of computer viruses and anti-virus programs is associated with the placement of the body of the virus in the RAM. At first glance, everything is trite: the task of the virus is to hide so that they do not find it, the task of the antivirus is to find it.
In the course of the evolution of technologies used both for writing malicious programs and for countering them, quite non-trivial solutions have appeared. The field of activity has long been not limited to the memory management mechanisms that are part of the operating system.
Today, in order to be "at the level", authors, both viruses and antiviruses need an understanding of the principles of program interaction and equipment, such as working with the configuration registers of the chipset, Model-Specific Processor Registers (MSR), the use of memory areas that have special status in terms of memory controller (SMRAM, Shadow, etc.).
The author of this article is not a virologist, much less a "virus writer", but works in the field of hardware and system software development. Therefore, the proposed material is prepared as information about a potential vulnerability, which makes it possible for the virus to "hide" in a non-trivial way. It's about using "shadow" memory or Shadow RAM and representing the virus in the status of the part of the executable BIOS block.
As the article itself states, that code will work
only on the circa 2006 model of motherboard it was written for (
Gigabyte GA-8i915PL-G with an Intel 915 chipset), on which it disables shadow RAM security features. I am pretty sure you didn't notice that part, assuming you even read the article rather than getting the code third- or fourth-hand from some other script kiddie.
Oh, and look, you didn't get this part of it either:
Hacker Magazine wrote: Immediately we mention that it's not about modifying the contents of the BIOS ROM (Flash ROM), but about modifying the area of RAM (Shadow RAM), where the contents of ROM BIOS are overwritten during the working session. Therefore, we are not talking about the failure of the motherboard here.
Ooooops. Someone told you some fibs, I think. A nice match for those you've told here...
Attacker wrote: is only for educacional purposes.
Education for what? There are
no legitimate uses for flashing a PC's BIOS with anything except the code the manufacturer provides. For that matter, there are damn few
illegitimate ones, really. I am not sure what you mean to learn, other than how to brick a PC.
In any case, writing a BIOS for hardware you didn't have a hand in designing yourself is a fool's errand, as we've explained countless times to others here. Writing a BIOS requires detailed knowledge of the motherboard hardware, and the information in question is a) mostly specific to the exact model of motherboard, meaning the BIOS written based on it won't run on any other mobo, and b) usually proprietary, and thus unavailable to anyone other than the manufacturer.
(Well, them, or anyone willing to commit the money, time, resources, and expertise to spend 2+ years reverse engineering it, a task which involves an oscilloscope, de-soldering wick, datasheets for every IC on the board, and maybe a scanning electron microscope.)
There are a handful of SBCs that use (mostly) open-source hardware (and at least one MIPS/Loongson-based laptop from China, the
Lemote 3A, but good luck finding one of those anywhere outside of the PRC if you aren't Richard Stallman), for which one might conceivably have the necessary information; I don't know of even a single stock x86 PC motherboard for which that is the case.
Note also that Flash devices, even ones not used for emulating disks, are generally block devices due to the nature of
NAND flash memory - you can't just insert a snippet of code, you have to write a whole section out, overwriting whatever was there. The less common NOR flash memory can read by bytes, but still erases and writes
en bloc. On most mobos flashing the BIOS is an all-or-nothing deal - anything in the flash memory prior to re-flashing is
gone, no backsies.
But all that is beside the point, because the code is very definitely malware and nothing but (while it was published as an experimental process, it was done with the understanding that it was part of a pentest to show a vulnerability - one specific to the now twelve-year-old hardware being tested), and you have been caught dead to rights.