lost in translation - blackhat brazil 2014

38
Lost in Translation Joaquim Espinhara & Rodrigo Montoro

Upload: rodrigo-montoro

Post on 07-Jul-2015

3.359 views

Category:

Internet


4 download

DESCRIPTION

This presentation we showed how security products fail to protect or detect against some type of flaws. Products includes web scanners , log analysis, ids, waf as Snort, OSSEC, Qualys, Acunetix, W3AF and so on. Problems aren't related only with those tools, we just use them to create our PoCs. Possible problems could be a Compliance bypass creating reports "without" SQLi for example.

TRANSCRIPT

Page 1: Lost in Translation - Blackhat Brazil 2014

Lost in Translation

Joaquim Espinhara

&

Rodrigo Montoro

Page 2: Lost in Translation - Blackhat Brazil 2014

$ whois @jespinhara

➢ Senior Security Consultant at Trustwave

➢ Author of 0 patent pending technologies

➢ BJJ enthusiast

➢ Triathlete

➢ Dad (of dog)

Page 3: Lost in Translation - Blackhat Brazil 2014

$ whois @spookerlabs

➢ Senior Security Administrator at Sucuri Security

➢ Author of 2 patent pending technologies

➢ Researcher

➢ Open Source enthusiast

➢ Triathlete

➢ Dad

Page 4: Lost in Translation - Blackhat Brazil 2014

Motivation

ERROR 1045 (28000): Acesso negado para o usuário

'spooker'@'localhost' (senha usada: SIM)

Page 5: Lost in Translation - Blackhat Brazil 2014

Note

We are not talking about specific products

only, all demos are to prove our idea that

probably affects any vendor / product.

Page 6: Lost in Translation - Blackhat Brazil 2014

Languages

Source: http://www.bbc.co.uk/languages/guide/languages.shtml

Page 7: Lost in Translation - Blackhat Brazil 2014

Native English countries

Map of nations using English as a de facto or official majority language (dark blue) or an official minority language (light blue)

Source: http://en.wikipedia.org/wiki/List_of_territorial_entities_where_English_is_an_official_language

Page 8: Lost in Translation - Blackhat Brazil 2014

Products

Page 9: Lost in Translation - Blackhat Brazil 2014

How detection works

Page 10: Lost in Translation - Blackhat Brazil 2014

Offensive

Tool Prepare

Request

based on

services

Send

request to

device

Service process

request

Service

send

response

Tool

receive

response

Tool

process

response

Page 11: Lost in Translation - Blackhat Brazil 2014

Defensive

Tool Prepare

Request

based on

services

Send

request to

device

Service process

request

Service

send

response

Tool

receive

response

Tool

process

response

Defensive

Tool

Page 12: Lost in Translation - Blackhat Brazil 2014

Attack sample

Page 13: Lost in Translation - Blackhat Brazil 2014

What kind of problems ?

Page 14: Lost in Translation - Blackhat Brazil 2014

Non-Detection aka False Negatives

➢Offensive

➢Defensive

Page 15: Lost in Translation - Blackhat Brazil 2014

Compliance bypass

Page 16: Lost in Translation - Blackhat Brazil 2014

“Stealth” backdoors / problems

Page 17: Lost in Translation - Blackhat Brazil 2014

Changes on the fly ...

mysql> select @@@version;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that

corresponds to your MySQL server version for the right syntax to use near '@version' at

line 1

mysql> SET lc_messages = 'pt_BR';

Query OK, 0 rows affected (0.00 sec)

mysql> select @@@version;

ERROR 1064 (42000): Você tem um erro de sintaxe no seu SQL próximo a '@version' na

linha 1

mysql>

Page 18: Lost in Translation - Blackhat Brazil 2014

Proof of Concepts (PoC)

Page 19: Lost in Translation - Blackhat Brazil 2014

Offensive Tools

➢ Acunetix

➢ W3AF

➢ Qualys Free online version

Page 20: Lost in Translation - Blackhat Brazil 2014

Acunetix

Page 21: Lost in Translation - Blackhat Brazil 2014

Acunetix Demo

Page 22: Lost in Translation - Blackhat Brazil 2014

w3af

Page 23: Lost in Translation - Blackhat Brazil 2014

Qualys Free Scan

Page 24: Lost in Translation - Blackhat Brazil 2014

Defensive tools

➢Snort / Sourcefire (Cisco)

➢OSSEC (Trend Micro)

➢WAF Parser

Page 25: Lost in Translation - Blackhat Brazil 2014

Snort / Sourcefire (IDS or IPS)

alert tcp $SQL_SERVERS 3306 -> $EXTERNAL_NET any (msg:"ET ATTACK_RESPONSE

MySQL User Account Enumeration"; flow:from_server,established; content:"|02|"; offset:3;

depth:4; content:"|15 04|Access denied for user"; fast_pattern:only; threshold:type both,track

by_dst,count 10,seconds 1; reference:url,seclists.org/fulldisclosure/2012/Dec/att-9/;

classtype:protocol-command-decode; sid:2015993; rev:2;)

alert tcp $SQL_SERVERS 1433 -> $EXTERNAL_NET any (msg:"GPL SQL sa brute force failed

login attempt"; flow:from_server,established; content:"Login failed for user 'sa'"; threshold:type

threshold, track by_src, count 5, seconds 2; reference:bugtraq,4797; reference:cve,2000-1209;

reference:nessus,10673; classtype:unsuccessful-user; sid:2103152; rev:4;)

alert tcp $HOME_NET 3306 -> $EXTERNAL_NET any (msg:"ET SCAN Multiple MySQL Login

Failures, Possible Brute Force Attempt"; flow:from_server,established; content:"|15 04|";

depth:64; content:"|32 38 30 30 30|Access denied for user|20|"; fast_pattern:only;

content:"using password|3A 20|"; threshold: type threshold, track by_src, count 5, seconds 120;

reference:url,doc.emergingthreats.net/2010494; classtype:attempted-recon; sid:2010494;

rev:3;)

Page 26: Lost in Translation - Blackhat Brazil 2014

Snort / Sourcefire

Page 27: Lost in Translation - Blackhat Brazil 2014

OSSEC (HIDS)

Page 28: Lost in Translation - Blackhat Brazil 2014

Logtest OSSEC

Page 29: Lost in Translation - Blackhat Brazil 2014

WAF Parser

Page 30: Lost in Translation - Blackhat Brazil 2014

Offensive & Defensive

Page 31: Lost in Translation - Blackhat Brazil 2014

Desktops

Page 32: Lost in Translation - Blackhat Brazil 2014

Future / Mitigations

Page 33: Lost in Translation - Blackhat Brazil 2014

Not easy fix, just talking about MySQL

By default, mysqld produces error messages in English, but

they can also be displayed in any of several other languages

: Czech, Danish, Dutch, Estonian, French, German, Greek,

Hungarian, Italian, Japanese, Korean, Norwegian,

Norwegian-ny, Polish, Portuguese, Romanian, Russian,

Slovak, Spanish, or Swedish.

20 languages

Page 34: Lost in Translation - Blackhat Brazil 2014

Improve ASV tests for PCI scanners

Page 35: Lost in Translation - Blackhat Brazil 2014

Work more with code errors (when available)

mysql> select @@@version;

ERROR 1064 (42000): Você tem um erro de sintaxe no seu SQL próximo

a '@version' na linha 1

mysql> select @@@version;

ERROR 1064 (42000): You have an error in your SQL syntax; check the

manual that corresponds to your MySQL server version for the right syntax

to use near '@version' at line 1

Page 36: Lost in Translation - Blackhat Brazil 2014

Possible attack surface

Something we couldn’t measure yet, need

tests and more tests.

Page 37: Lost in Translation - Blackhat Brazil 2014

Engine to detect language (not that easy)

ERROR 1064 (42000): Você tem um erro de sintaxe no seu SQL próximo a '@version' na linha 1

Page 38: Lost in Translation - Blackhat Brazil 2014

Contacts && Thank you!

Rodrigo Montoro

[email protected]

@sucuri_security

@spookerlabs

http://www.sucuri.net

Joaquim Espinhara

[email protected]

@spiderlabs

@jespinhara

http://www.trustwave.com