際際滷

際際滷Share 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
Ad

Recommended

The jar of joy
The jar of joy
SensePost
Maven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
KYSUC - Keep Your Schema Under Control
KYSUC - Keep Your Schema Under Control
Coimbra JUG
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
Karel Zikmund
Java buzzwords.pptx
Java buzzwords.pptx
BHARATH KUMAR
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
Karel Zikmund
2010 za con_ivan_burke
2010 za con_ivan_burke
Johan Klerk
4 pliego reclamo 2015
Paola Aliaga
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
2010 za con_jameel_haffejee
2010 za con_jameel_haffejee
Johan Klerk
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
Anexo a demanda impugnacion laudo sunat comprimido
Paola Aliaga
2010 za con_haroon_meer
2010 za con_haroon_meer
Johan Klerk
Cv paola aliaga 21
Paola Aliaga
2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke
Johan Klerk
2010 za con_todor_genov
2010 za con_todor_genov
Johan Klerk
2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe
Johan Klerk
2010 za con_roelof_temmingh
2010 za con_roelof_temmingh
Johan Klerk
2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert
Johan Klerk
2010 za con_barry_irwin
2010 za con_barry_irwin
Johan Klerk
2010 za con_stephen_kreusch
2010 za con_stephen_kreusch
Johan Klerk
Training management
Training management
Mezbah Uddin
Java Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
Roman Elizarov
Java Introduction
Java Introduction
sunmitraeducation
Rapid With Spring Roo
Rapid With Spring Roo
Morten Lileng
java completed units.docx
java completed units.docx
SATHYAKALAKSKPRCASBS
java full 1.docx
java full 1.docx
SATHYAKALAKSKPRCASBS
java full.docx
java full.docx
SATHYAKALAKSKPRCASBS

More Related Content

Viewers also liked (16)

2010 za con_ivan_burke
2010 za con_ivan_burke
Johan Klerk
4 pliego reclamo 2015
Paola Aliaga
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
2010 za con_jameel_haffejee
2010 za con_jameel_haffejee
Johan Klerk
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
Anexo a demanda impugnacion laudo sunat comprimido
Paola Aliaga
2010 za con_haroon_meer
2010 za con_haroon_meer
Johan Klerk
Cv paola aliaga 21
Paola Aliaga
2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke
Johan Klerk
2010 za con_todor_genov
2010 za con_todor_genov
Johan Klerk
2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe
Johan Klerk
2010 za con_roelof_temmingh
2010 za con_roelof_temmingh
Johan Klerk
2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert
Johan Klerk
2010 za con_barry_irwin
2010 za con_barry_irwin
Johan Klerk
2010 za con_stephen_kreusch
2010 za con_stephen_kreusch
Johan Klerk
Training management
Training management
Mezbah Uddin
2010 za con_ivan_burke
2010 za con_ivan_burke
Johan Klerk
4 pliego reclamo 2015
Paola Aliaga
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
2010 za con_jameel_haffejee
2010 za con_jameel_haffejee
Johan Klerk
Arts railway station tv exp
Arts railway station tv exp
Mezbah Uddin
Anexo a demanda impugnacion laudo sunat comprimido
Paola Aliaga
2010 za con_haroon_meer
2010 za con_haroon_meer
Johan Klerk
Cv paola aliaga 21
Paola Aliaga
2010 za con_georg-christian_pranschke
2010 za con_georg-christian_pranschke
Johan Klerk
2010 za con_todor_genov
2010 za con_todor_genov
Johan Klerk
2010 za con_jurgens_van_der_merwe
2010 za con_jurgens_van_der_merwe
Johan Klerk
2010 za con_roelof_temmingh
2010 za con_roelof_temmingh
Johan Klerk
2010 za con_daniel_cuthbert
2010 za con_daniel_cuthbert
Johan Klerk
2010 za con_barry_irwin
2010 za con_barry_irwin
Johan Klerk
2010 za con_stephen_kreusch
2010 za con_stephen_kreusch
Johan Klerk
Training management
Training management
Mezbah Uddin

Similar to 2010 za con_ian_de_villiers (20)

Java Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
Roman Elizarov
Java Introduction
Java Introduction
sunmitraeducation
Rapid With Spring Roo
Rapid With Spring Roo
Morten Lileng
java completed units.docx
java completed units.docx
SATHYAKALAKSKPRCASBS
java full 1.docx
java full 1.docx
SATHYAKALAKSKPRCASBS
java full.docx
java full.docx
SATHYAKALAKSKPRCASBS
java full 1 (Recovered).docx
java full 1 (Recovered).docx
SATHYAKALAKSKPRCASBS
The Java Story
The Java Story
David Parsons
Curso de Programaci坦n Java Intermedio
Curso de Programaci坦n Java Intermedio
Universidad de Occidente
Introduction to Spring & Spring BootFramework
Introduction to Spring & Spring BootFramework
Kongu Engineering College, Perundurai, Erode
oop unit1.pptx
oop unit1.pptx
sureshkumara29
CS8392 OOP
CS8392 OOP
DhanalakshmiVelusamy1
01 java intro
01 java intro
Deepal Shah
Hybernat 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 hyderabad
revanthonline
java basics concepts and the keywords needed
java basics concepts and the keywords needed
PriyadharshiniG41
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
Infoviaan Technologies
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)
HarshithaAllu
BP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
Alfresco Software
Java Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
Roman Elizarov
Rapid With Spring Roo
Rapid With Spring Roo
Morten Lileng
Curso de Programaci坦n Java Intermedio
Curso de Programaci坦n Java Intermedio
Universidad de Occidente
01 java intro
01 java intro
Deepal Shah
Java online training from hyderabad
Java online training from hyderabad
revanthonline
java basics concepts and the keywords needed
java basics concepts and the keywords needed
PriyadharshiniG41
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)
HarshithaAllu
BP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
Alfresco Software
Ad

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