SlideShare a Scribd company logo
The JAR
of Joy
SensePost - 2010
`whoami`
•  SensePost
•  ian@sensepost.com
– Break some stuff
– Write reports about breaking some stuff
– Abuse the staff
SensePost - 2010
Why This Talk ?
•  import disclaimer;
•  Not ground breaking stuff – no 0-day
•  Java applications and applets
appear to be popular again
•  Reversing Java applications can be
difficult
•  Tips for reversing Java in less time
(in my experience in any case)…
SensePost - 2010
The JAR File
•  Java ARchive
•  Used to distribute Java applications /
applets etc.
•  ZIP file containing compiled classes,
libraries, settings, certificates, *
•  Trivial to extract
•  Normally disclose a vast amount of
information
SensePost - 2010
Attacking Java is fun
•  Trivial to reverse engineer
•  Compiled applications are vulnerable
to virtually all attacks traditional web
apps are vulnerable to…
•  …but all wrapped up in increased
sense of developer smugness
•  Repurposed Java applications make
*awesome* attack tools
SensePost - 2010
Difficulties Attacking Java
•  Many classes and libraries in JAR files of
complex applications
•  Class files often do not decompile cleanly
•  Impossible to fix all java sources in large
application
•  Applets and applications are frequently
signed
•  Obfuscated Code
•  Frequently have to rely on other tools
too…
SensePost - 2010
•  Certificate information stored in
META-INF
•  MANIFEST.MF contains hashes for
resources
•  These files can easily be deleted…
Defeating Signing
SensePost - 2010
•  Now possible to modify classes in
JAR file
•  Signing normally used specifically for
Java applets
– Allow applets to access network
resources
– Allow applets to read / write files
•  However, the applet runs on *my*
machine
– Can specify own security model…
What this Means
SensePost - 2010
Obfuscation
•  Defeating Java obfuscation is
difficult
•  Depends on the obfuscation
mechanism used
•  In most cases, virtually impossible…
•  … however, the newer attack
methodologies outlined later will help
…but wait – there is more…
SensePost - 2010
Obfuscation
•  A bunch of classes depending on
reflection methods and serialized
objects can not normally be
obfuscated…
•  … in obfuscated applications this
provides us with a nice area to
attack 
SensePost - 2010
Java Quick Kills
•  Not necessary to fix all compiler
errors
•  Only need to fix specific classes with
functionality you need
– Sanitisation libraries
– Network Stream libraries
•  Updated classes can be recompiled
with the original JAR file to satisfy
dependancies
SensePost - 2010
Demo and Walkthrough
SensePost - 2010
•  Decompile Application and
export sources
Demo and Walkthrough
SensePost - 2010
•  Identify key source files and
include in project
Demo and Walkthrough
SensePost - 2010
•  Remove compiled class files
from original JAR
•  Rebuild JAR file
Demo and Walkthrough
SensePost - 2010
•  Link modified JAR file to
compiler CLASSPATH
Demo and Walkthrough
SensePost - 2010
•  Modify source code and run…
Demo and Walkthrough
SensePost - 2010
•  Repurposing uses the same
technique…
•  … but changes the functionality
in order to turn the application
into an attack tool
Newer Attack Methods
•  New research and toolsets make
reversing and recompiling
unneccessary… 
•  Also make it easier to attack obfuscated
applications
•  Cannot always be used for repurposing 
SensePost - 2010
BlackHat Europe – 2010
•  Manish Saindane
–  Demonstrated attacks against serialized
objects
–  Provided Burp plug-in to view and modify
serialized objects
http://www.blackhat.com/html/bh-eu-10/bh-eu-10-archives.html
SensePost - 2010
Demo – Serialized Objects
SensePost - 2010
BlackHat Las Vegas – 2010
•  Arshan Dabirsiaghi
–  JavaSnoop : How to Hack Anything Written in
Java
•  Stephen de Vries
–  Hacking Java Clients
•  Both talks outlined new methods for
attacking Java Applications
http://www.blackhat.com/html/bh-us-10/bh-us-10-archives.html
SensePost - 2010
Demo – JavaSnoop
SensePost - 2010
In Summary
•  Java reversing is fun
•  Java reversing can be easy
•  Newer attack methodologies no
longer require attackers to reverse
the application
•  Traditional reversing techniques still
normally apply for repurposing
applications
SensePost - 2010
Ta Muchly
•  ZaCon folkses 
SensePost - 2010
Questions ?
ian@sensepost.com
SensePost - 2010

More Related Content

Viewers also liked

2010 za con_ivan_burke
2010 za con_ivan_burke2010 za con_ivan_burke
2010 za con_ivan_burkeJohan Klerk
 
4 pliego reclamo 2015
4 pliego reclamo 20154 pliego reclamo 2015
4 pliego reclamo 2015
Paola Aliaga
 
Arts railway station tv exp
Arts railway station tv expArts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
 
2010 za con_jameel_haffejee
2010 za con_jameel_haffejee2010 za con_jameel_haffejee
2010 za con_jameel_haffejeeJohan Klerk
 
Arts railway station tv exp
Arts railway station tv expArts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
 
Anexo a demanda impugnacion laudo sunat comprimido
Anexo a demanda impugnacion laudo sunat   comprimidoAnexo a demanda impugnacion laudo sunat   comprimido
Anexo a demanda impugnacion laudo sunat comprimido
Paola Aliaga
 
2010 za con_haroon_meer
2010 za con_haroon_meer2010 za con_haroon_meer
2010 za con_haroon_meerJohan Klerk
 
Cv paola aliaga 21
Cv paola aliaga 21Cv paola aliaga 21
Cv paola aliaga 21
Paola Aliaga
 
2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschkeJohan Klerk
 
2010 za con_todor_genov
2010 za con_todor_genov2010 za con_todor_genov
2010 za con_todor_genovJohan Klerk
 
2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merweJohan Klerk
 
2010 za con_roelof_temmingh
2010 za con_roelof_temmingh2010 za con_roelof_temmingh
2010 za con_roelof_temminghJohan Klerk
 
2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbertJohan Klerk
 
2010 za con_barry_irwin
2010 za con_barry_irwin2010 za con_barry_irwin
2010 za con_barry_irwinJohan Klerk
 
2010 za con_stephen_kreusch
2010 za con_stephen_kreusch2010 za con_stephen_kreusch
2010 za con_stephen_kreuschJohan Klerk
 
Training management
Training managementTraining management
Training management
Mezbah Uddin
 

Viewers also liked (16)

2010 za con_ivan_burke
2010 za con_ivan_burke2010 za con_ivan_burke
2010 za con_ivan_burke
 
4 pliego reclamo 2015
4 pliego reclamo 20154 pliego reclamo 2015
4 pliego reclamo 2015
 
Arts railway station tv exp
Arts railway station tv expArts railway station tv exp
Arts railway station tv exp
 
2010 za con_jameel_haffejee
2010 za con_jameel_haffejee2010 za con_jameel_haffejee
2010 za con_jameel_haffejee
 
Arts railway station tv exp
Arts railway station tv expArts railway station tv exp
Arts railway station tv exp
 
Anexo a demanda impugnacion laudo sunat comprimido
Anexo a demanda impugnacion laudo sunat   comprimidoAnexo a demanda impugnacion laudo sunat   comprimido
Anexo a demanda impugnacion laudo sunat comprimido
 
2010 za con_haroon_meer
2010 za con_haroon_meer2010 za con_haroon_meer
2010 za con_haroon_meer
 
Cv paola aliaga 21
Cv paola aliaga 21Cv paola aliaga 21
Cv paola aliaga 21
 
2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke
 
2010 za con_todor_genov
2010 za con_todor_genov2010 za con_todor_genov
2010 za con_todor_genov
 
2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe
 
2010 za con_roelof_temmingh
2010 za con_roelof_temmingh2010 za con_roelof_temmingh
2010 za con_roelof_temmingh
 
2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert
 
2010 za con_barry_irwin
2010 za con_barry_irwin2010 za con_barry_irwin
2010 za con_barry_irwin
 
2010 za con_stephen_kreusch
2010 za con_stephen_kreusch2010 za con_stephen_kreusch
2010 za con_stephen_kreusch
 
Training management
Training managementTraining management
Training management
 

Similar to 2010 za con_ian_de_villiers

Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and FallaciesRoman Elizarov
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
Rapid With Spring Roo
Rapid With Spring RooRapid With Spring Roo
Rapid With Spring Roo
Morten Lileng
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
SATHYAKALAKSKPRCASBS
 
java full 1 (Recovered).docx
java full 1 (Recovered).docxjava full 1 (Recovered).docx
java full 1 (Recovered).docx
SATHYAKALAKSKPRCASBS
 
The Java Story
The Java StoryThe Java Story
The Java Story
David Parsons
 
Curso de Programación Java Intermedio
Curso de Programación Java IntermedioCurso de Programación Java Intermedio
Curso de Programación Java Intermedio
Universidad de Occidente
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
Kongu Engineering College, Perundurai, Erode
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
sureshkumara29
 
CS8392 OOP
CS8392 OOPCS8392 OOP
01 java intro
01 java intro01 java intro
01 java intro
Deepal Shah
 
java Features
java Featuresjava Features
java Features
Jadavsejal
 
Hybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbaiHybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbai
Vibrant Technologies & Computers
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
revanthonline
 
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
Infoviaan Technologies
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
 
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)
HarshithaAllu
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
Alfresco Software
 

Similar to 2010 za con_ian_de_villiers (20)

Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Rapid With Spring Roo
Rapid With Spring RooRapid With Spring Roo
Rapid With Spring Roo
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
 
java full 1.docx
java full 1.docxjava full 1.docx
java full 1.docx
 
java full.docx
java full.docxjava full.docx
java full.docx
 
java full 1 (Recovered).docx
java full 1 (Recovered).docxjava full 1 (Recovered).docx
java full 1 (Recovered).docx
 
The Java Story
The Java StoryThe Java Story
The Java Story
 
Curso de Programación Java Intermedio
Curso de Programación Java IntermedioCurso de Programación Java Intermedio
Curso de Programación Java Intermedio
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
01 java intro
01 java intro01 java intro
01 java intro
 
java Features
java Featuresjava Features
java Features
 
Hybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbaiHybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbai
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
 
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
 
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
 

2010 za con_ian_de_villiers

  • 2. `whoami` •  SensePost •  ian@sensepost.com – Break some stuff – Write reports about breaking some stuff – Abuse the staff SensePost - 2010
  • 3. Why This Talk ? •  import disclaimer; •  Not ground breaking stuff – no 0-day •  Java applications and applets appear to be popular again •  Reversing Java applications can be difficult •  Tips for reversing Java in less time (in my experience in any case)… SensePost - 2010
  • 4. The JAR File •  Java ARchive •  Used to distribute Java applications / applets etc. •  ZIP file containing compiled classes, libraries, settings, certificates, * •  Trivial to extract •  Normally disclose a vast amount of information SensePost - 2010
  • 5. Attacking Java is fun •  Trivial to reverse engineer •  Compiled applications are vulnerable to virtually all attacks traditional web apps are vulnerable to… •  …but all wrapped up in increased sense of developer smugness •  Repurposed Java applications make *awesome* attack tools SensePost - 2010
  • 6. Difficulties Attacking Java •  Many classes and libraries in JAR files of complex applications •  Class files often do not decompile cleanly •  Impossible to fix all java sources in large application •  Applets and applications are frequently signed •  Obfuscated Code •  Frequently have to rely on other tools too… SensePost - 2010
  • 7. •  Certificate information stored in META-INF •  MANIFEST.MF contains hashes for resources •  These files can easily be deleted… Defeating Signing SensePost - 2010
  • 8. •  Now possible to modify classes in JAR file •  Signing normally used specifically for Java applets – Allow applets to access network resources – Allow applets to read / write files •  However, the applet runs on *my* machine – Can specify own security model… What this Means SensePost - 2010
  • 9. Obfuscation •  Defeating Java obfuscation is difficult •  Depends on the obfuscation mechanism used •  In most cases, virtually impossible… •  … however, the newer attack methodologies outlined later will help …but wait – there is more… SensePost - 2010
  • 10. Obfuscation •  A bunch of classes depending on reflection methods and serialized objects can not normally be obfuscated… •  … in obfuscated applications this provides us with a nice area to attack  SensePost - 2010
  • 11. Java Quick Kills •  Not necessary to fix all compiler errors •  Only need to fix specific classes with functionality you need – Sanitisation libraries – Network Stream libraries •  Updated classes can be recompiled with the original JAR file to satisfy dependancies SensePost - 2010
  • 12. Demo and Walkthrough SensePost - 2010 •  Decompile Application and export sources
  • 13. Demo and Walkthrough SensePost - 2010 •  Identify key source files and include in project
  • 14. Demo and Walkthrough SensePost - 2010 •  Remove compiled class files from original JAR •  Rebuild JAR file
  • 15. Demo and Walkthrough SensePost - 2010 •  Link modified JAR file to compiler CLASSPATH
  • 16. Demo and Walkthrough SensePost - 2010 •  Modify source code and run…
  • 17. Demo and Walkthrough SensePost - 2010 •  Repurposing uses the same technique… •  … but changes the functionality in order to turn the application into an attack tool
  • 18. Newer Attack Methods •  New research and toolsets make reversing and recompiling unneccessary…  •  Also make it easier to attack obfuscated applications •  Cannot always be used for repurposing  SensePost - 2010
  • 19. BlackHat Europe – 2010 •  Manish Saindane –  Demonstrated attacks against serialized objects –  Provided Burp plug-in to view and modify serialized objects http://www.blackhat.com/html/bh-eu-10/bh-eu-10-archives.html SensePost - 2010
  • 20. Demo – Serialized Objects SensePost - 2010
  • 21. BlackHat Las Vegas – 2010 •  Arshan Dabirsiaghi –  JavaSnoop : How to Hack Anything Written in Java •  Stephen de Vries –  Hacking Java Clients •  Both talks outlined new methods for attacking Java Applications http://www.blackhat.com/html/bh-us-10/bh-us-10-archives.html SensePost - 2010
  • 23. In Summary •  Java reversing is fun •  Java reversing can be easy •  Newer attack methodologies no longer require attackers to reverse the application •  Traditional reversing techniques still normally apply for repurposing applications SensePost - 2010
  • 24. Ta Muchly •  ZaCon folkses  SensePost - 2010