Vista Security Uberblick
Anonymous Benedikt
endlich sicher vor dem Bundestrojaner oder was?
Ubersicht
- (U)ser (A)ccount (C)ontrol
- Compiler-Voodoo
- GS Cookie
- (A)ddress (S)pace (L)ayout (R)andomisation
- Windows DDK
- PatchGuard
User Privilegien Grundlagen
- Objektbasiertes Ressourcenmanagement
- Access Tokens
- Priviledge Lists
(U)ser (A)ccount (C)ontrol
- Administrator < root
- Jetzt alle Systemdienste Level 0
- Keine Fenster-Attacken
- => Sudo von Microsoft
Compiler Voodoo
void SomeFunc() {
// do something
}
typedef void (*FUNC_PTR )(void);
int DangerousFunc(char *szString) {
char buf[32];
strcpy(buf,szString);
FUNC_PTR fp = (FUNC_PTR)(&SomeFunc);
// Other code
(*fp)();
return 0;
}
Compiler Voodoo
0x00000000
0xFFFFFFFF
Compiler Voodoo
PVOID Encode/DecodePointer(
PVOID Ptr
);
PVOID Encode/DecodeSystemPointer(
PVOID Ptr
);
Noch mehr Compiler Voodoo
- Parameter validation (_set_invalid_parameter_handler)
- Secure Template Overloads
- "Sichere" C-Library
GS Cookie die erste
- Programm muss mit \GS Flag gebaut werden
- Zufallswert(MasterCookie) zwischen lokalen Puffern und wichtigen StackWerten
- MasterCookie initialisierung beim Programmstart (__security_init_cookie)
- pruefen vor Ruecksprung(__security_cookie)
- stoppen wenn der Cookie modifiziert wurde(__security_error_handler)
- nicht wenig Overhead, deshalb...
GS Cookie die zweite
Kein Schutz wenn:
- die Optimierungsoption 0 aktiviert ist.
- keine Puffer auf dem Stack der Funktion ist.
- die naked Option in C++ verwendet wurde.
- die Funktion eine variable Argumentenliste besitzt.
- die Funktion mit inline assembly beginnt.
- der Compiler denkt das die Variablen nur in nicht warscheinlicher Art und Weise exploitbar sind.
- ein Puffer mit der Groesse <5 vorhanden ist (danke Ollie)
GS Internals
Wie der MasterCookie generiert wird:
Cookie = SystemTimeHigh
Cookie ^= SystemTimeLow
Cookie ^= ProcessId
Cookie ^= ThreadId
Cookie ^= TickCount
Cookie ^= PerformanceCounterHigh
Cookie ^= PerformanceCounterLow
GS Internals
Funktions Prolog:
mov eax, __security_cookie
xor eax, ebp
mov [ebp+2A8h+var_4], eax
Funktions Epilog:
mov ecx, [ebp+2A8h+var_4]
xor ecx, ebp
pop esi
call __security_check_cookie
__security_check_cookie:
cmp ecx, __security_cookie
jnz short loc_406355
rep retn
loc_406355:
jmp __report_gsfailure
GS Cookie die dritte
noch mehr von Ollie
- Mastercookie Werte sind zufaellig
- Mastercookie-Ort bei ASLR 8-Bit Entropie aber...
- teilweise ungleiche Verteilung =>Angriff!!!!
GS Cookie Adressverteilung
Vista auf nativer Hardware, ohne Reboot, 15.000 runs
GS Cookie Adressverteilung
Vista auf nativer Hardware, mit Reboot, 10.000 runs
GS Cookie Adressverteilung
Vista im VMWare Server auf XP64, ohne Reboot, 15.000 runs
GS Cookie Adressverteilung
Vista im VMWare Server auf XP64, ohne Reboot, 15.000 runs
"Windows Vista ASLR is a technology that makes exploitation of a vulnerability a statistical problem"
Exception-Handling a hackers dream
PREfast
"Windows Vista ASLR is a technology that makes exploitation of a vulnerability a statistical problem"
Static Driver Verifier - Finding Driver Bugs at Compile-Time
"Windows Vista ASLR is a technology that makes exploitation of a vulnerability a statistical problem"
Driver Verifier
"Windows Vista ASLR is a technology that makes exploitation of a vulnerability a statistical problem"
teh END
AWSUM THX!!
KTHXBYE