Software Entwicklung für sichere mobile...

26
Mai 2016 Security R&D - Oscar Angress Security Consultant - Jürgen Vollmer Software Entwicklung für sichere mobile Endgeräte Kurzvorstellung Situationsbeschreibung und Vorüberlegungen Angriffsvektoren Schutzmaßnahmen Praktisches Beispiel mit statischer Analyse des Quelltextes Zusammenfassung

Transcript of Software Entwicklung für sichere mobile...

Page 1: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Mai 2016

Security R&D - Oscar Angress

Security Consultant - Jürgen Vollmer

Software Entwicklung

für sichere mobile Endgeräte • Kurzvorstellung • Situationsbeschreibung und Vorüberlegungen • Angriffsvektoren • Schutzmaßnahmen • Praktisches Beispiel mit statischer Analyse des Quelltextes • Zusammenfassung

Page 2: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Sicherer Entwicklungsprozess

Automation

Reports

Analyze

Sicherheit & QA

Visualisierung

Implementierung

Verbessern der Sicherheit & Qualität

Messbarkeit von Sicherheit & Qualität

Automatisieren von Prozessen

Firmenprofil • Zuverlässigkeit &

Absturzsicherheit • Stabilität • Wartbarkeit

Page 3: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Company Profile – What we do !

Lösungen für den Entwicklungsprozess und mehr !

1. Verbessern und Sicherstellen ihrer Software- & Produkt- …

Sicherheit & Qualität,

Zuverlässigkeit, Absturzsicherheit, Stabilität

Wartbarkeit

2. Messbarkeit von Sicherheit & Qualität

3. Automatisieren von Prozessen mit der Implementierung von Softwarewerkzeugen und Services in bestehende Abläufe

Page 4: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

01

Security

Researcher Hacker

Speaker

02

Developer

.Net C++ Asm

03

Architect

HA Software Multi Tier

OSCAR T. ANGRESS Kurzvorstellung

Page 5: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

01 02 03 04

Cyber War

3% • Anonymous • Terrorists

Espionage

10% • Industry • Government

Hacktivism

20% • Search for new

Bugs • Fun

Cyber Crime

67% • Ransom • Malware • Bank Robbery

Cyber War

Espionage

Hacktivism

Crime

MOTIVATION BEHIND ATTACKS

CYBER CRIME steigt im Vergleich zu den vergangenen Jahren kontinuierlich

Page 6: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

DAMAGE

CR

EATE

MA

X D

MG

PO

SSIB

LE

MONEY

SELL

INFO

RM

ATI

ON

FUN

FOR

TH

E LO

L’S

STEAL

SELL

INFO

RM

ATIO

N O

R U

SE O

F C

ON

TRO

L

UNKNOWN TARGET

FUN

CYBER WAR

DAMAGE

RANSOME

MONEY

CONTRACTORS

STEAL

Click Mouse to Advance Animation

MOTIVATION

Page 7: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

4

ALLE ANDEREN

45%

OTH

ER

3

15%

OR

GA

NIZ

ATI

ON

S

Aurora Op.

2

10%

GO

VER

NM

ENT

WAR, ESPIONAGE

1

WAR, ESPIONAGE

30%

IND

UST

RY

TARGETS

Page 8: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

30% 50% 10% 10%

SOCIAL ENGINEERING

TELEFON EMAIL

EXPLOITS

WEB

WEAK SYSTEM

MISSING PATCHES MISCONFIGURATION

VULNERABILITIES

BAD CODE QUALITY OPENSOURCE 3rd Party COMPONENTS

Beispiel: Spoofing (CallID) Spoofing (Email) Verlockende Fallen

Visit on Web 80% Porno web Schadcode wird von Hackern hinterlassen.

Administrationsfehler

Keine Codereviews und nicht in den Entwicklungsprozess eingebunden

ATTACK VECTORS

SOCIAL ENGINEERING EXPLOITS APPLICATIONS SYSTEM

Das hier sind nur die 4 Top Vektoren oder Techniken die verwendet werden - meistens in Kombinationen.

Page 9: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Printer

Router

Switch

Firewall Operating

System

WIFI

Bluetooth

TCPIP

DataBase

3rd part

Components

My Product

SOFTWARE IS EVERYWHERE

Page 10: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Source Analyze, Hardware binding

Validation

Hashes, Tokens, Verschlüsselung

Communication

Remote Execution, Code Sign, Hashes, Exe Security Code Polymorphism

Execution

Visuelle und nicht Visuelle

Verifizierung

RISIKOANALYSE

Page 11: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Daten Verschlüsselung, Code Sign, Hardware binding

Validation

Hashes, Tokens, Verschlüsselung

Communication

Process Security, Exe Security,

Execution

SOFTWARE auf dem neuesten Stand

SYSTEM UPDATES

RISIKOANALYSE

Page 12: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Was sie heute tun reicht nicht aus!

Page 13: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

STOLEN DEVICE

Wie gehe ich damit um?

HACKER ATTACK

Systeme nicht erreichbar?

SOFTWARE VULERABILITIES

Hotfixes? Erzwungene Updates?

SERVER COMPROMISED

Was ist mit meinen Daten?

PANIC? Notfallpläne

Erstellen Sie Verhaltensregeln bei Notfällen und bereiten sie sich vor.

Page 14: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

WEAKNESS - MOBILE DEVICE

APPS

Sensitive Data Storage No Encryption Runtime Injections Escalated privileges Communication architecture

SYSTEM

Jailbreaking Passcode Firmware Encryption

COMM

Phishing Framing Clickjacking Man in the middle Buffer overflows

USER

Trust Location

Page 15: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

UNSECURE

ARCHITECTURE

- Plannung - Sprachenauswahl

DEVICE ENCRYPTION - Client - Server

APPLICATION PROTECTION

- Anti revers engineering - Executable Protection

REMOTE FUNCTIONS - Serverbasierende

Funktionen - Minimaler Client

STRONG AUTHENTICATION

- Passwordsecurtiy - PGP - Certificate

ANALYSIS - Code Analyze - Code Review - Risikoabschätzung

SECURE

HOW TO PROTECT

Page 16: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

FIRST SCAN

Erster Scan der bestehenden Software

ERRORS

Fehleridentifikation und Behebung

Guide

Entwicklungsprozesssteuerung

Reporting Informationen über des Stand der Entwicklung für Entwickler und Management

CHECKMARX CODE QUALITY AND SECURITY

Page 17: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Scan Results Workflow Select a Result

1. Select a Result 2. Follow the

Data Flow Graph 3. View in

Source Code 4. Manage Results

Begin by selecting the result type which contains all the instances of that vulnerability

Look for best fix locations in the Graph view that displays connections between the results

Select your result to view its code. This attack begins in row 173

Run & Manage Scans

Page 18: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

For a SQL Injection scan result, the Data Flow Graph (DFG) shows the tainted areas in the source code, from beginning to end. A ‘tainted’ field is a field that can potentially carry malicious data.

1. Select a Result 2. Follow the

Data Flow Graph 3. View in

Source Code 4. Manage Results

Scan Results Workflow Understand the Result

Run & Manage Scans

int iPassed = Convert.ToInt32(Utility.Dlookup("members",

"count(*)",Login.Text));

public string Dlookup(string table, string field, string

sWhere)

{

string sSQL = "SELECT “+ field +"FROM"+ table

+ "WHERE" + sWhere;

OleDbCommand command = new OleDbCommand(sSQL,Connection);

OleDbDataReader reader=

command.ExecuteReader(CommandBehavior.SingleRow);

Page 19: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

1. Select a Result 2. Follow the

Data Flow Graph 3. View in

Source Code 4. Manage Results

Set Result State To Verify (default) Not Exploitable Confirmed Urgent

Result Severity High Medium Low Info

Assign Result to User

Scan Results Workflow Manage Results

The result’s state, severity and assignment stay with the result from scan to scan until this result no longer appears in the scan results. For example, set false positive results’ state to ‘Not Exploitable’.

Run & Manage Scans

Page 20: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Look and Feel in Eclipse

Page 21: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

The look and feel in the Eclipse plug-in is very similar to the web interface. In addition to the regular Eclipse code pane (default position: upper-left), the CxViewer interface includes four panes with different levels of information.

Results according to vulnerability type

Full Graph The red-bordered element represents a best-fix location: Securing the code at this point will fix multiple instances of the vulnerability

Look and Feel in Eclipse

Data Flow Graph

Workflow in Eclipse

Page 22: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

In order to run a new scan, right-click the Project in Eclipse and select CxViewerAction Scan.

1. View Scan Results 2. Look for Best Fix

Location 3. View in

Source Code 4. Re-scan

The code contains 53 instances of SQL Injection

Workflow in Eclipse View Scan Results

Workflow in Eclipse

Page 23: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

1. View Scan Results 2. Look for Best Fix

Location 3. View in

Source Code 4. Re-scan

Look for the nodes marked in red and zoom-in on them

Workflow in Eclipse Best Fix Location

Workflow in Eclipse

Page 24: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

1. View Scan Results 2. Look for Best Fix

Location 3. Fix in

Source Code 4. Re-scan

Select the red rectangle to view this element in the code in context

Now you can secure the code

Workflow in Eclipse Fix & Re-scan

Workflow in Eclipse

Page 25: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Was sollte ich tun?

Planung der Entwicklung unter Berücksichtigung aller Faktoren

Aufsetzen von Sicherheitsmetriken für die Eigen- und Fremdentwicklung

Ständige Quelltextüberprüfung während der Entwicklung

Ausbildung meiner Mitarbeiter

Penetrationstest und simulierte Angriffe

Wir unterstützen sie von der Planung und Prozessgestaltung bis zum Testen von Software

[email protected]

Page 26: Software Entwicklung für sichere mobile Endgerätes2j6ns4ug.de-02.live-paas.net/wp-content/uploads... · FIRST SCAN Erster Scan der bestehenden Software ERRORS Fehleridentifikation

Fragen & Antworten