Click here to load reader

AMF Testing Made Easy! DeepSec 2012

  • View
    4.912

  • Download
    4

Embed Size (px)

DESCRIPTION

Despite the popularity of Adobe Flex and the AMF binary protocol, testing AMF-based applications is still a manual and time-consuming activity. This research aimed at improving the current state of art, introducing a new testing approach and a new tool named Blazer. Blazer has been proven to significantly improve the coverage and the effectiveness of AMF security testing, in order to find real-life vulnerabilities including direct object reference bugs, authentication flaws, business logic abuses, SQL injections and other critical bugs. These are the things you are looking for when it comes to security testing.

Text of AMF Testing Made Easy! DeepSec 2012

  • 1. AMF Testing Made Easy!DeepSec 2012 Luca Carettoni
  • 2. AgendaAMF specication, BlazeDS, current techniques and toolsBlazer architecture, core techniques, heuristicsTesting with Blazer Objects generation and fuzzing *DEMO*CVE-2012-3249, Fortify Privileged Information DisclosureFinding vulnerabilities with Blazer Unauthenticated methods *DEMO* SQL Injection *DEMO*Whats new in Blazer v0.3Conclusion
  • 3. Thanks!Matasano Security - http://matasano.com/ Part of this research was performed on behalf of Matasano SecurityDafydd Stuttard - http://www.portswigger.net/ Burp, such an amazing tool
  • 4. I am a doer. And you?Luca Carettoni - luca@addepar.comReinventing the Infrastructure that Powers Global WealthManagement - http://addepar.com
  • 5. Introduction and contextAdobe Flex Framework for building Rich-Internet-Applications Based on Adobe FlashActionScript ActionScript is an object-oriented programming languageAction Message Format (AMF) Introduced with Flash Player 6 Compact binary format to serialize ActionScript objects Fast data transfer, comparing to text-based protocols An ecient mechanism to: Save and retrieve application resources Exchange strongly typed data between client-server
  • 6. AMF for end-users
  • 7. AMF for old-school hackers
  • 8. AMF for web hackers
  • 9. AMFv0 versus AMFv3Flash Player 6 Flash Player 9Object instances can be sent by Object instances, traits and strings canreference be sent by referenceSupport for ActionScript 1.0 Support for new ActionScript 3.0 data types Support for ash.utils.IExternalizable Variable length encoding scheme for integers
  • 10. Adobe BlazeDSServer-side Java Remoting/Messaging technologyUsing Flex Remoting, any Flex client or AIR application can communicate withremote services and inter-exchange dataIn practice, clients invoke Java methods from classes deployed within a traditionalJ2EE application server (e.g. Apache Tomcat)A widely deployed implementationMultiple alternatives exist: Java: Adobe LiveCycle Data Service, Granite, ... Others: RubyAMF, FluorineFX, amfPHP, ...
  • 11. Action Message Format (AMF)AMF request/response types: CommandMessage RemotingMessage ....Client-Server communication through channels: Endpoint - http:///messagebroker/amf Destination Service - echoService Operation - String echo(String input)
  • 12. State of art (research, tools)Testing Flash Applications, OWASP AppSec 2007 - Stefano di PaolaFlex, AMF3 And Blazeds - An Assessment, Blackhat USA 2008 - Jacob Karlsonand Kevin StadmeyerDeblaze, Defcon 17 - Jon RosePentesting Adobe Flex Applications, OWASP NY 2010 - Marcin WielgoszewskiStarting from v1.2.124, Burp Suite allows to visualize and tamper AMF tracOther debugging tools Charles Proxy, WebScarab, Pinta AIR app, ...
  • 13. Testing remote methods, todayTrac inspection and tampering Using network packet analyzers Using HTTP proxiesEnumeration (black-box testing) Retrieving endpoints, destinations and operations from the trac Decompiling the Flex application Brute-forcing endpoint, destination and operation names
  • 14. Life is pain, highness.Anyone who tells you differently isselling something W. Goldman
  • 15. Is this the best we can do?Ideal for black-box testing, limited knowledge requiredTime consumingRequires to invoke all application functionalitiesWhat about custom objects?What about hidden services?How to ensure coverage?
  • 16. Enterprise-grade applicationsLarge attack surfaceCustom externalizable classesIve tested applications with more than 500 remote invokable methodsand more than 600 custom Java objects
  • 17. Life is not #ffffff and #000000
  • 18. BlazerCustom AMF message generator with fuzzing capabilitiesMethod signatures and Java reection are used to generate dynamicallyvalid objects
  • 19. Blazer v0.3 - DeepSec editionGUI-based Burp Suite plugin Well-integrated so you wont need to leave your favorite tool Burp Free and Pro With Nimbus looknfeel tooGNU GPL softwarehttp://code.google.com/p/blazer/Start Burp with java -classpath Blazer_v0.3.jar:burp.jar burp.StartBurp andlaunch Blazer from the context menu
  • 20. Blazer - ArchitectureA packet generator based on Adobe AMF OpenSource librariesAn object generator to build valid application objects using best-t heuristicsA lightweight fuzzing infrastructure to generate attack vectors, insert payloads within objects, manage multiple threads and monitor the progress
  • 21. Blazer as a custom AMF clientBy default, Blazer uses Burp Proxy to record requests and responses Proxy setting option availableUsing Burp, you can benet from all built-in tools available (search, sorting, ...)
  • 22. Its show time! General usage Objects generation Finding bugs with Blazer: (a) discover exposed methods
  • 23. CVE-2012-3249HP Fortify Software Security Center Remote Disclosure of Privileged Information Discovered in June 2012, Patched in August 2012From the advisory that I sent to HP:An AMF endpoint used by the HP Fortify SSC web front-end allows to retrievesensitive system details, including user.dir, java.vm.name, os.name, java.vm.vendor,version, os.version, user.home, java.runtime.name, user.language, user.name,os.arch, java.runtime.version, user.country, java.version, ...public ListResult getFederations(@PName("spec") SearchSpec spec)
  • 24. Testing HP Fortify SSC
  • 25. Blazer - Core techniquesObjects generation Java reection Best-t heuristics Randomness and permutations
  • 26. Blazer - Data poolsData Pools Containers for good user-supplied input Allow to instantiate objects and invoke methods with semantically valid data Available for all primitive types and String Require to be customized for the targetAttack vectors Relevant for String objects only Attack vectors probability allows to unbalance the String data pool with attack vectors
  • 27. Blazer - Heuristic

Search related