Russian translation - https://vk.com/wall-212294020_22
Why partition is neccessary for your application security?
First of all, let's define what partition is and what does it stand for. PZMutator provides you an option called binary partition, with this option enabled your binary will require you to allocate several memory regions for your application instead of just one, thus the binary will be mapped on these regions: each region contains only a single page (4096 bytes) of real data (functions, pointers, constants etc), you can fill the region with random junk bytes to confuse attackers but it's up to you.
From the attacker perspective dumping your application will look like this: firstly, he needs to find all of the memory regions that your application uses; secondly, he needs to save all of these regions to binary files (note that your application may contain more than hundreds of regions depending on its real size); finally, attacker should make a database in any of dissasemblers by combining the regions to begin static analysis.
Instead of just finding region with your application and dumping it, mutated binaries with partition are much harder to dump and analyze.
We highly recommend you to turn on partition option for your project.
What is partition verification?
As you may know there's an address space in any application that is reserved for system modules only and in our case the deal is ntdll.dll. Let's get deeper into it.
First of all, we need to be aware of the algorithm of process creation: when process is spawned in usermode and main (and not any other) thread hasn't been launched yet, there's some memory regions which are reserved: the lowest region is your application's PE itself and the highest is ntdll.dll, if your application is running under x64 Windows there will be some more dlls in 64-bit space like ntdll.dll (x64), wow64.dll, wow64cpu.dll and some others...
The most known and common dump launching (cracking) technique is to break an application when it launches and allocate memory region with any (dump) base, this approach doesn't require attacker to find and manually fix all of the relocs (which is nearly impossible itself with the mutator).
To prevent your application dumps from being simply mapped into address space we've added an option which called partition verification in the mutator. With this option enabled mutator will require your clients to allocate memory regions for some of the fragments on extremely high address space. In the request with mapper data there will be additional field (int) in json object called "high_pages", this field contains the number of regions which have to be allocated with base higher than 0x77000000, to achieve this you should scan all memory starting from 0x77000000 and find spaces with no mapped modules there (1 page cave is enough for each region). Partition verification option will check if there's enough pages allocated on high memory and if not (e.g., attacker patched an application to prevent memory from allocating that high), mapping process will be aborted.
To enable both partition and partition validation you need to set these options to true in SDK while initializing the mutator.
pzm::instance->set_option< bool >( pzm::option_t::OPTION_PARTITION, true ); pzm::instance->set_option< bool >( pzm::option_t::OPTION_PARTITION_VALIDATE, true );Still need assistance and security advice? Contact us - pzm322.com
10 نوامبر 2022, 08:07
