a novel obfusca on class hierarchy fla9ening
play

A Novel Obfusca/on: Class Hierarchy Fla9ening Christophe - PowerPoint PPT Presentation

A Novel Obfusca/on: Class Hierarchy Fla9ening Christophe Foket, Bjorn De Su9er, Bart Coppens & Koen De Bosschere Computer Systems Lab Ghent


  1. A ¡Novel ¡Obfusca/on: ¡ Class ¡Hierarchy ¡Fla9ening ¡ Christophe ¡Foket, ¡Bjorn ¡De ¡Su9er, ¡ ¡ Bart ¡Coppens ¡& ¡Koen ¡De ¡Bosschere ¡ ¡ Computer ¡Systems ¡Lab ¡ Ghent ¡University, ¡Belgium ¡ ¡ FPS ¡2012 ¡ October ¡26, ¡2012 ¡

  2. Outline ¡ • Bytecode ¡obfusca/on ¡ • Class ¡hierarchy ¡fla9ening ¡ • Evalua/on ¡ • Conclusions ¡ 2 ¡

  3. Bytecode ¡is ¡vulnerable ¡ Binary ¡soQware ¡ 3 ¡

  4. Bytecode ¡is ¡vulnerable ¡ Bytecode ¡soQware ¡ Binary ¡soQware ¡ 4 ¡

  5. Bytecode ¡obfusca/on ¡ Bytecode ¡soQware ¡ Goal ¡ Goal ¡ an/-­‑reverse ¡ an/-­‑code ¡liQing ¡ engineering ¡ an/-­‑code ¡injec/on ¡ 5 ¡

  6. Bytecode ¡obfusca/on ¡ Bytecode ¡soQware ¡ Goal ¡ Goal ¡ an/-­‑reverse ¡ an/-­‑code ¡liQing ¡ engineering ¡ an/-­‑code ¡injec/on ¡ remove ¡inheritance ¡ rela/ons ¡between ¡classes ¡ 6 ¡

  7. Class ¡hierarchy ¡fla9ening ¡ Example ¡ class ¡Main ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡ShapeWindow ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡Circle ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡Rectangle ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(c); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(r); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:paint>(); ¡ ¡ ¡ ¡ ¡c.<Circle:draw>(); ¡ ¡ ¡ ¡ ¡r.<Rectangle:draw>(); ¡ ¡ ¡} ¡ } ¡ 7 ¡

  8. Class ¡hierarchy ¡fla9ening ¡ Example ¡ class ¡Main ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡ Common ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡ Common ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡ Common ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.< Common :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common :draw>(); ¡ ¡ ¡} ¡ } ¡ 8 ¡

  9. Class ¡hierarchy ¡fla9ening ¡ Step ¡1: ¡subtree ¡selec/on ¡ class ¡Main ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡ShapeWindow ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡Circle ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡Rectangle ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(c); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(r); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:paint>(); ¡ ¡ ¡ ¡ ¡c.<Circle:draw>(); ¡ ¡ ¡ ¡ ¡r.<Rectangle:draw>(); ¡ ¡ ¡} ¡ } ¡ 9 ¡

  10. Class ¡hierarchy ¡fla9ening ¡ Step ¡2: ¡interface ¡inser/on ¡ • one ¡interface ¡per ¡subtree ¡ • acts ¡as ¡a ¡common ¡super ¡type ¡ • declares ¡all ¡instance ¡methods ¡ ¡ declared ¡in ¡all ¡classes ¡of ¡the ¡ ¡ subtree ¡ ¡ 10 ¡

  11. Class ¡hierarchy ¡fla9ening ¡ Step ¡3: ¡subtree ¡type ¡abstrac/on ¡ class ¡Main ¡implements ¡Common3 ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡ShapeWindow ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡Circle ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡Rectangle ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(c); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:add>(r); ¡ ¡ ¡ ¡ ¡w.<ShapeWindow:paint>(); ¡ ¡ ¡ ¡ ¡c.<Circle:draw>(); ¡ ¡ ¡ ¡ ¡r.<Rectangle:draw>(); ¡ ¡ ¡} ¡ } ¡ 11 ¡

  12. Class ¡hierarchy ¡fla9ening ¡ Step ¡3: ¡subtree ¡type ¡abstrac/on ¡ class ¡Main ¡implements ¡Common3 ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡Common2 ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡Common1 ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡Common1 ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common2 :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common1 :draw>(); ¡ ¡ ¡} ¡ } ¡ 12 ¡

  13. Class ¡hierarchy ¡fla9ening ¡ Step ¡4: ¡subtree ¡fla9ening ¡ • recursively ¡traverse ¡each ¡subtree ¡ • copy ¡to ¡each ¡direct ¡subclass ¡ – instance ¡fields ¡ – instance ¡methods ¡ – implemented ¡interfaces ¡ • update ¡super ¡calls ¡ • update ¡field ¡accesses ¡ • move ¡up ¡subclass ¡ in ¡the ¡hierarchy ¡ • add ¡dummy ¡ ¡ methods ¡ ¡ 13 ¡

  14. Class ¡hierarchy ¡fla9ening ¡ Step ¡5: ¡interface ¡merging ¡ class ¡Main ¡implements ¡Common3 ¡{ ¡ class ¡Main ¡implements ¡Common3 ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡Common2 ¡w ¡= ¡new ¡ShapeWindow(…); ¡// ¡w ¡can ¡hold ¡objects ¡of ¡2 ¡types ¡ ¡ ¡ ¡ ¡Common2 ¡w ¡= ¡new ¡ShapeWindow(…); ¡ ¡ ¡ ¡ ¡Common1 ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡ ¡// ¡c ¡can ¡hold ¡objects ¡of ¡3 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡Common1 ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡// ¡r ¡can ¡hold ¡objects ¡of ¡3 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common2 :paint>(); ¡ ¡ ¡ ¡ ¡w.< Common2 :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡c.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common1 :draw>(); ¡ ¡ ¡} ¡ ¡ ¡} ¡ } ¡ } ¡ 14 ¡

  15. Class ¡hierarchy ¡fla9ening ¡ Step ¡5: ¡interface ¡merging ¡ class ¡Main ¡implements ¡Common ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡Common ¡w ¡= ¡new ¡ShapeWindow(…); ¡// ¡w ¡can ¡hold ¡objects ¡of ¡ 6 ¡types ¡ ¡ ¡ ¡ ¡Common ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡ ¡// ¡c ¡can ¡hold ¡objects ¡of ¡ 6 ¡types ¡ ¡ ¡ ¡ ¡Common ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡// ¡r ¡can ¡hold ¡objects ¡of ¡ 6 ¡types ¡ ¡ ¡ ¡ ¡w.< Common :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common :draw>(); ¡ ¡ ¡} ¡ } ¡ 16 ¡dummy ¡methods ¡ 15 ¡

  16. Class ¡hierarchy ¡fla9ening ¡ Step ¡5: ¡interface ¡merging ¡ class ¡Main ¡implements ¡Common3 ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡Common2 ¡w ¡= ¡new ¡ShapeWindow(…); ¡// ¡w ¡can ¡hold ¡objects ¡of ¡2 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡ ¡// ¡c ¡can ¡hold ¡objects ¡of ¡3 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡// ¡r ¡can ¡hold ¡objects ¡of ¡3 ¡types ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common2 :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common1 :draw>(); ¡ ¡ ¡} ¡ } ¡ 16 ¡

  17. Class ¡hierarchy ¡fla9ening ¡ Step ¡5: ¡interface ¡merging ¡ class ¡Main ¡implements ¡Common2 ¡{ ¡ ¡ ¡void ¡main(){ ¡ ¡ ¡ ¡ ¡Common2 ¡w ¡= ¡new ¡ShapeWindow(…); ¡// ¡w ¡can ¡hold ¡objects ¡of ¡ 3 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡c ¡= ¡new ¡Circle(…); ¡ ¡ ¡ ¡ ¡ ¡// ¡c ¡can ¡hold ¡objects ¡of ¡ 3 ¡types ¡ ¡ ¡ ¡ ¡Common1 ¡r ¡= ¡new ¡Rectangle(…); ¡ ¡ ¡// ¡r ¡can ¡hold ¡objects ¡of ¡ 3 ¡types ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(c); ¡ ¡ ¡ ¡ ¡w.< Common2 :add>(r); ¡ ¡ ¡ ¡ ¡w.< Common2 :paint>(); ¡ ¡ ¡ ¡ ¡c.< Common1 :draw>(); ¡ ¡ ¡ ¡ ¡r.< Common1 :draw>(); ¡ ¡ ¡} ¡ } ¡ 5 ¡dummy ¡methods ¡ 17 ¡

  18. Outline ¡ • Bytecode ¡obfusca/on ¡ • Class ¡hierarchy ¡fla9ening ¡ • Evalua/on ¡ • Conclusions ¡ 18 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend