Down to the Bare Metal: Using Pro­ces­sor Fea­tures for Bi­na­ry Ana­ly­sis

Cars­ten Wil­lems, Ralf Hund, Amit Va­su­de­van, An­dre­as Fo­bi­an, Den­nis Felsch, Thors­ten Holz

An­nual Com­pu­ter Se­cu­ri­ty Ap­p­li­ca­ti­ons Con­fe­rence (ACSAC), Or­lan­do, FL, De­cem­ber 2012


Ab­stract

A de­tai­led un­der­stan­ding of the be­ha­vi­or of ex­ploits and ma­li­cious soft­ware is ne­cessa­ry to ob­tain a com­pre­hen­si­ve over­view of vul­nerabi­li­ties in ope­ra­ting sys­tems or cli­ent ap­p­li­ca­ti­ons, and to de­ve­lop pro­tec­tion tech­ni­ques and tools. To this end, a lot of re­se­arch has been done in the last few years on bi­na­ry ana­ly­sis tech­ni­ques to ef­fi­ci­ent­ly and pre­cise­ly ana­ly­ze code. Most of the com­mon ana­ly­sis frame­works are based on soft­ware emu­la­tors since such tools offer a fi ne-grained con­trol over the exe­cu­ti­on of a given pro­gram. Na­tu­ral­ly, this leads to an arms race where the at­ta­ckers are con­stant­ly se­ar­ching for new me­thods to de­tect such ana­ly­sis frame­works in order to suc­cess­ful­ly evade ana­ly­sis.

In this paper, we focus on two as­pects. As a first cont­ri­bu­ti­on, we in­tro­du­ce se­ver­al novel me­cha­nis­ms by which an at­ta­cker can de­lu­de an emu­la­tor. In con­trast to exis­ting de­tec­tion ap­proa­ches that per­form a de­di­ca­ted test on the en­vi­ron­ment and com­bi­ne the test with an ex­pli­cit con­di­tio­nal branch, our de­tec­tion me­cha­nis­ms in­tro­du­ce code se­quen­ces that have an im­pli­cit­ly dif­fe­rent be­ha­vi­or on a na­ti­ve ma­chi­ne when com­pa­red to an emu­la­tor. Such dif­fe­ren­ces in be­ha­vi­or are cau­sed by the si­de-ef­fects of the par­ti­cu­lar ope­ra­ti­ons and im­per­fec­tions in the emu­la­ti­on pro­cess that can­not be miti­ga­ted ea­si­ly. Mo­ti­va­ted by these fin­ding, we in­tro­du­ce a novel ap­proach to ge­ne­ra­te exe­cu­ti­on tra­ces. We pro­po­se to uti­li­ze the pro­ces­sor its­elf to ge­ne­ra­te such tra­ces. Mores pre­cise­ly, we pro­po­se to use a hard­ware fea­ture cal­led branch tra­cing avail­able on com­mo­di­ty x86 pro­ces­sors in which the log of all bran­ches taken du­ring code exe­cu­ti­on is ge­ne­ra­ted di­rect­ly by the pro­ces­sor. Ef­fec­tive­ly, the log­ging is thus per­for­med at the lo­west level pos­si­ble. We eva­lua­te the prac­tical via­bi­li­ty of this ap­proach.

[pdf]

Tags: ana­ly­sis, Mal­wa­re