A Ovest Di Paperino

Welcome to the dark side.

Il nuovo che avanza: cosa c'e' di bello in Windows Vista

Wikipedia vi ci ha dedicato una pagina intera.
Il blog di coding horror spiega nei dettagli come funziona SuperFetch (ovvero perche` non c'e' piu' memoria in Vista).

Qual'e' la mia feature preferita? Il miglioramento della security.

Tralascio l'UAC (ora un amministratore ricevera' dei popup ogni volta che speciali permessi sono richiesti), cito e commento da wikipedia:

A number of specific improvements have been made:

  • ... 
  • Session 0 Isolation: Previous versions of Windows ran System services in the same login session as the locally logged-in user (Session 0). In Windows Vista, Session 0 is now reserved for these services, and all interactive logins are done in other sessions. This is intended to help mitigate a class of exploits of the Windows message-passing system, known as Shatter attacks.

Con tale supporto sara' molto piu' difficile per un processo in sessione interattiva (i.e. tutto quello che puo' praticamente essere scaricato coscientemente o meno via internet) interagire con servizi di sistema.

...

Windows Vista uses Address Space Layout Randomization (ASLR) to load system files at random addresses in memory. By default, all system files are loaded randomly at any of the possible 256 locations. Other executables have to specifically set a bit in the header of the PE file, which is the file format for Windows executables to use ASLR. For such executables, the stack and heap allocated is randomly decided. By loading system files at random addresses, it becomes harder for malicious code to know where privileged system functions are located, thereby making it unlikely for them to predictably use them. This helps prevent most remote execution attacks by preventing Return-to-libc attacks.

Tutti i file di sistema verranno caricati in 256 possibili combinazioni diverse. Cioe' il file di sistema non avra' piu' come indirizzo base 0x0000 ma un valore qualsiasi tra 0 e 255. Questo rendera` la vita impossibile agli exploit che fanno uso di chiamate di sistema.

The Portable Executable format has been updated to support embedding of exception handler address in the header. Whenever an exception is thrown, the address of the handler is verified with the one stored in the executable header. If they match, the exception is handled, otherwise it indicates that the run-time stack has been compromised, and hence the process is terminated.

Con questa feature, un'intera classe di exploits basati sulla modifica degli exception handler viene resa molto piu' difficile. Il processo ostico ora deve non solo modificare l'exception handler in memoria ma anche quello su disco: considerando che tale controllo viene fatto prima che il controllo venga passato all'exception handlre, la vita per questo tipo di exploit diventa molto piu' dura.

Function pointers are obfuscated by XOR-ing with a random number, so that the actual address pointed to is hard to retrieve. So would be to manually change a pointer, as the obfuscation key used for the pointer would be very hard to retrieve. Thus, it is made hard for any unauthorized user of the function pointer to be able to actually use it. Also metadata for heap blocks are XOR-ed with random numbers. In addition, check-sums for heap blocks are maintained, which is used to detect unauthorized changes and heap corruption. Whenever a heap corruption is detected, the application is killed to prevent successful completion of the exploit.

Questo limita di parecchio una serie di exploit basati sul meccanismo del callback. Se un pezzo di codice maligno riusciva ad ottenere la registrazione di una callback, in precedenza riceveva un puntatore reale alla funzione di callback passata. Ora il puntatore non e' piu' reale ma offuscato quindi puo' essere utilizzato solo per chiamare la funzione di callback senza possibilita' di sapere dove tale funzione risiede.

Windows Vista binaries include intrinsic support for detection of stack-overflow. When a stack overflow in Windows Vista binaries is detected, the process is killed so that it cannot be used to carry on the exploit.

Questa tecnica, ereditata sin da XP SP2 ma estesa a tutti gli eseguibili di sistema, e' descritta in dettaglio in questa pagina. Si basa sull'introduzione - da parte del codice di prologo ad una chiamata - sullo stack di un valore casuale (chiamato canary) che viene controllato dalla parte di codice che si occupa dell'epilogo della chiamata. Se il valore e' stato modificato, si e' in presenza di un exploit e quindi il processo viene semplicemente ucciso.

Also Windows Vista binaries place buffers higher in memory and non buffers, like pointers and supplied parameters, in lower memory area. So to actually exploit, a buffer underrun is needed to gain access to those locations. However, buffer underruns are much less common than buffer overruns.

Questa e' una novita' di Vista. Scambiando la posizione tra buffer e puntatori in memoria un exploit basato su buffer overrun deve essere convertito in un buffer underrun per essere eseguito e questo tipo di exploit e' molto piu' difficile da creare.

Windows Vista also uses processor-enforced Data Execution Prevention on all processes to mark some memory pages as non-executable data segments (like the heap and stack), and subsequently any data is prevented from being interpreted and executed as code. This prevents exploit code from being injected as data and then executed. Though DEP was present in Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1, its enforcement has been made stricter in Windows Vista.

Infine con Vista il DEP hardware, ovvero il cosiddetto flag NX usato nella tabella delle pagine, sara' applicato in maniera piu' aggressiva.

Enjoy!