How to Rob an Online Bank (and get away with it)



Similar documents
HTTPParameter Pollution. ChrysostomosDaniel

Overview of the Penetration Test Implementation and Service. Peter Kanters

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Where every interaction matters.

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

The Top Web Application Attacks: Are you vulnerable?

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

elearning for Secure Application Development

Criteria for web application security check. Version

Application Security Best Practices. Wally LEE Principal Consultant

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

Web Application Penetration Testing

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

CRYPTUS DIPLOMA IN IT SECURITY

Magento Security and Vulnerabilities. Roman Stepanov

COURSE NAME: INFORMATION SECURITY INTERNSHIP PROGRAM

(WAPT) Web Application Penetration Testing

Web Application Worms & Browser Insecurity

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008


How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

Information Security. Training

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Guidelines for Web applications protection with dedicated Web Application Firewall

WEB APPLICATION FIREWALLS: DO WE NEED THEM?

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Interactive Application Security Testing (IAST)

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Chapter 1 Web Application (In)security 1

Common Criteria Web Application Security Scoring CCWAPSS

OWASP Top Ten Tools and Tactics

Information Security Services

Common Security Vulnerabilities in Online Payment Systems

We protect you applications! No, you don t. Digicomp Hacking Day 2013 May 16 th 2013

Intrusion detection for web applications

Still Aren't Doing. Frank Kim

Application Code Development Standards

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

Rational AppScan & Ounce Products

Sichere Software- Entwicklung für Java Entwickler

2,000 Websites Later Which Web Programming Languages are Most Secure?

Thick Client Application Security

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Course Title: Course Description: Course Key Objective: Fee & Duration:

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

Web Application Attacks And WAF Evasion

Exploiting Fundamental Weaknesses in Command and Control (C&C) Panels

Integrating Security Testing into Quality Control

Securing ios Applications. Dr. Bruce Sams, OPTIMAbit GmbH

Web Application Security

WHITE PAPER FORTIWEB WEB APPLICATION FIREWALL. Ensuring Compliance for PCI DSS 6.5 and 6.6

Advancements in Botnet Attacks and Malware Distribution

Software Security: Services and Products

Application Security Testing

HP WebInspect Tutorial

Strategic Information Security. Attacking and Defending Web Services

Web Application Attacks and Countermeasures: Case Studies from Financial Systems

Web application testing

Course Content: Session 1. Ethics & Hacking

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Members of the UK cyber security forum. Soteria Health Check. A Cyber Security Health Check for SAP systems

Web App Security Audit Services

Bypassing Web Application Firewalls (WAFs) Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

Liberty Alliance. CSRF Review. .NET Passport Review. Kerberos Review. CPSC 328 Spring 2009

05.0 Application Development

WHITE PAPER. FortiWeb Web Application Firewall Ensuring Compliance for PCI DSS 6.5 and 6.6

Penetration Testing in Romania

Six Essential Elements of Web Application Security. Cost Effective Strategies for Defending Your Business

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

Security Testing. Vulnerability Assessment vs Penetration Testing. Gabriel Mihai Tanase, Director KPMG Romania. 29 October 2014

What is Web Security? Motivation

Development. Resilient Software. Secure and. Mark S. Merkow Lakshmikanth Raghavan. CRC Press. Taylor& Francis Croup. Taylor St Francis Group,

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

Cross-Site Scripting

Introduction to Web Application Security. Microsoft CSO Roundtable Houston, TX. September 13 th, 2006

Nuclear Regulatory Commission Computer Security Office Computer Security Standard

Application Security Vulnerabilities, Mitigation, and Consequences

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

MANAGED SECURITY TESTING

Secure development and the SDLC. Presented By Jerry

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Data Breaches and Web Servers: The Giant Sucking Sound

An approach to Web Application Penetration Testing. By: Whiskah

WEB APPLICATION VULNERABILITY STATISTICS (2013)

Transcription:

How to Rob an Online Bank (and get away with it) Mitja Kolsek ACROS Security Session ID: HT-108 Session Classification: Intermediate

2

3

Evolution Of E-banking Attacks PAST-PRESENT FUTURE Back-End Server PRESENT Online Banking Server FUTURE 2.0 4

Attacks Against Individual Users Goal: Identity Theft Methods E-Banking Server Back-End Server Phishing, Fake security alerts XSS, CSRF Malware (man in the browser, extraction of certs and private keys) Problems User awareness 2-factor authentication OOB transaction confirmations Additional passwords/pins Known good target accounts 5

Attacks Against Corporate Users Goal: Identity Theft Methods Same as with individual users Problems More money Large transactions not unusual Targets can be found in public certificate directories Online Banking Server Back-End Server 6

LDAP Explorer Online Bank Robber s Google 7

Example: Published Corporate Certificate ldap://ldap.halcom.si:389/eidcertificateserialnumber=382631 E-Mail Address Personal Name Company Name 8

Attacks Against Online Banking Servers Goal: Exploiting Applications Methods Hacking Problems Back-End Server Getting noticed while looking for flaws Advantages Unlimited amount of money Online No Banking user interaction (social engineering) Possible Server creation of new money 9

Direct Resource Access 10

Direct Resource Access URL Cleartext ID https://bank/balance?uid=7728356 (my account balance data) https://bank/balance?uid=7728355 (another user s account balance data) 11

Direct Resource Access URL Base64 encoding https://bank/balance?dwlkptc3mjgznty= (my account balance data) Base64decode( dwlkptc3mjgznty= ) uid=7728356 Base64encode( uid=7728355 ) https://bank/balance?dwlkptc3mjgzntu= (another user s account balance data) 12

Direct Resource Access URL Encryption /balance?ko7higjj2gqfhsz9... (Base64) /balance?af86b301008aef5... (Hex) params = "uid=7728356" enc_params += "&salt=nobodywillguessthis" = AES_encrypt(params, key) path params = "/balance?" += "&ran + d=" base64(enc_params) + random() 13

Taking Money From Other People s Accounts /transfer? src=1 & dest=2 & amount=100 (from my account) /transfer? src=42 & dest=2 & amount=100 (from another user s account) 14

Transaction Creation Process I want to transfer some money Validation #1 Empty transaction form Filled-out transaction form src=1,dst=2, amount=100 Validation #2 Read-only confirmation form src=1,dst=2, amount=100 Transaction confirmation src=1,dst=2, amount=100 Validation #3 15

Negative Numbers 16

Negative Numbers A Devastating Oversight IF RequestedAmount > DisposableAmount THEN ERROR(); IF 3,000 > 2,000 THEN ERROR(); // Error Insufficient Funds IF -100 > 2,000 THEN ERROR(); // No Error Here 17

Here s minus hundred bucks for you Attacker: Victim: 0 $ 100 $ (Transfer -100 $ to Victim) Attacker: Victim: 100 $ 0 $ 18

Creating Money Out Of Thin Air Normal Account: Savings Account: 0 $ 0 $ (Transfer -100 $ to Savings Account) Normal Account: Savings Account: 100 $ 0 $ 19

Bypassing Limit Checks 20

Normal Overdraft Account #1: Account #2: 100 $ 0 $ (Transfer 1,000 $ from #1 to #2) Account #1: Account #2: -900 $ 1,000 $ 21

Over-Overdraft Account #1: Account #2: 100 $ 0 $ (Transfer 1,000,000 $ from #1 to #2) Account #1: Account #2: -999,900 $ 1,000,000 $ 22

Luca Carettoni & Stefano di Paola http://www.slideshare.net/wisec/http-parameter-pollution-a-new-category-of-web-attacks HTTP Parameter Pollution 23

Request Flow JSP PHP POST /transfer source=1 & dest=2 & amount=100 source = request.getparameter( source ) // 1 amount = request.getparameter( amount ) // 100 IF NOT user_authorized_for(source) THEN ERROR() IF disposable(source) < amount THEN ERROR() Call BackEndTransaction(request) POST /BackEndTransaction source=1 & dest=2 & amount=100 source = $_POST[ source ] // 1 dest = $_POST[ dest ] // 2 amount = $_POST[ amount ] // 100 24

HTTP Parameter Pollution (Source Account) JSP PHP POST /transfer source=1 & dest=2 & amount=100 & source=42 source = request.getparameter( source ) // 1 amount = request.getparameter( amount ) // 100 IF NOT user_authorized_for(source) THEN ERROR() IF disposable(source) < amount THEN ERROR() Call BackEndTransaction(request) POST /BackEndTransaction source=1 & dest=2 & amount=100 & source=42 source = $_POST[ source ] // 42 dest = $_POST[ dest ] // 2 amount = $_POST[ amount ] // 100 IF NOT user_authorized_for(source) THEN ERROR() 25

HTTP Parameter Pollution (Transfer Amount) JSP PHP POST /transfer source=1 & dest=2 & amount=100 & amount=100000 source = request.getparameter( source ) // 1 amount = request.getparameter( amount ) // 100 IF NOT user_authorized_for(source) THEN ERROR() IF disposable(source) < amount THEN ERROR() Call BackEndTransaction(request) POST /BackEndTransaction source=1 & dest=2 & amount=100 & amount=100000 source = $_POST[ source ] // 1 dest = $_POST[ dest ] // 2 amount = $_POST[ amount ] // 100000 IF NOT user_authorized_for(source) THEN ERROR() 26

SQL Injection 27

SQL Injection Data Theft SELECT rate FROM exch_rates WHERE currency =.$currency. SELECT rate FROM exch_rates WHERE currency = UNION SELECT balance FROM accounts WHERE account_id = 887296 28

SQL Injection Messing With Transactions BEGIN TRANSACTION UPDATE accounts SET balance = 0 WHERE account_id =.$acctid1. UPDATE accounts SET balance = 100 WHERE account_id =.$acctid1. COMMIT TRANSACTION 29

SQL Injection Messing With Transactions BEGIN TRANSACTION UPDATE accounts SET balance = 0 WHERE account_id = 123 UPDATE accounts SET balance = 100 WHERE account_id = 456 COMMIT TRANSACTION 30

SQL Injection Messing With Transactions BEGIN TRANSACTION UPDATE accounts SET balance = 0 WHERE account_id = 123 UPDATE accounts SET balance = 100 WHERE account_id = 456 OR account_id = 123 COMMIT TRANSACTION 31

Forging Bank s Digital Signatures 32

Automated Signing Of Deposit Agreement Deposit request: 100, 31 days Deposit agreement for signing (Legal text, interest rate) Signed deposit MODIFIED agreement deposit agreement User s Signing key Counter-signed MODIFIED deposit agreement Bank s Signing key 33

Server-Side Code Execution 34

Server-Side Code Execution Examples Java code injection (JBoss bug in 2010) PHP code injection (eval, system, includes...) Shell argument injection (command1&command2) Buffer overflows Impact Change e-banking application code Obtain database/ws credentials, issue direct requests to DB or back-end WS 35

The List Goes On... 36

Other Attacks Session Puzzling Insecure Mass Assignment Numerical Magic: Overflows, Underflows, Exponential Notation, Reserved words (Corsaire whitepaper) Stale Currency Exchange Race Conditions... New functionalities: automated deposits, loans, investment portfolio management,... 37

http://blog.acrossecurity.com/2012/01/is-your-online-bank-vulnerable-to.html Getting Rich Without Breaking The Law 38

Rounding And Currency Exchange 1 1,364 $ 0,01 0,01364 $ Loss : -0,00364 $ = -27% 0,01 0,01 $ Profit : +0,00266 = +36% 39

Known at least since 2001 Asymmetric Currency Rounding by M'Raïhi, Naccache and Tunstall http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.8055&rep=rep1&type=pdf 40

Currency Rounding Attack: Algorithm 1: 2: 3: Convert 100 to $ // We have 136,40$ for i = 1 to 13640 Convert 0,01$ to 0,01 // Now we have 136,40 goto 1 41

Currency Rounding Attacks The Speed Of Getting Rich Assume: 10 exchanges / second 1 day = 86.400 seconds Daily profit: 2.300 Monthly profit: ~ 70.000 Improvements Optimal exchange rate (getting as close to 0,005 as possible) Corporate banking: packets (1000s of exchanges in one packet) Does it really work? My personal e-banking: YES My company s corporate e-banking: YES Countermeasures Limit minimum amount to 1 whole unit, exchange fee 42

http://blog.acrossecurity.com/2012/05/anatomy-of-online-bank-robbery.html Phases Of Online Bank Robbery 43

4 Phases Of Online Bank Robbery Phase 1 Vulnerability Finding Source code or black box, user-in-the-middle Phase 2 Vulnerability Exploitation Creation of money on attacker s account, user-in-the-middle Phase 3 Buying Time Passing the money across borders, borrowing corporate accounts Phase 4 Extraction Classic methods, also borrowing user accounts for transfers 44

Apply 45

Apply: Bankers Short Term Currency conversion attacks Set minimum amount or fee Phase 1 : Disallow vulnerability tests Terms of service: suspend user account if vuln-testing 46

Apply: Bankers Long Term Phase 1 : Detect vulnerability tests OWASP AppSensor* Terminate user session if testing is detected Many server-side errors caused by single user Phase 2 : Find and fix vulnerabilities Review your code (tools don t find logical bugs) Get help from those who break into banks Use external pentest for designing and testing Phase 1 detection * https://www.owasp.org/index.php/owasp_appsensor_project 47

Apply: Penetration Testers Staging!= Production Authentication, back-end processing, scheduled jobs Find bugs in staging, verify in production Successful tests in production may be hard to undo (therefore test with small amounts) Vulnerabilities Use HTTP proxy* to eliminate client user interface Be really thorough with negative numbers Base64 encoding is often mere obfuscation Banks are focused on authentication, not authorization * https://www.owasp.org/index.php/phoenix/tools#http_proxying_.2f_editing 48

Mitja Kolsek ACROS d.o.o. www.acrossecurity.com mitja.kolsek@acrossecurity.com Twitter: @acrossecurity, @mkolsek Thanks: Mikko H. Hypponen, René Pfeiffer, Claudio Criscione, Stefan Ortloff and Candi Carrera for help with gathering information on national digital certificate usage 49