SlideShare a Scribd company logo
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Security @ HyperScale
Claudio Criscione
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Chi è sto tizio
Claudio Criscione
Manager @ Google - Large scale security testing
@paradoxengine
Disclaimer: my own opinions, not my employer’s.
PS: Sono estremamente felice di usare di nuovo i caratteri accentati. èèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèààààààùùùùùùòòòòòòò
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Mi hanno detto
che c’è roba da
hackare...
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
“Tutto il codice è in quel repo
lì dietro. [...] Guarda non penso
nemmeno si accorgano fino a
che stai sotto le 1.000 CPU. ”
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Il mio primo progetto
PappaReale: test semantico automatico su larga
scala per JSON APIs.
Deriva automaticamente la struttura delle APIs per
fuzzing “semantico”: identifica candidati per analisi
manuale con FP < 2%.
Obiettivo: trovare decine di bug su decine di APIs!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Aspetta, che è
successo?
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
La natura del problema
Linux Kernel 4.15.8
20.323.000 Righe di codice
Large Hadron Collider
50.000.000 Righe di codice
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
La natura del problema
Google codebase
2.000.000.000+ Righe
86 TB, 9.000.000 files
dati del 2015
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
La natura del problema
16.000 modifiche al giorno da devs,
24.000 automatizzate
25.000+ sviluppatori
7+ linguaggi di programmazione
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
PostMortem: che ho sbagliato?
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Release the dogs
of war!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Abbiamo un sacco di gente, vero?
ISE (Information Security Engineering)
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Ma abbiamo un sacco più progetti...
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Una risorsa da difendere
Tooling e automazione:
questionari e segnali
Triage e minimizzazione
Focus sugli errori di design.Security
Engineer
Security TL
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
#1
Il personale di security è raro
e (si spera!) costoso, e non è
la chiave per scalare.
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Idea: abbiamo un
sacco di sviluppatori!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Il problema con l’educascion
Quanti in questa stanza
pensano di passare i
colloqui come software
engineer a Google?
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Il problema con l’educascion
E allora perchè ci
aspettiamo che un
software engineer sia
anche security engineer?
Non fare input senza validazione
Implementa rate limiting
Mettici un captcha NonusareElectron
Non usare PHP
Non desiderare la CPU d’altri
Guardaquesti7231warnings
Unbounded Arrays!
Bounded Mem
ory Allocation
Nienteoutputsenzaescaping
Controlla il token XSRF
Attento agli XSSI!
U
n
coboldo
m
annaro!
Am
a
ilD
O
M
tuo
com
e
te
stesso
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Un approccio diverso
Modificare framework, API,
linguaggi e processi per
rendere quasi impossibile
introdurre vulnerabilità*.
*Terms and conditions apply
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Sviluppare codice
sicuro, anno 2018
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
ATTENZIONE: IMMERSIONE TECNICA
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Bug di design vs implementazione
Bug di Implementazione
Locali e patchabili
Semplici e testabili
Ricorrenti ed ubiqui
Bug di Design
Diffusi nel sistema
Complessi e costosi
Subdoli ed infrequenti
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Perché è difficile?
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
L’idea fondamentale
Trasferire la “sicurezza” di un dato (i.e.
precondizioni) con il suo Tipo (SafeType)
Tutte le (nuove) API che lavorano sui
SafeTypes mantengono le precondizioni.
API su tipi unsafe li controllano/traducono.
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Per esempio
* @param {!HTMLAnchorElement} anchor The anchor element whose href property
* is to be assigned to.
* @param {string|!goog.html.SafeUrl} url The URL to assign.
* @see goog.html.SafeUrl#sanitize
*/
goog.dom.safe.setAnchorHref = function(anchor, url) {
goog.dom.asserts.assertIsHTMLAnchorElement(anchor);
/** @type {!goog.html.SafeUrl} */ var safeUrl;
if (url instanceof goog.html.SafeUrl) { safeUrl = url; }
else { safeUrl = goog.html.SafeUrl.sanitizeAssertUnchanged(url); }
anchor.href = goog.html.SafeUrl.unwrap(safeUrl);
};
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Implementazione
● Linter - Compile checks
○ Verificano che non siano utilizzabili API di bypass
● Verifica manuale delle (poche) unsafe calls
● Supporto nativo nei framework con
equivalenza semantica
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Si, ma quante
risorse ci
vogliono?
5 Ingegneri, in un
angusto corridoio
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
NonUsareOTiVeniamoACercare(..)
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Funziona?
Per il codice nuovo, nessun costo aggiuntivo.
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Prevenire è meglio che curare
Se avete capito perchè c’è una mela in questa slide, siete vecchi come me. Mi spiace (era l’88).
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
#2
Training, testing, auditing
etc. sono fantastici, ma
eliminare i bug alla radice
scala (molto) meglio.
Poka-yoke!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Eh, ma su questa roba
non si può fare!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Infrastruttura
3rd party code
Codice legacy
IoT devices
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Se non puoi
eliminare il bug
almeno puoi
trovarlo
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Rete corporate distribuita
su 50+ nazioni
Dispositivi sospesi in alta quota
Datacenters con “un
fracco” di server
DNA Sequencer
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Automatizzabile?
Automatizzabile
Non Automatizzabile
Problema enorme
Altro problema enorme
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Idea: abbiamo un
sacco di ingegneri!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Aspetta un attimo!
#1 Mi hai appena detto di non usare
il team di sicurezza!
#2 Mi hai anche detto di non
aspettarmi che altri ingegneri
facciano lavoro di security!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Fornire gli
strumenti giusti
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Target:
At least one of these options has to be provided to define the
target(s)
-d DIRECT Connection string for direct database connection
-u URL, --url=URL Target URL (e.g. "http://www.site.com/vuln.php?id=1")
-l LOGFILE Parse target(s) from Burp or WebScarab proxy log file
-x SITEMAPURL Parse target(s) from remote sitemap(.xml) file
-m BULKFILE Scan multiple targets given in a textual file
-r REQUESTFILE Load HTTP request from a file
-g GOOGLEDORK Process Google dork results as target URLs
-c CONFIGFILE Load options from a configuration INI file
Request:
These options can be used to specify how to connect to the target URL
--method=METHOD Force usage of given HTTP method (e.g. PUT)
--data=DATA Data string to be sent through POST
--param-del=PARA.. Character used for splitting parameter values
--cookie=COOKIE HTTP Cookie header value
--cookie-del=COO.. Character used for splitting cookie values
--load-cookies=L.. File containing cookies in Netscape/wget format
--drop-set-cookie Ignore Set-Cookie header from response
--user-agent=AGENT HTTP User-Agent header value
--random-agent Use randomly selected HTTP User-Agent header value
--host=HOST HTTP Host header value
--referer=REFERER HTTP Referer header value
--headers=HEADERS Extra headers (e.g. "Accept-Language: frnETag: 123")
--auth-type=AUTH.. HTTP authentication type (Basic, Digest, NTLM or PKI)
--auth-cred=AUTH.. HTTP authentication credentials (name:password)
--auth-private=A.. HTTP authentication PEM private key file
--ignore-401 Ignore HTTP Error 401 (Unauthorized)
--proxy=PROXY Use a proxy to connect to the target URL
--proxy-cred=PRO.. Proxy authentication credentials (name:password)
--proxy-file=PRO.. Load proxy list from a file
--ignore-proxy Ignore system default proxy settings
--tor Use Tor anonymity network
--tor-port=TORPORT Set Tor proxy port other than default
--tor-type=TORTYPE Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5)
--check-tor Check to see if Tor is used properly
--delay=DELAY Delay in seconds between each HTTP request
--timeout=TIMEOUT Seconds to wait before timeout connection (default 30)
--retries=RETRIES Retries when the connection timeouts (default 3)
--randomize=RPARAM Randomly change value for given parameter(s)
--safe-url=SAFURL URL address to visit frequently during testing
--safe-freq=SAFREQ Test requests between two visits to a given safe URL
[...]
Optimization:
These options can be used to optimize the performance of sqlmap
-o Turn on all optimization switches
--predict-output Predict common queries output
--keep-alive Use persistent HTTP(s) connections
--null-connection Retrieve page length without actual HTTP response body
--threads=THREADS Max number of concurrent HTTP(s) requests (default 1)
Injection:
These options can be used to specify which parameters to test for,
provide custom injection payloads and optional tampering scripts
-p TESTPARAMETER Testable parameter(s)
--skip=SKIP Skip testing for given parameter(s)
--dbms=DBMS Force back-end DBMS to this value
--dbms-cred=DBMS.. DBMS authentication credentials (user:password)
--os=OS Force back-end DBMS operating system to this value
--invalid-bignum Use big numbers for invalidating values
--invalid-logical Use logical operations for invalidating values
--invalid-string Use random strings for invalidating values
--no-cast Turn off payload casting mechanism
--no-escape Turn off string escaping mechanism
--prefix=PREFIX Injection payload prefix string
--suffix=SUFFIX Injection payload suffix string
--tamper=TAMPER Use given script(s) for tampering injection data
Detection:
These options can be used to customize the detection phase
--level=LEVEL Level of tests to perform (1-5, default 1)
--risk=RISK Risk of tests to perform (0-3, default 1)
--string=STRING String to match when query is evaluated to True
--not-string=NOT.. String to match when query is evaluated to False
--regexp=REGEXP Regexp to match when query is evaluated to True
--code=CODE HTTP code to match when query is evaluated to True
--text-only Compare pages based only on the textual content
--titles Compare pages based only on their titles
Techniques:
These options can be used to tweak testing of specific SQL injection
techniques
--technique=TECH SQL injection techniques to use (default "BEUSTQ")
--time-sec=TIMESEC Seconds to delay the DBMS response (default 5)
[....]
Enumeration:
These options can be used to enumerate the back-end database
management system information, structure and data contained in the
tables. Moreover you can run your own SQL statements
-a, --all Retrieve everything
-b, --banner Retrieve DBMS banner
--current-user Retrieve DBMS current user
--current-db Retrieve DBMS current database
--hostname Retrieve DBMS server hostname
--is-dba Detect if the DBMS current user is DBA
--users Enumerate DBMS users
--passwords Enumerate DBMS users password hashes
--privileges Enumerate DBMS users privileges
--roles Enumerate DBMS users roles
--dbs Enumerate DBMS databases
--tables Enumerate DBMS database tables
--columns Enumerate DBMS database table columns
--schema Enumerate DBMS schema
--count Retrieve number of entries for table(s)
--dump Dump DBMS database table entries
--dump-all Dump all DBMS databases tables entries
--search Search column(s), table(s) and/or database name(s)
--comments Retrieve DBMS comments
-D DB DBMS database to enumerate
-T TBL DBMS database table(s) to enumerate
-C COL DBMS database table column(s) to enumerate
-X EXCLUDECOL DBMS database table column(s) to not enumerate
-U USER DBMS user to enumerate
--exclude-sysdbs Exclude DBMS system databases when enumerating tables
--where=DUMPWHERE Use WHERE condition while table dumping
--start=LIMITSTART First query output entry to retrieve
--stop=LIMITSTOP Last query output entry to retrieve
--first=FIRSTCHAR First query output word character to retrieve
--last=LASTCHAR Last query output word character to retrieve
--sql-query=QUERY SQL statement to be executed
--sql-shell Prompt for an interactive SQL shell
--sql-file=SQLFILE Execute SQL statements from given file(s)
Brute force:
These options can be used to run brute force checks
--common-tables Check existence of common tables
--common-columns Check existence of common columns
User-defined function injection:
These options can be used to create custom user-defined functions
[...]
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Cosa pensavo servisse
1. Trovare tutti i tipi di bug del
reame, almeno in qualche
istanza
2. Segnali di bug potenziali
3. Configurabilità
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Cosa serve veramente
1. Usabilità
2. Poche classi di bug, ma in
tutte le istanze
3. Nessun falso positivo
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Si ma, allora tu cosa fai?
Controllo!
Metriche “di sistema”: quanta
copertura sul totale della
galassia, tempo medio di
risoluzione, etc.
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
#3
Se non potete prevenire i
bug, nè potete automatizzare
tutto, allora:
Delegare, ma verificare.
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
#1 Don’t detect, prevent
#2 Automate: Humans don’t scale
#3 Delegate & Empower && verify
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
GRAZIE!
Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
Domande?

More Related Content

Similar to HackInBo2018 - Security @ Hyperscale

L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
Angelo Parchitelli
 
La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013
Massimo Chirivì
 
Smau Bari 2013 Massimo Chirivì
Smau Bari 2013 Massimo ChirivìSmau Bari 2013 Massimo Chirivì
Smau Bari 2013 Massimo ChirivìSMAU
 
La sicurezza applicativa ai tempi dell’ASAP
La sicurezza applicativa ai tempi dell’ASAPLa sicurezza applicativa ai tempi dell’ASAP
La sicurezza applicativa ai tempi dell’ASAP
festival ICT 2016
 
Ciao Alexa, mi racconti perché non funziona più la mia azienda?
Ciao Alexa, mi racconti perché non funziona più la mia azienda?Ciao Alexa, mi racconti perché non funziona più la mia azienda?
Ciao Alexa, mi racconti perché non funziona più la mia azienda?
Luca_Moroni
 
Dall'Internet of Things verso l'Internet of Everything: collegare dati per p...
Dall'Internet of Things  verso l'Internet of Everything: collegare dati per p...Dall'Internet of Things  verso l'Internet of Everything: collegare dati per p...
Dall'Internet of Things verso l'Internet of Everything: collegare dati per p...
Angelo Parchitelli
 
Scacco matto ai crytpo malware (smau 2016 - bologna)
Scacco matto ai crytpo malware (smau 2016 - bologna)Scacco matto ai crytpo malware (smau 2016 - bologna)
Scacco matto ai crytpo malware (smau 2016 - bologna)
Gianfranco Tonello
 
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisureCCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
walk2talk srl
 
Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
Gianluca Arbezzano
 
Come mettere in sicurezza le applicazioni legacy, un approccio pragmatico
Come mettere in sicurezza le applicazioni legacy, un approccio pragmaticoCome mettere in sicurezza le applicazioni legacy, un approccio pragmatico
Come mettere in sicurezza le applicazioni legacy, un approccio pragmatico
Antonio Parata
 
Web Application Insecurity Uncensored
Web Application Insecurity UncensoredWeb Application Insecurity Uncensored
Web Application Insecurity Uncensored
jekil
 
Sicurezza Informatica Evento AITA Genova
Sicurezza Informatica Evento AITA GenovaSicurezza Informatica Evento AITA Genova
Sicurezza Informatica Evento AITA Genova
uninfoit
 
WordCamp Bologna 2018 - Paolo Dolci
WordCamp Bologna 2018 - Paolo DolciWordCamp Bologna 2018 - Paolo Dolci
WordCamp Bologna 2018 - Paolo Dolci
WpSEO.it
 
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industrialeIndustria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
CONFINDUSTRIA TOSCANA NORD
 
Ibm sicurezza: problematiche e soluzioni
Ibm sicurezza: problematiche e soluzioniIbm sicurezza: problematiche e soluzioni
Ibm sicurezza: problematiche e soluzioni
S.info Srl
 
festival ICT 2013: Sicurezza delle applicazioni web
festival ICT 2013: Sicurezza delle applicazioni webfestival ICT 2013: Sicurezza delle applicazioni web
festival ICT 2013: Sicurezza delle applicazioni webfestival ICT 2016
 
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
Andrea Patron
 
Va sui miei siti web
Va sui miei siti webVa sui miei siti web
Va sui miei siti web
Daniele Albrizio
 
Nicola Della Marina: Magento Frontend next level
Nicola Della Marina: Magento Frontend next levelNicola Della Marina: Magento Frontend next level
Nicola Della Marina: Magento Frontend next level
Meet Magento Italy
 

Similar to HackInBo2018 - Security @ Hyperscale (20)

L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
L'ecosistema Google a supporto dei progetti IoT: dalla prototipazione ai dati...
 
La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013La sicurezza delle Web Application - SMAU Business Bari 2013
La sicurezza delle Web Application - SMAU Business Bari 2013
 
Smau Bari 2013 Massimo Chirivì
Smau Bari 2013 Massimo ChirivìSmau Bari 2013 Massimo Chirivì
Smau Bari 2013 Massimo Chirivì
 
La sicurezza applicativa ai tempi dell’ASAP
La sicurezza applicativa ai tempi dell’ASAPLa sicurezza applicativa ai tempi dell’ASAP
La sicurezza applicativa ai tempi dell’ASAP
 
Ciao Alexa, mi racconti perché non funziona più la mia azienda?
Ciao Alexa, mi racconti perché non funziona più la mia azienda?Ciao Alexa, mi racconti perché non funziona più la mia azienda?
Ciao Alexa, mi racconti perché non funziona più la mia azienda?
 
Dall'Internet of Things verso l'Internet of Everything: collegare dati per p...
Dall'Internet of Things  verso l'Internet of Everything: collegare dati per p...Dall'Internet of Things  verso l'Internet of Everything: collegare dati per p...
Dall'Internet of Things verso l'Internet of Everything: collegare dati per p...
 
Scacco matto ai crytpo malware (smau 2016 - bologna)
Scacco matto ai crytpo malware (smau 2016 - bologna)Scacco matto ai crytpo malware (smau 2016 - bologna)
Scacco matto ai crytpo malware (smau 2016 - bologna)
 
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisureCCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
CCI2018 - Ethical Hacking, gli step di un attacco e le contromisure
 
Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
 
Come mettere in sicurezza le applicazioni legacy, un approccio pragmatico
Come mettere in sicurezza le applicazioni legacy, un approccio pragmaticoCome mettere in sicurezza le applicazioni legacy, un approccio pragmatico
Come mettere in sicurezza le applicazioni legacy, un approccio pragmatico
 
Web Application Insecurity Uncensored
Web Application Insecurity UncensoredWeb Application Insecurity Uncensored
Web Application Insecurity Uncensored
 
Sicurezza Informatica Evento AITA Genova
Sicurezza Informatica Evento AITA GenovaSicurezza Informatica Evento AITA Genova
Sicurezza Informatica Evento AITA Genova
 
WordCamp Bologna 2018 - Paolo Dolci
WordCamp Bologna 2018 - Paolo DolciWordCamp Bologna 2018 - Paolo Dolci
WordCamp Bologna 2018 - Paolo Dolci
 
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industrialeIndustria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
Industria 4.0. Lucca, 5 luglio 2017 - Cyber Security in ambiente industriale
 
Owasp parte1-rel1.1
Owasp parte1-rel1.1Owasp parte1-rel1.1
Owasp parte1-rel1.1
 
Ibm sicurezza: problematiche e soluzioni
Ibm sicurezza: problematiche e soluzioniIbm sicurezza: problematiche e soluzioni
Ibm sicurezza: problematiche e soluzioni
 
festival ICT 2013: Sicurezza delle applicazioni web
festival ICT 2013: Sicurezza delle applicazioni webfestival ICT 2013: Sicurezza delle applicazioni web
festival ICT 2013: Sicurezza delle applicazioni web
 
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
Exploit in ambente di Sviluppo. Livelli di sicurezza IDE nell'era del Cloud C...
 
Va sui miei siti web
Va sui miei siti webVa sui miei siti web
Va sui miei siti web
 
Nicola Della Marina: Magento Frontend next level
Nicola Della Marina: Magento Frontend next levelNicola Della Marina: Magento Frontend next level
Nicola Della Marina: Magento Frontend next level
 

More from Claudio Criscione

Hollywood mode off: security testing at scale
Hollywood mode off: security testing at scaleHollywood mode off: security testing at scale
Hollywood mode off: security testing at scale
Claudio Criscione
 
Virtually Pwned: Hacking VMware [ITA - SMAU10]
Virtually Pwned: Hacking VMware [ITA - SMAU10]Virtually Pwned: Hacking VMware [ITA - SMAU10]
Virtually Pwned: Hacking VMware [ITA - SMAU10]
Claudio Criscione
 
Virtually Pwned
Virtually PwnedVirtually Pwned
Virtually Pwned
Claudio Criscione
 
Standing on the clouds
Standing on the cloudsStanding on the clouds
Standing on the clouds
Claudio Criscione
 
Sicurezza della virtualizzazione - SMAU 2009
Sicurezza della virtualizzazione - SMAU 2009Sicurezza della virtualizzazione - SMAU 2009
Sicurezza della virtualizzazione - SMAU 2009
Claudio Criscione
 
The Good The Bad The Virtual
The Good The Bad The VirtualThe Good The Bad The Virtual
The Good The Bad The Virtual
Claudio Criscione
 
Introduzione alla computer forensic - acquisizione
Introduzione alla computer forensic - acquisizioneIntroduzione alla computer forensic - acquisizione
Introduzione alla computer forensic - acquisizione
Claudio Criscione
 
[Confidence0902] The Glass Cage - Virtualization Security
[Confidence0902] The Glass Cage - Virtualization Security[Confidence0902] The Glass Cage - Virtualization Security
[Confidence0902] The Glass Cage - Virtualization Security
Claudio Criscione
 

More from Claudio Criscione (8)

Hollywood mode off: security testing at scale
Hollywood mode off: security testing at scaleHollywood mode off: security testing at scale
Hollywood mode off: security testing at scale
 
Virtually Pwned: Hacking VMware [ITA - SMAU10]
Virtually Pwned: Hacking VMware [ITA - SMAU10]Virtually Pwned: Hacking VMware [ITA - SMAU10]
Virtually Pwned: Hacking VMware [ITA - SMAU10]
 
Virtually Pwned
Virtually PwnedVirtually Pwned
Virtually Pwned
 
Standing on the clouds
Standing on the cloudsStanding on the clouds
Standing on the clouds
 
Sicurezza della virtualizzazione - SMAU 2009
Sicurezza della virtualizzazione - SMAU 2009Sicurezza della virtualizzazione - SMAU 2009
Sicurezza della virtualizzazione - SMAU 2009
 
The Good The Bad The Virtual
The Good The Bad The VirtualThe Good The Bad The Virtual
The Good The Bad The Virtual
 
Introduzione alla computer forensic - acquisizione
Introduzione alla computer forensic - acquisizioneIntroduzione alla computer forensic - acquisizione
Introduzione alla computer forensic - acquisizione
 
[Confidence0902] The Glass Cage - Virtualization Security
[Confidence0902] The Glass Cage - Virtualization Security[Confidence0902] The Glass Cage - Virtualization Security
[Confidence0902] The Glass Cage - Virtualization Security
 

HackInBo2018 - Security @ Hyperscale

  • 1. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Security @ HyperScale Claudio Criscione
  • 2. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Chi è sto tizio Claudio Criscione Manager @ Google - Large scale security testing @paradoxengine Disclaimer: my own opinions, not my employer’s. PS: Sono estremamente felice di usare di nuovo i caratteri accentati. èèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèààààààùùùùùùòòòòòòò
  • 3. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Mi hanno detto che c’è roba da hackare...
  • 4. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 “Tutto il codice è in quel repo lì dietro. [...] Guarda non penso nemmeno si accorgano fino a che stai sotto le 1.000 CPU. ”
  • 5. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
  • 6. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Il mio primo progetto PappaReale: test semantico automatico su larga scala per JSON APIs. Deriva automaticamente la struttura delle APIs per fuzzing “semantico”: identifica candidati per analisi manuale con FP < 2%. Obiettivo: trovare decine di bug su decine di APIs!
  • 7. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
  • 8. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Aspetta, che è successo?
  • 9. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 La natura del problema Linux Kernel 4.15.8 20.323.000 Righe di codice Large Hadron Collider 50.000.000 Righe di codice
  • 10. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 La natura del problema Google codebase 2.000.000.000+ Righe 86 TB, 9.000.000 files dati del 2015
  • 11. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 La natura del problema 16.000 modifiche al giorno da devs, 24.000 automatizzate 25.000+ sviluppatori 7+ linguaggi di programmazione
  • 12. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 PostMortem: che ho sbagliato?
  • 13. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Release the dogs of war!
  • 14. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Abbiamo un sacco di gente, vero? ISE (Information Security Engineering)
  • 15. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Ma abbiamo un sacco più progetti...
  • 16. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Una risorsa da difendere Tooling e automazione: questionari e segnali Triage e minimizzazione Focus sugli errori di design.Security Engineer Security TL
  • 17. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 #1 Il personale di security è raro e (si spera!) costoso, e non è la chiave per scalare.
  • 18. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Idea: abbiamo un sacco di sviluppatori!
  • 19. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Il problema con l’educascion Quanti in questa stanza pensano di passare i colloqui come software engineer a Google?
  • 20. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Il problema con l’educascion E allora perchè ci aspettiamo che un software engineer sia anche security engineer? Non fare input senza validazione Implementa rate limiting Mettici un captcha NonusareElectron Non usare PHP Non desiderare la CPU d’altri Guardaquesti7231warnings Unbounded Arrays! Bounded Mem ory Allocation Nienteoutputsenzaescaping Controlla il token XSRF Attento agli XSSI! U n coboldo m annaro! Am a ilD O M tuo com e te stesso
  • 21. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Un approccio diverso Modificare framework, API, linguaggi e processi per rendere quasi impossibile introdurre vulnerabilità*. *Terms and conditions apply
  • 22. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Sviluppare codice sicuro, anno 2018
  • 23. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 ATTENZIONE: IMMERSIONE TECNICA
  • 24. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Bug di design vs implementazione Bug di Implementazione Locali e patchabili Semplici e testabili Ricorrenti ed ubiqui Bug di Design Diffusi nel sistema Complessi e costosi Subdoli ed infrequenti
  • 25. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Perché è difficile?
  • 26. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 L’idea fondamentale Trasferire la “sicurezza” di un dato (i.e. precondizioni) con il suo Tipo (SafeType) Tutte le (nuove) API che lavorano sui SafeTypes mantengono le precondizioni. API su tipi unsafe li controllano/traducono.
  • 27. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Per esempio * @param {!HTMLAnchorElement} anchor The anchor element whose href property * is to be assigned to. * @param {string|!goog.html.SafeUrl} url The URL to assign. * @see goog.html.SafeUrl#sanitize */ goog.dom.safe.setAnchorHref = function(anchor, url) { goog.dom.asserts.assertIsHTMLAnchorElement(anchor); /** @type {!goog.html.SafeUrl} */ var safeUrl; if (url instanceof goog.html.SafeUrl) { safeUrl = url; } else { safeUrl = goog.html.SafeUrl.sanitizeAssertUnchanged(url); } anchor.href = goog.html.SafeUrl.unwrap(safeUrl); };
  • 28. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Implementazione ● Linter - Compile checks ○ Verificano che non siano utilizzabili API di bypass ● Verifica manuale delle (poche) unsafe calls ● Supporto nativo nei framework con equivalenza semantica
  • 29. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Si, ma quante risorse ci vogliono? 5 Ingegneri, in un angusto corridoio
  • 30. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 NonUsareOTiVeniamoACercare(..)
  • 31. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Funziona? Per il codice nuovo, nessun costo aggiuntivo.
  • 32. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Prevenire è meglio che curare Se avete capito perchè c’è una mela in questa slide, siete vecchi come me. Mi spiace (era l’88).
  • 33. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 #2 Training, testing, auditing etc. sono fantastici, ma eliminare i bug alla radice scala (molto) meglio. Poka-yoke!
  • 34. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Eh, ma su questa roba non si può fare!
  • 35. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Infrastruttura 3rd party code Codice legacy IoT devices
  • 36. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Se non puoi eliminare il bug almeno puoi trovarlo
  • 37. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
  • 38. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Rete corporate distribuita su 50+ nazioni Dispositivi sospesi in alta quota Datacenters con “un fracco” di server DNA Sequencer
  • 39. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Automatizzabile? Automatizzabile Non Automatizzabile Problema enorme Altro problema enorme
  • 40. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Idea: abbiamo un sacco di ingegneri!
  • 41. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Aspetta un attimo! #1 Mi hai appena detto di non usare il team di sicurezza! #2 Mi hai anche detto di non aspettarmi che altri ingegneri facciano lavoro di security!
  • 42. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Fornire gli strumenti giusti
  • 43. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Target: At least one of these options has to be provided to define the target(s) -d DIRECT Connection string for direct database connection -u URL, --url=URL Target URL (e.g. "http://www.site.com/vuln.php?id=1") -l LOGFILE Parse target(s) from Burp or WebScarab proxy log file -x SITEMAPURL Parse target(s) from remote sitemap(.xml) file -m BULKFILE Scan multiple targets given in a textual file -r REQUESTFILE Load HTTP request from a file -g GOOGLEDORK Process Google dork results as target URLs -c CONFIGFILE Load options from a configuration INI file Request: These options can be used to specify how to connect to the target URL --method=METHOD Force usage of given HTTP method (e.g. PUT) --data=DATA Data string to be sent through POST --param-del=PARA.. Character used for splitting parameter values --cookie=COOKIE HTTP Cookie header value --cookie-del=COO.. Character used for splitting cookie values --load-cookies=L.. File containing cookies in Netscape/wget format --drop-set-cookie Ignore Set-Cookie header from response --user-agent=AGENT HTTP User-Agent header value --random-agent Use randomly selected HTTP User-Agent header value --host=HOST HTTP Host header value --referer=REFERER HTTP Referer header value --headers=HEADERS Extra headers (e.g. "Accept-Language: frnETag: 123") --auth-type=AUTH.. HTTP authentication type (Basic, Digest, NTLM or PKI) --auth-cred=AUTH.. HTTP authentication credentials (name:password) --auth-private=A.. HTTP authentication PEM private key file --ignore-401 Ignore HTTP Error 401 (Unauthorized) --proxy=PROXY Use a proxy to connect to the target URL --proxy-cred=PRO.. Proxy authentication credentials (name:password) --proxy-file=PRO.. Load proxy list from a file --ignore-proxy Ignore system default proxy settings --tor Use Tor anonymity network --tor-port=TORPORT Set Tor proxy port other than default --tor-type=TORTYPE Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5) --check-tor Check to see if Tor is used properly --delay=DELAY Delay in seconds between each HTTP request --timeout=TIMEOUT Seconds to wait before timeout connection (default 30) --retries=RETRIES Retries when the connection timeouts (default 3) --randomize=RPARAM Randomly change value for given parameter(s) --safe-url=SAFURL URL address to visit frequently during testing --safe-freq=SAFREQ Test requests between two visits to a given safe URL [...] Optimization: These options can be used to optimize the performance of sqlmap -o Turn on all optimization switches --predict-output Predict common queries output --keep-alive Use persistent HTTP(s) connections --null-connection Retrieve page length without actual HTTP response body --threads=THREADS Max number of concurrent HTTP(s) requests (default 1) Injection: These options can be used to specify which parameters to test for, provide custom injection payloads and optional tampering scripts -p TESTPARAMETER Testable parameter(s) --skip=SKIP Skip testing for given parameter(s) --dbms=DBMS Force back-end DBMS to this value --dbms-cred=DBMS.. DBMS authentication credentials (user:password) --os=OS Force back-end DBMS operating system to this value --invalid-bignum Use big numbers for invalidating values --invalid-logical Use logical operations for invalidating values --invalid-string Use random strings for invalidating values --no-cast Turn off payload casting mechanism --no-escape Turn off string escaping mechanism --prefix=PREFIX Injection payload prefix string --suffix=SUFFIX Injection payload suffix string --tamper=TAMPER Use given script(s) for tampering injection data Detection: These options can be used to customize the detection phase --level=LEVEL Level of tests to perform (1-5, default 1) --risk=RISK Risk of tests to perform (0-3, default 1) --string=STRING String to match when query is evaluated to True --not-string=NOT.. String to match when query is evaluated to False --regexp=REGEXP Regexp to match when query is evaluated to True --code=CODE HTTP code to match when query is evaluated to True --text-only Compare pages based only on the textual content --titles Compare pages based only on their titles Techniques: These options can be used to tweak testing of specific SQL injection techniques --technique=TECH SQL injection techniques to use (default "BEUSTQ") --time-sec=TIMESEC Seconds to delay the DBMS response (default 5) [....] Enumeration: These options can be used to enumerate the back-end database management system information, structure and data contained in the tables. Moreover you can run your own SQL statements -a, --all Retrieve everything -b, --banner Retrieve DBMS banner --current-user Retrieve DBMS current user --current-db Retrieve DBMS current database --hostname Retrieve DBMS server hostname --is-dba Detect if the DBMS current user is DBA --users Enumerate DBMS users --passwords Enumerate DBMS users password hashes --privileges Enumerate DBMS users privileges --roles Enumerate DBMS users roles --dbs Enumerate DBMS databases --tables Enumerate DBMS database tables --columns Enumerate DBMS database table columns --schema Enumerate DBMS schema --count Retrieve number of entries for table(s) --dump Dump DBMS database table entries --dump-all Dump all DBMS databases tables entries --search Search column(s), table(s) and/or database name(s) --comments Retrieve DBMS comments -D DB DBMS database to enumerate -T TBL DBMS database table(s) to enumerate -C COL DBMS database table column(s) to enumerate -X EXCLUDECOL DBMS database table column(s) to not enumerate -U USER DBMS user to enumerate --exclude-sysdbs Exclude DBMS system databases when enumerating tables --where=DUMPWHERE Use WHERE condition while table dumping --start=LIMITSTART First query output entry to retrieve --stop=LIMITSTOP Last query output entry to retrieve --first=FIRSTCHAR First query output word character to retrieve --last=LASTCHAR Last query output word character to retrieve --sql-query=QUERY SQL statement to be executed --sql-shell Prompt for an interactive SQL shell --sql-file=SQLFILE Execute SQL statements from given file(s) Brute force: These options can be used to run brute force checks --common-tables Check existence of common tables --common-columns Check existence of common columns User-defined function injection: These options can be used to create custom user-defined functions [...]
  • 44. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Cosa pensavo servisse 1. Trovare tutti i tipi di bug del reame, almeno in qualche istanza 2. Segnali di bug potenziali 3. Configurabilità
  • 45. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Cosa serve veramente 1. Usabilità 2. Poche classi di bug, ma in tutte le istanze 3. Nessun falso positivo
  • 46. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Si ma, allora tu cosa fai? Controllo! Metriche “di sistema”: quanta copertura sul totale della galassia, tempo medio di risoluzione, etc.
  • 47. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 #3 Se non potete prevenire i bug, nè potete automatizzare tutto, allora: Delegare, ma verificare.
  • 48. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018
  • 49. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 #1 Don’t detect, prevent #2 Automate: Humans don’t scale #3 Delegate & Empower && verify
  • 50. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 GRAZIE!
  • 51. Claudio Criscione - Security @ Hyperscale - HackInBo Spring 2018 Domande?