Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

173
AppSec USA 2014 Denver, Colorado Hacking .NET/C# Applications: Defend By Design Jon McCoy DigitalBodyGuard

description

Speech by Jon McCoy Hacking C#(.NET) Applications:Defend by Design @AppSec-USA 2014

Transcript of Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Page 1: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

AppSec USA 2014

Denver, ColoradoHacking .NET/C# Applications:

Defend By DesignJon McCoy

DigitalBodyGuard

Page 2: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

What is a Defendable System

What is a Strong/Weak Design

How to view a Software System

This Speech

Page 3: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Thanks AppSec/OWASPA Critical part of the security world

Thanks To

Page 4: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Jon McCoy - DigitalBodyGuard• Software Engineer

• Digital Security

• Application Level Security

• .NET Framework Expert

• Attack and Defense

Introduction

Page 5: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Work Area:PenTesting and Active Defender

Specialize:.Net Framework Systems

Overview

Page 6: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

What is a Thick Client?

GrayWolf

Demo

Context

Page 7: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Share What I Have Seen

Context

Page 8: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

What is aDefendable API

Context

Page 9: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

What is aDefendable API

Context

Page 10: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Focus of this talk

Daemon

API

Service

Page 11: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Focus of this talk

= =

Page 12: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Focus of this talk

= =

Page 13: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Focus of this talk

Daemon

Service Security

Business UnitsNetwork

Page 14: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Client World View

Page 15: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Cyber Attack

Users

Web Server

DB

Page 16: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Client Wants it secure

Page 17: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

WebLog

Page 18: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web Service

Web Service

SOPE/REST

Encrypted

AuthAuth

SOPE/REST

Encrypted

Page 19: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

UMLUnified Modeling Language

Page 20: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Network Diagram

Page 21: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 22: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Cyber Attack

Page 23: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Critical Units

Credit Cards

Production DB

$1,000,000

$20,000,000

User Info DB

$100,000

Page 24: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Client Is Strong

Page 25: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Strong

Page 26: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Critical Units

Credit Cards

Production DB

$1,000,000

$20,000,000

User Info DB

$100,000

Page 27: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

A Security Review

Page 28: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

I ”PenTester” will hit you at

Lets say you are “Secure”

• Network• Computer Login• Employees• Hardware• TechSupport• ………..

Page 29: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Strong

Page 30: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

I ”The Hacker” will Attack

Lets say you are “Secure”

• Users• Your Physical Infrastructure• Your Web-Face• All Digital Devices• ………..• Except (X/Y/Z)

Page 31: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

My Team

Page 32: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 33: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

A Security Review

Page 34: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

On Problem

Still Good Everything is Bad

Page 35: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• We took full control of Domain Admin• We took full control of Network• We took full control of Database Systems• We took full control of Physical Security• We took full control of File Management• We took full control of Back Up…..• ………..

Security Review

Page 36: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

On Problem

Everything is Bad

Page 37: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

How do we Fix This

Page 38: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Critical Units

Credit Cards

Production DB

$2,000,000

$20,000,000

User Info DB

$200,000

Page 39: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defenses

Credit Cards

Production DB

$2,000,000

$20,000,000

User Info DB

$200,000

Page 40: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defenses

Cards Hash

User Info DB

Credit Cards

Production DB

Page 41: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defenses

Cards Hash

User Info DB

Credit Cards

Production DB

Page 42: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 43: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Guards

Page 44: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Quick Recommendations

Page 45: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

API Type: OWIN.orgREST – SOPE – Socket

DB Type: Node.JS – Neo4Netde Database

Security: OAuth (2)RSA 4096 – AES 256 – MAC(message authentication code)

API Type: REST – SOPE – Socket

DB Type: Node Database – Sharding & Segmentation

Security:RSA 4096 – AES 256 – MAC(message authentication code)

Page 46: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• Detect and Protect the Perimeter• Guard and Respond• Build Choke Points• Find the Weak Blind Spots• …………

Layered Defense

Page 47: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

“Client Remediates the Issues”

Client is stronger

Page 48: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defense

Page 49: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Attacking as Hackers

Layered Defense

Page 50: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defense

Page 51: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• We took Admin in 2-4 hours(Tell Client 8 Hours)• We took full control of Network• We took full control of Database Systems• We Failed to control of Physical Security• We took full control of File Management• We Failed to control of Back Up…..• ………..

Security Review

Page 52: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

How do we Fix This

Page 53: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered defense

Detection and Response

Page 54: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Guard Post

Page 55: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 56: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Now we have started talking the same

Language

Now Security Can Start

Page 57: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Segmentation

Anit-Pattern

Pattern=

==

Developer=>ITGood Design

Bad Design

Separation

Page 58: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Controllers

Facade

Claims

Actions

View

Authentication===

Developer => DBA

Page 59: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security Controls

Attack Vector

Security Test

Defendable Systems

Security User Story

Security Unit Test=

==

Developer=>Security

Page 60: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Language = Context

Now Security Can Start

Page 61: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Get to know the Client

Web Data Processing

Strong API/DAL

Communications

Page 62: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Data Access Layer

Communications

Page 63: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Data Access Layer

Communications

Page 64: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Data Access LayerCommunications

Page 65: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 66: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Strong vs WeakSoftware

DEMO

Page 67: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Security Level

Page 68: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Security Level

Page 69: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 70: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 71: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Domain Expert

Page 72: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 73: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Design Security

DEMO

Page 74: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Two Completely Different SystemsPOS

Web

Page 75: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

Page 76: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

DB

IT/&/Networking

Page 77: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

TeamsPOS != WEB != DB != IT

Page 78: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Mockup Project

Defend the POS

Page 79: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Trusted Network

Point Of Sales

Clients & Partners

Page 80: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Built 5 Years ago

Changes Twice a year

Only X can Access it

Page 81: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Bad Fix

Page 82: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Bandage Security

Page 83: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 84: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

$250kYou will preventX/Y/Z AttacksBest “Buzzword” Protection

Page 85: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• Turn Key• Reliable• Low Long Term Cost• Free Upgrades for Three Years• ……….

Page 86: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 87: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Design Security

Page 88: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Page 89: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Secure System

Page 90: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Secure System

Log System

Passive Detection

Page 91: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log

Detection

Page 92: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log

Detection

Page 93: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log

Detection

Honey-Pot

Page 94: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log

Detection

Honey-Pot

Page 95: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

API/DAL

Page 96: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Data Management &

Point To Point CryptoAPI/DAL

Page 97: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

Crypto

API/DAL

Page 98: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

Crypto

Page 99: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

CommunicationsSegmented

Network

POS Auth

Page 100: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POSAuth

Auth

Page 101: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• Segmented Hardware• Segmented User Authentication(NO AD!)• Segmented Management• Segmented Data Storage/Backup• Segmented Buildings• Segmented Developers• Segmented IT/Security• Segmented Power…….

Page 102: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

Page 103: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

Data API

Page 104: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SQL

SQL

Page 105: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SQL-Injection=>

SQL

Security User Stories----SQL Injection----

• Detect SQL-injection• Prevent SQL-injection

• Respond to SQL-injection

Page 106: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SQL-Injection=>

Page 107: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SQL-Injection

Protection

Page 108: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SQL-Injection

Protection

SQL

Protection

Page 109: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

SQL-Injection

Protection

SQL-Injection

Protection

Page 110: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----SQL Injection----

• Detect SQL-injection• Prevent SQL-injection

• Respond to SQL-injection

Security Unity Test----SQL Injection----

• API -> SQL-injection• Processing Logic -> SQL-injection

• BackEnd -> SQL-injection

• Detect Injection

SQL-Injection

Page 111: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----SQL Injection Occurred----

• Evaluate SQL-injection• If Critical Respond

• If non-Critical Notify/Fix

Security Unity Test----SQL Injection Detection---

• API -> Notify• Processing Logic -> Notify

• BackEnd -> Notify

• LockDown Each Layer

SQL-Injection

Occurred

Page 112: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SQL-Injection

Page 113: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

Page 114: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security Response

Page 115: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SQL

SQL

Page 116: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SOAP -

REST

Page 117: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

SQL

Protection

SQLSOAP

- REST

Page 118: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

Page 119: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SQL

SQL

Log

Page 120: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SOPE/REST

SOPE/REST

Page 121: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POS

Web

SOPE/RESTEncrypted

SOPE/REST

Page 122: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

SOPE/RESTEncrypted

SOPE/REST

Why?

Not encrypt?

Page 123: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web

SOPE/REST

Why?

Not encrypt?

Page 124: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web

SOPE/REST

Do Not Trust

Publicly Exposed

Page 125: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Design PatternExposed SystemBURN THEM!!!!

Page 126: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web

SOPE/REST

Encrypted

SOPE/REST

POSI/O

Page 127: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Web

Detect and Burn

CommunicationsSOPE/REST

Encrypted

SOPE/REST

POSI/ODetect

and Burn

Page 128: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web

SOPE/REST

Encrypted

POSI/O

Service

Page 129: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Quick TangentBetter Web Server Layout

Page 130: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web Service

Web Service

SOPE/REST

Encrypted

SOPE/REST

Encrypted

Page 131: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Web Service

Web Service

SOPE/REST

Encrypted

AuthAuth

SOPE/REST

Encrypted

Page 132: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Segmentation Is Good

Page 133: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

Page 134: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

Page 135: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web Bridge

Page 136: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web Bridge

Page 137: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

POS

Web

BridgeDetection is Easy

Everything is Hard

Locking it down is Easy

Detection is Easy

Page 138: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

If Breach Occurs POS

WebBridge

Lock it All Down

Respond Aggressively

Burn it all Down

Fix ExploitReplace Server

Rotate Security

Page 139: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

Web

Page 140: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For a Secure Segmentation -

Developers Need To Design And Control• FireWalls• Network Layout• System Provisioning • System Security• ………

Page 141: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 142: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

POS

Web

Port:1234

Incoming TCP/UDP

From: 10.88.10.1

To: 10.88.11.255

Port:7676

Incoming TCP/UDP

From: 10.88.88.1

To: 10.88.99.111

Page 143: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 144: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Layered Defense

Security Test

Page 145: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For DeveloperSecurity User Stories

----Core DataBase is Hacked----

Page 146: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For SecuritySecurity User Stories

----Core DataBase is Hacked----

Page 147: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For SysAdminSecurity User Stories

----Core DataBase is Hacked----

Page 148: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For CxOSecurity User Stories

----Core DataBase is Hacked----

Page 149: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

For ………..Security User Stories

----Core DataBase is Hacked----

Page 150: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

WebLog

Page 151: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

WebLog

Page 152: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----Core DataBase is Hacked----

• Prevent Changing the Logs• Prevent Access to Other DBs

Page 153: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Systems Game Theory

Page 154: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Systems Game TheoryAnti-Fragile

Page 155: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----Lost DataBase Bridge----

• Keep WebServer Up• Take Services Down

• Sync After Bridge is Up

Page 156: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

WebLog

Page 157: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----Lost DataBase Bridge----

• Keep WebServer Up• Take Services Down

• Sync After Bridge is Up

Page 158: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Developer Response System

Page 159: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

• Security User Stories • Security Unit Test

• Security Response Stories

Page 160: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

API/DAL

Log Detection

Honey-Pot

Crypto

CryptoPOS

WebLog

Page 161: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security Response Stories----Hacker on Core Bridge----

• Guns• Fire• Pain

Page 162: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security Response Stories----Hacker on Core Bridge----

• Activate Full Security Response• Revoke All Security Tokens• Lock Down All Choke Points

Page 163: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Developer Response System

Page 164: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 165: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Security User Stories----Lost POS Ingress---

• Revoke Old POS Privileges• Standup New POS System

• Standup New POS Auth System

Page 166: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POSAuth

Auth

Auth

Page 167: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Communications

Data API

POSAuth

Auth

Auth

Page 168: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 169: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

Network Diagram

Page 170: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Page 171: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

If Extra Time

Fun Attack Demo

GrayWolf

Demo

Context

Page 172: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

172

FIN

Page 173: Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design

173

[email protected]

MORE INFORMATION @:

Jon McCoy