⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 this is aes algorithm
💻 TXT
字号:
This distribution contains proof of concept utilities for capturingmemory dumps from Intel x86-based and AMD/Intel x86-64 based PCsystems. It turns out that many systems manufactured today exhibit RAMpersistence; that is, the contents of RAM survive for brief periodseven after it's been powered off. This phenomenon can be exploited forvarious purposes, both good and evil.RAM persistence can be exploited using both hardware and software mechanisms.One major drawback to hardware exploits is that they require a certainamount of specialized expertise and a willingness and/or opportunity todisassemble or possibly damage the system being exploited. With manysystems, there is no alternative to this, particularly with computersthat perform destructive memory tests or ECC scrubbing at startup. However,there are a surprising number of machines where the contents of RAM surviveundamaged well after the system BIOS or boot code has finished running,and these can be exploited much more easily using only software.Most PC systems available today support booting over the network usingPXE (the Preboot eXecution Environment) or from USB mass storagedevices. Systems with PXE support use DHCP to request an IP addressand can then use TFTP to download an initial bootstrap program. Thisprogram in turn can make use of PXE services to download additionalfiles from the network. This is possible because the PXE ROM alsoincludes a very simple UDP/IP implementation and an UNDI driver forthe underlying hardware: the presence of the UNDI driver in ROMeliminates the need for native driver support in the bootstrapprogram, which allows a single bootstrap loader image to run on anyPXE-enabled system.When booting from a USB device, the BIOS simply treats the attachedmass storage device (which can be a standard disk drive or a flashmemory stick) as a boot disk drive, allowing the system to be booted fromthe USB disk instead of the internal disk.The PXE MEMORY SCRAPER is a standalone program which is downloadedinto a target computer via PXE and uses PXE's networking capabilitiesto allow the target to be controlled by a remote utility. The utilitysends commands to the PXE scraper requesting it to transmit blocks ofthe target's memory over the network and then writes the blocks out todisk. This allows the remote utility to obtain a complete dump of thetarget's RAM, after which it sends another command telling the PXEscraper to reboot or shut down the target.The USB SCRAPER is a similar utility, but it dumps the contents of RAMto an attached disk device instead of to the network. The same USBstorage device used to hold the scraper itself is also used to containthe memory dump. The contents of the dump can be retrieved later usinga separate utility.Both scrapers are written mostly in C, with a few pieces written in i386or x86-64 assembly. The client side utilities are written entirely in Cand use either simple socket calls for communicating with the target, orstdio operations to read from the disk holding a captured memory dump.One of the challenges in implementing the scraper itself is that it needsto run in both protected mode and real mode at various times. The CPU mustrun in protected mode in order to access all 4GB of the address space.But the scraper needs to make calls to the BIOS and to PXE, both of whichcan only be done in real mode. (The PXE specification allows for aprotected mode API as well, however most PXE implementations don't seemto support one.) A similar problem exists with x86-64, but there one musttransition between real mode and 64-bit long mode instead.There are two ways to solve this problem: one is to use vm86 mode and theother is to briefly 'thunk' from protected mode or long mode to real modeand then back again. Using vm86 is required in order to safely executereal mode code in a protected mode OS environment, since it provides theability to prevent buggy or malicious real mode code from crashing theentire system. But the scrapers are implemented as a standalone programrather than an OS, so we can get away with using the thunking method instead,which is much simpler to use than vm86.The thunking scheme used here was originally inspired by the Mach OSbootloader, which was also briefly used on FreeBSD. (There came a pointduring FreeBSD development when the kernel would no longer fit in thelower 640K of RAM. The Mach loader used the protected/real mode thunkingtechnique to allow the kernel image to be loaded into upper memory whilestill providing access to the BIOS disk services.) While the processof switching an x86 CPU into protected mode is widely known, most softwarethat enters protected mode never leaves it again. (With the 80286processor, it was not actually possible to return to real mode withoutcompletely resetting the CPU).While switching back to real mode is not commonly done, it's not thatdifficult. In order to do it, the global descriptor table must beloaded with both 32-bit code and data descriptors and 16-bit codeand data descriptors. Returning to real mode is actually a two stageprocess. Software must first perform an intersegment jump in order toswitch to the 16-bit code segment, so that it enters 16 bit addressingmode. At that point, the segment selector registers can be set to selectthe 16-bit data segment and the PE bit in the CR0 register can be cleared.Finally, software must perform one more intersegment jump to GDT segment 0,which completes the transition back to real mode. From this point, softwarecan continue running in real mode, or switch the CPU back into protectedmode again if desired.For x86-64 systems, once we get into protected mode, we then also haveto switch to long mode. This also requires the use of paging, so pagetables are needed as well.One complication here is that the tools used to build the PXE scrapermust be capable of producing both real mode and protected mode code.The GNU C compiler always generates 32-bit protected mode assembly code,so any code written in C must execute in protected mode. Recent versionsof the GNU assembler can be switched between 16 bit real mode and32-bit protected mode code generation through the use of the .code16and .code32 assembler directives. While it's also possible to use thesedirectives from the C compiler (in conjunction with inline assembler),this mechanism is somewhat error prone, as well as unwieldy. For thisfor this reason, the PXE scraper is written such that the routines thatmust run in real mode are coded separately in assembler. This is limitedmainly to the routines that make calls to the BIOS and the pxe_call()function used to access the PXE UDP and UNDI APIs.For x86-64, a 64-bit version of the GNU assembler supports a .code64directive as well as .code32 and .code16, allowing long mode, protectedmode and real mode code to be combined. A 64-bit version of GCC willonly generate 64-bit code, however.Note that there are other tools available which could be used insteadof GCC/GAS, such as the Borland C compiler suite (which is now opensource). However, the GNU tools have one significant advantage over othertools, which is that they are readily available: if you already have aFreeBSD or Linux host, GCC and GAS are already installed. (For those whoinsist on using Windows, the Cygwin or MinGW GCC tools can be used tobuild the 32-bit versions of the scrapers too.)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -