Nytro Posted May 15, 2012 Report Posted May 15, 2012 Hyperion: Implementation of a PE-CrypterChristian AmmannMay 8, 20121 IntroductionRuntime crypter accepts binary executable files as input and transforms them into anencrypted version (preserving its original behaviour). The encrypted file decrypts itselfon startup and executes it’s original content. This approach allows the deployment ofmalicious executables in protected environments: A pattern based anti virus (AV) solutiondetects the signature of suspicious files and blocks their execution. The encryptedcounterpart contains an unknown signature, it’s content can not be analysed by heuristicsand is therefore executed normally without an intervention by the AV scanner. Otheruses are protection of binaries against reversing or the replacement of the encryptionroutine with a packer to reduce the size of an executable.This paper reveals the theoretic aspects behind run-time crypters and describes a referenceimplementation for Portable Executables (PE) [1] which is the windows file formatfor dynamic-link libraries (DLLs), object files and regular executables. The encryption ofWindows executables requires a general understanding of the following aspects: PE layout: The PE header, section headers and data directory entries. PE loader: How and where are process images loaded and executed in virtualmemory.We give a beginner friendly introduction to these two important topics in section 2. Afterwards,we present and explain the PE crypter reference implementation Hyperion insection 3 for 32-bit executables which can be divided into two parts (see figure 1 for details):A crypter and a container. The crypter (which is explained in more detail in section3.1) gets a PE binary as input, copies the complete input file into memory, calculatesa checksum and prepends the checksum to the input file. Afterwards, a random key isgenerated which is used to encrypt the checksum and the input file with the AES-128[2] encryption algorithm. Finally, the encrypted result is copied into the containers datasection.Download:http://www.exploit-db.com/wp-content/themes/exploit/docs/18849.pdf Quote
giv Posted May 21, 2012 Report Posted May 21, 2012 Buna referinta.De regula crypterele functioneaza dupa o metoda simpla:Criptare:Imput data (necriptat)->Crypt routine (si optional pack)->crypted data Decriptare:Crypted data->Decrypt routine (care este exact inversul rutinei de criptare si optional despachetare daca s-a optat) -> Unencrypted dataIn ASM cea mai simpla metoda este cea de criptare este: XOR, target, sourceSpre xemplu: XOR EAX, EBXDEcriptarea este operatiunea inversa:XOR EBX, EAXVulnerabilitatea consta in faptul ca decriptarea se face in momentul rularii si un BP in memory pe Code section poate surprinde codul decriptat. Un dump de memorie dupa ce codul a fost decryptat este de regula suficient in cazul cryptarilor simpliste.... Quote