Attacker "Math" 101: Professor Dai Zovi Institute For The Advancement of Memory Corruption
Attacker "Math" 101: Professor Dai Zovi Institute For The Advancement of Memory Corruption
Attacker Math
If the cost to attack is less than the value of your information to the attacker, you will be attacked Mass malware must be financially profitable for the profit-driven attackers APT campaigns must scale according to the resources at the attackers disposal
Attack Graphs
Informal tool to visualize and analyze how to attack a system (software, network, etc) Nodes represent levels of access/positions or actions to perform Nodes can be weighted with a cost, calculated in terms of capital, skill, risk, opportunity, or time/effort required Actors can be modeled in similar terms
Adversary Modeling
Different groups/types of attackers have different intents, capabilities, strategies, and tactics Most organizations are not concerned with all of them Mass malware APT ZFO / Anonymous / LulzSec Stuxnet
Conjecture
Attackers will take the least cost path through an attack graph from their start node to their goal node, where: Cost is a multi-variable equation Start nodes represent some level of access or position Goal nodes represent a consequence that is good for attacker, bad for defender
Mass Malware
Internet Access
???
Prot
Mass compromise and infect Internet Access Malicious Ads SEO Malicious HTML/JS
ASLR Bypass
DEP Bypass
Sandboxed Low Integrity Native Code Execution Low Integrity Native Code Execution Medium Integrity Native Code Execution
IE 8/9
ASLR Bypass
DEP Bypass
FF 4
Firefox Vulnerability
ASLR Bypass
DEP Bypass
WebKit Vulnerability Chrome 10 Malicious HTML/JS Execution IE Vulnerability Java Vulnerability FF 4 Firefox Vulnerability
ASLR Bypass
DEP Bypass
Sandboxed Low Integrity Native Code Execution Low Integrity Native Code Execution Medium Integrity Native Code Execution
IE 8/9
ASLR Bypass
DEP Bypass
ASLR Bypass
DEP Bypass
Sandbox escape
Admin User RCE M-H Integrity Escalation High Integrity Privileged RCE
Integrity Escalation
Install Rootkit
Sandbox escape
Admin User RCE M-H Integrity Escalation High Integrity Privileged RCE
Integrity Escalation
Kernel exploit
Install Rootkit
Attacker Math
Cost(Medium Integrity RCE) = Min( .10 * (WebKit vuln + ASLR/DEP + Sandbox), .60 * (IE vuln + ASLR/DEP + IE PM), .20 * (FF vuln + ASLR/DEP), .95 * (Flash vuln + ASLR/DEP + IE PM), .75 * (Java vuln) )
Lessons
Exploiting Java is the cheapest path to Medium Integrity Native Code Execution or User-privileged Remote Command Execution Therefore, attackers will prefer exploiting Java over browser vulnerabilities Exploiting the kernel is the cheapest path from Unprivileged Native Code Execution to Privileged Code/Command Execution Therefore, attackers will deploy kernel exploits before sandbox evasions (and already have)
JailbreakMe 2.0
MobileSafari HTML
Returnoriented execution
Unprivileged native code execution Sandbox evasion Mandatory code signing evasion Privilege Escalation Privileged native code execution
MobileSafari HTML
Returnoriented execution
Unprivileged native code execution Sandbox evasion Mandatory code signing evasion Privilege Escalation Privileged native code execution
Kernel exploit
Response
Apple released iOS 4.0.1 to patch vulnerabilities within 2 weeks Speed of response discourages similar 0day jailbreaks JB community shifted focus back to boot ROM exploits Press and users largely celebrated the release of the jailbreak What would the response have been if the same techniques were branded as an exploit (bad) rather than jailbreak (good) ? Jailbreak was quickly adapted into a PoC rootkit by Eric Monti
Lessons
Jailbreak developers use of exploits mimics malicious attackers They are resource constrained, just like defenders Desire maximum return on investment for their exploits Deploy exploits strategically Preservation of SHAtter in favor of Limera1n exploit Choose target attack surfaces for maximum return Boot ROM (unpatchable) vs. iOS (quickly patchable)
Conjecture
The level of security offered by a path through an attack graph is measured by the cost required for an attacker to traverse it Measuring the precise cost of a path requires spending exactly that amount to traverse it However, we can estimate or bound costs of some subpaths by proxy or observation
Theorem
Cost to discover a vulnerability in a particular product is less than the sum of a claimed bug bounty for that type of vulnerability plus the value of credit to that particular researcher Cost(Vuln) <= Value(Bounty) + Value(Credit)
Corollary
The cost to discover and reliably exploit a vulnerability in a particular product is less than the sum of a claimed Pwn2Own prize for that product, the value of the laptop, and the value of fame to that researcher Cost(Exploit) <= $15k + Value(Laptop) + Value(Fame) It is harder to remove fame from the equation here, but what can we measure? Time-to-exploit
Sandboxed Low Integrity Native Code Execution Low Integrity Native Code Execution Medium Integrity Native Code Execution Native Code Execution
Chrome Sandbox Escape Windows Kernel Exploit IE PM Escape File write access
ASLR Bypass
DEP Bypass
Safari 5
64-bit NX Bypass
Sandboxed Low Integrity Native Code Execution Low Integrity Native Code Execution Medium Integrity Native Code Execution Native Code Execution
Chrome Sandbox Escape Windows Kernel Exploit IE PM Escape File write access
ASLR Bypass
DEP Bypass
Safari 5
64-bit NX Bypass
Sandboxed Low Integrity Native Code Execution Low Integrity Native Code Execution Medium Integrity Native Code Execution Native Code Execution
Chrome Sandbox Escape Windows Kernel Exploit IE PM Escape File write access
ASLR Bypass
DEP Bypass
Safari 5
64-bit NX Bypass
Lessons
Requiring evasion of mitigations or exploitation of additional vulnerabilities in the chain increases time to develop a full exploit linearly And therefore, it also increases the cost to develop such an exploit linearly
Conjecture
APT attacks must scale according to resources at the attackers disposal Aurora campaign wasnt just against Google, or only 34 targets, but apparently against thousands of organizations (Reuters)
Does it Scale?
Phase Recon Weaponization Exploit delivery Host exploitation Host persistence Command and control Actions on Objectives
NOT SO MUCH HELL YES HELL YES HELL YES HELL YES HELL YES NOT AT ALL
Does it scale?
Lessons
Focusing defensive countermeasures on the cheapest (for the attacker) phases of the attack is not as effective as focusing on the expensive If your defense is cheaper than their offense, you will gain the advantage
Conclusion
Think like an attacker to predict what they will do and how they will attack you Model your understanding of their intent, capabilities, and constraints Adjust your threat model based on new information on attackers and their capabilities i.e. Anonymous pre- and post-Gawker
Questions?