B l a c k B
- x
Lightweight Security Monitoring for COTS Binaries
Byron Hawkins and Brian Demsky
University of California, Irvine, USA
Michael B. Taylor
University of California, San Diego, USA
B l a c k B o x Lightweight Security Monitoring for COTS - - PowerPoint PPT Presentation
B l a c k B o x Lightweight Security Monitoring for COTS Binaries Byron Hawkins and Brian Demsky University of California, Irvine, USA Michael B. Taylor University of California, San Diego, USA Why Security Monitoring? Motjvatjon #1:
Byron Hawkins and Brian Demsky
University of California, Irvine, USA
Michael B. Taylor
University of California, San Diego, USA
x 7 f f f f f f f d 4 1 8 a r g # 2 : * *
t i
_
t x 7 f f f f f f f d a e 7 a r g # 1 : * i n p u t x 1 l
a l # 2 : i x 7 7 2 d 6 e 6 f 6 9 7 4 7 6 f l
a l # 1 : b u f f e r x 6 1 7 6 6 e 6 9 2 d 6 8 7 4 6 9 < p r e v i
s s t a c k f r a m e b a s e > x 7 5 6 c 6 1 7 6 2 d 6 4 6 9 6 c < r e t u r n a d d r e s s > A d v e r s a r y c
t r
s t h e p r
r a m !
x 7 f f f f f f f d 4 1 8 a r g # 2 : * *
t i
_
t x 7 f f f f f f f d a e 7 a r g # 1 : * i n p u t x 1 l
a l # 2 : i x 7 7 2 d 6 e 6 f 6 9 7 4 7 6 f l
a l # 1 : b u f f e r x 6 1 7 6 6 e 6 9 2 d 6 8 7 4 6 9 < p r e v i
s s t a c k f r a m e b a s e > x 7 5 6 c 6 1 7 6 2 d 6 4 6 9 6 c < r e t u r n a d d r e s s > A d v e r s a r y c
t r
s t h e p r
r a m !
x 7 f f f f f f f d 4 1 8 a r g # 2 : * *
t i
_
t x 7 f f f f f f f d a e 7 a r g # 1 : * i n p u t x 1 l
a l # 2 : i x 7 7 2 d 6 e 6 f 6 9 7 4 7 6 f l
a l # 1 : b u f f e r x 6 1 7 6 6 e 6 9 2 d 6 8 7 4 6 9 < p r e v i
s s t a c k f r a m e b a s e > x 7 5 6 c 6 1 7 6 2 d 6 4 6 9 6 c < r e t u r n a d d r e s s > A d v e r s a r y c
t r
s t h e p r
r a m !
x 7 f f f f f f f d 4 1 8 a r g # 2 : * *
t i
_
t x 7 f f f f f f f d a e 7 a r g # 1 : * i n p u t x 1 l
a l # 2 : i x 7 7 2 d 6 e 6 f 6 9 7 4 7 6 f l
a l # 1 : b u f f e r x 6 1 7 6 6 e 6 9 2 d 6 8 7 4 6 9 < p r e v i
s s t a c k f r a m e b a s e > x 7 5 6 c 6 1 7 6 2 d 6 4 6 9 6 c < r e t u r n a d d r e s s > A d v e r s a r y c
t r
s t h e p r
r a m !
x 7 f f f f f f f d 4 1 8 a r g # 2 : * *
t i
_
t x 7 f f f f f f f d a e 7 a r g # 1 : * i n p u t x 1 l
a l # 2 : i x 7 7 2 d 6 e 6 f 6 9 7 4 7 6 f l
a l # 1 : b u f f e r x 6 1 7 6 6 e 6 9 2 d 6 8 7 4 6 9 < p r e v i
s s t a c k f r a m e b a s e > x 7 5 6 c 6 1 7 6 2 d 6 4 6 9 6 c < r e t u r n a d d r e s s > A d v e r s a r y c
t r
s t h e p r
r a m !
ipcsecproc.dll
DGC
56 basic blocks
code generator
ipcsecproc.dll
DGC
56 basic blocks create fake stack frame
Call Stack
ipcsecproc.dll
DGC
56 basic blocks
Call Stack
"incorrect" return
ipcsecproc.dll
DGC
56 basic blocks
Call Stack
"incorrect" return
ipcsecproc.dll
DGC
56 basic blocks
"incorrect" return
VirtualProtect() DeviceIoControl() CreateFile() Kernel32.dll CryptUnprotectData() Crypt32.dll
D W O R D y
r A p p P r
e s s I d = G e t P r
e s s B y N a m e ( " Y
r A p p . e x e " ) ;
D W O R D y
r A p p P r
e s s I d = G e t P r
e s s B y N a m e ( " Y
r A p p . e x e " ) ; H A N D L E y
r A p p P r
e s s = O p e n P r
e s s ( P R O C E S S _ A L L _ A C C E S S , y
r A p p P r
e s s I d ) ;
D W O R D y
r A p p P r
e s s I d = G e t P r
e s s B y N a m e ( " Y
r A p p . e x e " ) ; H A N D L E y
r A p p P r
e s s = O p e n P r
e s s ( P R O C E S S _ A L L _ A C C E S S , y
r A p p P r
e s s I d ) ; H M O D U L E k e r n e l 3 2 = G e t M
u l e H a n d l e ( " k e r n e l 3 2 . d l l " ) ;
D W O R D y
r A p p P r
e s s I d = G e t P r
e s s B y N a m e ( " Y
r A p p . e x e " ) ; H A N D L E y
r A p p P r
e s s = O p e n P r
e s s ( P R O C E S S _ A L L _ A C C E S S , y
r A p p P r
e s s I d ) ; H M O D U L E k e r n e l 3 2 = G e t M
u l e H a n d l e ( " k e r n e l 3 2 . d l l " ) ; L P T H R E A D _ S T A R T _ R O U T I N E l
d L i b r a r y = G e t P r
A d d r e s s ( k e r n e l 3 2 , " L
d L i b r a r y A " ) ;
D W O R D y
r A p p P r
e s s I d = G e t P r
e s s B y N a m e ( " Y
r A p p . e x e " ) ; H A N D L E y
r A p p P r
e s s = O p e n P r
e s s ( P R O C E S S _ A L L _ A C C E S S , y
r A p p P r
e s s I d ) ; H M O D U L E k e r n e l 3 2 = G e t M
u l e H a n d l e ( " k e r n e l 3 2 . d l l " ) ; L P T H R E A D _ S T A R T _ R O U T I N E l
d L i b r a r y = G e t P r
A d d r e s s ( k e r n e l 3 2 , " L
d L i b r a r y A " ) ; H A N D L E h T h r e a d = C r e a t e R e m
e T h r e a d ( y
r A p p P r
e s s , l
d L i b r a r y , m y M a l w a r e D l l P a t h ) ;
Next call to foo() will not log A → C → D → E again.
Microsofu Offjce JScript9 Adobe PDF Reader JScript9, ShockwaveFlash Chrome V8, PepperFlash
Microsofu Offjce JScript9 Adobe PDF Reader JScript9, ShockwaveFlash Chrome V8, PepperFlash
R a n k E v e n t
R a n k E v e n t
R a n k E v e n t
R a n k E v e n t
Problem: Return address points to F on the left.
Correlate indirect branch targets via hashtable.
Hot paths are compiled into traces (10% speedup).
Program All Branches Binary Translatjon Trusted Profjle Chrome 485,251,278,660 6,137,106 7 Adobe PDF 34,075,711,128 2,292,342 4 Word 603,491,452,236 580,655 24 PowerPoint 251,845,377,624 1,335,817 50 Excel 198,427,776,372 561,401 28 Outlook 547,678,615,056 615,708 4 SciTE 61,325,719,872 124,013 33 pldfmatex 23,504,352,560 64,290 43 Notepad++ 129,695,545,404 589,155 24 Adrenalin 48,881,533,212 791,847 603 mp3info 2,080,031,200 4,339,200 3