Post on 10-Jan-2017
Integritätsschutz einerModularen Applikation
Rüdiger Kügler | Security ExpertRuediger.Kuegler@wibu.com
Wolfgang Völker | Director Product ManagementWolfgang.Voelker@wibu.com
AxProtector im DetailSpeaker 3
AxProtector im Detail: Integritätsschutz einer modularen Applikation 2
Einleitung
24.04.2014
Bedrohungen und Anforderungen für Software-Herstellerund Anwender
AxProtector im Detail: Integritätsschutz einer modularen Applikation 3
Bedrohungen und Anforderungen
24.04.2014
AnwenderSoftware-Hersteller
Kopierschutz
Mods
Cheats
Virus
Sabotage
Cheats
AxProtector im Detail: Integritätsschutz einer modularen Applikation 4
Authenticode
24.04.2014
Der Feind im eigenen Bett?
AxProtector im Detail: Integritätsschutz einer modularen Applikation 5
Ich signiere meine Anwendung mit Authenticode.Damit ist ein Cracker NICHT in der Lage meine Anwendung
zu verändern.
Richtig?
Die Frage
24.04.2014
Falsch?
AxProtector im Detail: Integritätsschutz einer modularen Applikation 9
Ich signiere meine Anwendung mit Authenticode.Damit ist ein Cracker NICHT in der Lage meine Anwendung
zu verändern.
Richtig?
Die Antwort
24.04.2014
Falsch?Falsch
AxProtector im Detail: Integritätsschutz einer modularen Applikation 11
Ich überprüfe die Authenticode Signatur in meiner eigenen Anwendung. Damit bin ich doch sicher.
Richtig?
Ja, aber …
24.04.2014
Falsch?
13
Die Schwachstelle
Software
WINTRUST.DLL
Dokumentierter API Aufruf
PatchenHooken
Überschreiben
24.04.2014 AxProtector im Detail: Integritätsschutz einer modularen Applikation
AxProtector im Detail: Integritätsschutz einer modularen Applikation 14
Überschreiben im Speicher
24.04.2014
var
lib: THandle;
p: Pointer;
old: Cardinal;
// Byte code for assembler
// xor eax, eax;
// ret
// (returns 0)
const
fake: array[0..2] of byte = ($31, $C0, $C3);
AxProtector im Detail: Integritätsschutz einer modularen Applikation 15
Überschreiben im Speicher
24.04.2014
begin
// Load Wintrust.dll
lib := LoadLibrary('WINTRUST.DLL');
if (lib <> 0) then begin
// Entry Point of WinVerifyTrust
p := GetProcAddress(lib, 'WinVerifyTrust');
if (p <> nil) then begin
// p is pointer to code of WinVerifyTrust
// in memory
AxProtector im Detail: Integritätsschutz einer modularen Applikation 16
Überschreiben im Speicher
24.04.2014
// Remove write protection
VirtualProtect(p, 3,
PAGE_EXECUTE_READWRITE, old);
// Apply patch
move(fake, P^, 3);
// Reset write protection
VirtualProtect(p, 3, old, old);
end;
end;
end;
Mythos entlarvt:
Sie können ausführbaren
Code im Speicher verändern!
AxProtector im Detail: Integritätsschutz einer modularen Applikation 17
Ich überprüfe die Authenticode Signatur in meiner eigenen Anwendung. Damit bin ich doch sicher.
Die Antwort ist wieder …
24.04.2014
Richtig? Falsch?Falsch
AxProtector im Detail: Integritätsschutz einer modularen Applikation 18
Zusammenfassung Authenticode
24.04.2014
AnwenderSoftware-Hersteller
Kopierschutz
Mods
Cheats
Virus
Sabotage
Cheats
AxProtector im Detail: Integritätsschutz einer modularen Applikation 19
Die Lösung
24.04.2014
Wibu Protection Suite
AxProtector im Detail: Integritätsschutz einer modularen Applikation 20
Funktionen der Wibu Protection Suite
24.04.2014
Software Authorization (Secure Load) Verhindert die Ausführung nicht freigegebener Software
Integrity Protection (Tamper Protection) Erkennt Veränderungen (im Speicher!) und reagiert
Automatic Protection (IP Protection) Schützt gegen Reverse Engineering und Raubkopien
Encryption on Method Level Erhöht den Schutzlevel
AxProtector im Detail: Integritätsschutz einer modularen Applikation 21
.NET
Stan
dard
Fram
ewor
k
Java
SE
Java
EE
Embe
dded
Ope
ratin
gSy
stem
s
OS
X
Win
dows
Desk
top
Linu
x
Wibu Protection Suite - Überblick
24.04.2014
Software Authorization(Secure Loader)
Encryption on Method Level
Integrity Protection(Tamper Protection)
Automatic Protection(IP Protection)
ExPr
otec
tor
AxPr
otec
tor
.NET
AxPr
otec
tor
Java
Wibu Protection Suite
AxProtector
IxProtector
AxProtector im Detail: Integritätsschutz einer modularen Applikation 24
AxProtector / IxProtector – Schutz-Prozess
24.04.2014
Prot
ecte
d Ex
ecut
able
/ Li
brar
y
Com
pile
d Ex
ecut
able
/ Li
brar
y
Header
Code Section
Header
EncryptedCode Section
AxEngine(Security Engine)
AxProtector
Definition von Lizenzen und
Modulen
Data Section EncryptedData Section
EncryptedResource SectionResource Section
AxProtector im Detail: Integritätsschutz einer modularen Applikation 25
AxProtector .NET – Ungeschütztes Assembly
24.04.2014
.NET Codekann einfach
Disassembliert werden
AxProtector im Detail: Integritätsschutz einer modularen Applikation 26
AxProtector .NET – Schutz-Prozess
24.04.2014
Prot
ecte
d As
sem
bly
Com
pile
d As
sem
bly
Header
Original Code
Header
Stub Code(Without Intellectual
Properties)
AxEngine(Security Engine)
Encrypted Code(Original Code with
Intellectual Properties)
AxProtector .NET
Definition von Lizenzen und
Modulen
Assembly hat die gleiche Struktur wie das originale
Assembly
AxProtector im Detail: Integritätsschutz einer modularen Applikation 27
AxProtector .NET – Geschütztes Assembly
24.04.2014
Code is verschlüsselt!
AxProtector im Detail: Integritätsschutz einer modularen Applikation 28
ExProtector – Schutz-Prozess
24.04.2014
Prot
ecte
d Ex
ecut
able
/ Li
brar
y
Orig
inal
Exe
cuta
ble
/ Lib
rary
Header
Original Code
Header
Encrypted Code
Credentials(Hash, Signature, …)
ExProtector
Schlüssel fürVerschlüsselung
und Signatur
AxProtector im Detail: Integritätsschutz einer modularen Applikation 29
ExProtector – Integration in den Loader
24.04.2014
Operating System
ExEngine(ExProtector Runtime)
CodeMeter Embedded Driver
Operating System(ohne Modifikation)
Engineering
Modified LoaderOriginal Loader
Root Public Key
AxProtector im Detail: Integritätsschutz einer modularen Applikation 30
Integrity Protection
24.04.2014
Grundlagen Kryptographie
Selbst-Prüfung
Überprüfung anderer Module
AxProtector im Detail: Integritätsschutz einer modularen Applikation 32
Executable + Hash
50 45 00 00 4C 01 09 00 19 5E 42 2A 00 00 00 0004 10 40 00 03 07 42 6F 6F 6C 65 61 6E 01 00 00 00 00 01 00 00 00 00 10 40 00 05 46 61 6C 73 65 04 54 72 75 65 8D 40 00 2C 10 40 00 02 04 43 68 61 72 01 00 00 00 00 FF 00 00 00 90 40 10 40 00 01 07 49 6E 74 65 67 65 72 04 00 00 00 80 FF FF FF 7F 8B C0 58 10 40 00 01 04 42 79 74 65 01 00 00 00 00 FF 00 00 00 90 6C 10 40 00 01 04 57 6F 72 64 03 00 00 00 00 FF FF 00 00 90 80 10 40 00 01 08 43 61 72 64 69 6E 61 6C 05 00 00 00 00 FF FF FF FF 90 98 10 40 00 0A 06 53 74 72 69 6E 67 EC 10 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EC 10 40 00 04 00 00 00 00 00 00 00 44 33 40 00 50 33 40 00 54 33 40 00 58 33 40 00 4C 33 40 00 94 30 40 00 B0 30 40 00 EC 30 40 00 07 54 4F 62 6A 65 63 74 F8 10 40 00 07 07 54 4F 62 6A 65 63
PE..L....^B*......@...Boolean...........@..False.True.@.,.@...Char.....ÿ....@.@...Integer.....ÿÿÿ..ÀX.@...Byte.....ÿ....l.@...Word.....ÿÿ.....@...Cardinal.....ÿÿÿÿ...@...Stringì.@.............................ì.@.........D3@.P3@.T3@.X3@.L3@..0@.°0@.ì0@..TObjectø.@...TObjec
04 33 C0 EB 02 B0 01 59 5A 5B C3 90 53 56 83 C4 F8 8B F2 8B D8 8B CC 8D 56 04 8B C3 E8 A3 F8 FF
.3Àë.°.YZ[Ã.SV.Äø.ò.Ø.Ì.V..Ãè£øÿ
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 33
Hash Funktionen
Vorteile Einfach zu implementieren
Schnell zur Laufzeit
Nachteile Ohne Salt kann jeder einen gültigen Hash erzeugen
Mit Salt muss ein Angreifer nur einmal den Salt-Wert extrahieren um einen gültigen Hash zu erzeugen
Ich kann nur einen Selbst-Prüfung machen
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 35
Signaturen
Data
PrivateKey
Hash (Digest)
Signature
Ja / NeinPublicKey
24.04.2014
Data
Hash (Digest)Signature
Signature
AxProtector im Detail: Integritätsschutz einer modularen Applikation 36
Executable + Hash + Signatur
50 45 00 00 4C 01 09 00 19 5E 42 2A 00 00 00 0004 10 40 00 03 07 42 6F 6F 6C 65 61 6E 01 00 00 00 00 01 00 00 00 00 10 40 00 05 46 61 6C 73 65 04 54 72 75 65 8D 40 00 2C 10 40 00 02 04 43 68 61 72 01 00 00 00 00 FF 00 00 00 90 40 10 40 00 01 07 49 6E 74 65 67 65 72 04 00 00 00 80 FF FF FF 7F 8B C0 58 10 40 00 01 04 42 79 74 65 01 00 00 00 00 FF 00 00 00 90 6C 10 40 00 01 04 57 6F 72 64 03 00 00 00 00 FF FF 00 00 90 80 10 40 00 01 08 43 61 72 64 69 6E 61 6C 05 00 00 00 00 FF FF FF FF 90 98 10 40 00 0A 06 53 74 72 69 6E 67 EC 10 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
PE..L....^B*......@...Boolean...........@..False.True.@.,.@...Char.....ÿ....@.@...Integer.....ÿÿÿ..ÀX.@...Byte.....ÿ....l.@...Word.....ÿÿ.....@...Cardinal.....ÿÿÿÿ...@...Stringì.@.............................
04 33 C0 EB 02 B0 01 59 5A 5B C3 90 53 56 83 C4 F8 8B F2 8B D8 8B CC 8D 56 04 8B C3 E8 A3 F8 FF
.3Àë.°.YZ[Ã.SV.Äø.ò.Ø.Ì.V..Ãè£øÿ
D8 8B CC 8D 56 04 8B C3 E8 A3 F8 FF FF 83 3C 24 00 74 0B 8B C4 E8 26 FF FF FF 84 C0 00 00 00 00EB 02 B0 01 59 5A 5E 5B C3 8D 40 02 33 D2 85 C0 79 03 83 C0 03 C1 F8 02 3D 10 04 30 00 00 00 00
Ø.Ì.V..Ãè£øÿÿ.<$.t..Äè&ÿÿÿ.À....ë.°.YZ^[Ã.@.3Ò.Ày..À.Áø.=.......
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 37
AxProtector – Schutz-Prozess
24.04.2014
Prot
ecte
d Ex
ecut
able
/ Li
brar
y
Com
pile
d Ex
ecut
able
/ Li
brar
y
Header
Code Section
Header
EncryptedCode Section
AxEngine(Security Engine + Public Key)
AxProtector
Definition von Lizenzen und
Modulen
Data Section EncryptedData Section
EncryptedResource SectionResource Section Public Key und
Private Key für Signatur
Signature
AxProtector im Detail: Integritätsschutz einer modularen Applikation 39
04 10 40 00 03 07 42 6F 6F 6C 65 61 6E 01 00 00 00 00 01 00 00 00 00 10 40 00 05 46 61 6C 73 65 04 54 72 75 65 8D 40 00 2C 10 40 00 02 04 43 68 61 72 01 00 00 00 00 FF 00 00 00 90 40 10 40 00 01 07 49 6E 74 65 67 65 72 04 00 00 00 80 FF FF FF 7F 8B C0 58 10 40 00 01 04 42 79 74 65 01 00 00 00 00 FF 00 00 00 90 6C 10 40 00 01 04 57 6F 72 64 03 00 00 00 00 FF FF 00 00 90 80 10 40 00 01 08 43 61 72 64 69 6E 61 6C 05 00 00 00 00 FF FF FF FF 90 98 10 40 00 0A 06 53 74 72 69 6E 67 EC 10 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
..@...Boolean...
........@..False
.True.@.,.@...Char.....ÿ....@.@...Integer.....ÿÿÿ..ÀX.@...Byte.....ÿ....l.@...Word.....ÿÿ.....@...Cardinal.....ÿÿÿÿ...@...Stringì.@.............................
Verschlüsseltes Executable + Hash + Signatur
50 45 00 00 4C 01 09 00 19 5E 42 2A 00 00 00 00 PE..L....^B*....
04 33 C0 EB 02 B0 01 59 5A 5B C3 90 53 56 83 C4 F8 8B F2 8B D8 8B CC 8D 56 04 8B C3 E8 A3 F8 FF
.3Àë.°.YZ[Ã.SV.Äø.ò.Ø.Ì.V..Ãè£øÿ
D8 8B CC 8D 56 04 8B C3 E8 A3 F8 FF FF 83 3C 24 00 74 0B 8B C4 E8 26 FF FF FF 84 C0 00 00 00 00EB 02 B0 01 59 5A 5E 5B C3 8D 40 02 33 D2 85 C0 79 03 83 C0 03 C1 F8 02 3D 10 04 30 00 00 00 00
Ø.Ì.V..Ãè£øÿÿ.<$.t..Äè&ÿÿÿ.À....ë.°.YZ^[Ã.@.3Ò.Ày..À.Áø.=.......
B2 22 E8 E1 CA 85 3E 24 C5 30 D8 4E 89 7A DC D1 59 16 4B 75 53 FC E6 7E 87 1B A8 10 9D 00 10 1D C7 15 2C AF 69 81 53 62 DE A6 F4 68 23 8F 20 45 49 6F F6 48 22 E7 B0 DA D1 4F 3E EF 39 FA FB 5D A2 59 D0 BD 1A A9 DD F4 67 44 DB 30 C1 B8 82 0C C3 FE 28 35 60 C3 50 46 4A 63 4C 37 EE BD 1D 4B A8 B9 DB C5 D3 AE C5 51 27 B6 7A 80 75 99 52 79 A4 35 9C B2 1E FA D3 DD 10 DD E0 F6 D6 B0 3B 41 E8 D1 D9 6D DD 1B 74 CB 82 63 82 0A F7 B3 0C 21 CF BD 5D 71 23 8F EF C4 4C F0 79 0E 42 AA 06 BF EA 5F E9 DC C5 2E 7E CC A2 3B 5D C3 F9 5F AC B2 89 59 E3 B0 0F E8 D0 58 D4 6E 7E 9C E2 C9 7A 65
²"èáÊ.>$Å0ØN.zÜÑY.KuSüæ~..¨.....Ç.,¯i.SbÞ¦ôh#..EIoöH"ç°ÚÑO>ï9úû]¢Yн.©ÝôgDÛ0Á¸..Ãþ(5`ÃPFJcL7î½.K¨¹ÛÅÓ®ÅQ'¶z.u.Ry¤5.².úÓÝ.ÝàöÖ°;AèÑÙmÝ.tË.c..÷³.!Ͻ]q#.ïÄLðy.Bª.¿ê_éÜÅ.~Ì¢;]Ãù_¬².Yã°.èÐXÔn~.âÉze
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 40
Selbst-Prüfung
Executable
Signature
ÜberprüfeSignatur
(Hash, Public Key, Signature)
Berechne Hash des Executable
Fehler
Yes
No
AxEngine(Security Engine + Public Key)
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 41
Überprüfung eines anderen Modules
Executable Dynamic Link Library
AxEngine(Security Engine + Public Key)
Signature
AxEngine(Security Engine + Public Key)
Signature
exe - exe
exe - dll
dll - dll
dll - exe
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 43
Demo
24.04.2014
Schutz-Prozess
Erfolgreiche Integritätsprüfung
Modifizierte Exe / Dll
AxProtector im Detail: Integritätsschutz einer modularen Applikation 44
Zusammenfassung
24.04.2014
AxProtector im Detail: Integritätsschutz einer modularen Applikation 45
Authenticode
24.04.2014
Authenticode
DLL
DLL
DLL
EXE
DLL
DLL
Ein zentraler Punkt der
angegriffen werden kann
AxProtector im Detail: Integritätsschutz einer modularen Applikation 46
AxProtector
24.04.2014
DLL
DLL
DLL
EXE
DLL
DLL
AxProtector im Detail: Integritätsschutz einer modularen Applikation 47
AxProtector – Integrity Protection
24.04.2014
Einfach zu integrieren Sicherheit für Software-Hersteller und Anwender Kein zentraler Punkt für einen Angriff durch den Cracker Jedes Modul (Exe / Dll) kann auch separat aktualisiert werden
AxProtector im Detail: Integritätsschutz einer modularen Applikation 48
Sicherheit für Software-Hersteller und Anwender
24.04.2014
AnwenderSoftware-Hersteller
Kopierschutz
Mods
Cheats
Virus (Authenticode)
Sabotage
Cheats
AxProtector im Detail: Integritätsschutz einer modularen Applikation 49
Vielen Dank
24.04.2014
WIBU-SYSTEMS AG
www.wibu.com