Codemotion 24-25 noviembre. Madrid, España · Codemotion 24-25 noviembre. Madrid, España ......

40
Codemotion 24-25 noviembre. Madrid, España

Transcript of Codemotion 24-25 noviembre. Madrid, España · Codemotion 24-25 noviembre. Madrid, España ......

Codemotion 24-25 noviembre. Madrid, España

¿YO?

•  Simón Roses Femerling •  Licenciado en Informática (Suffolk University), Postgrado E-Commerce (Harvard University) y Executive MBA (IE Business School)

•  Fundador & CEO, VULNEX www.vulnex.com •  Blog: www.simonroses.com

•  @simonroses | @vulnexsl

•  Youtube: https://www.youtube.com/channel/UC8KUXxTSEdWfpFzAydjEzyQ •  Ex: Microsoft, PwC, @Stake

•  Beca del DARPA Cyber Fast Track (CFT) para investigar sobre seguridad en el ciclo de desarrollo de software

http://www.simonroses.com/es/2014/06/mi-visita-al-pentagono/ •  Ponente: Black Hat, DEFCON, RSA, HITB, OWASP, AppSec USA, SOURCE, DeepSec,

TECHNET, CyberCamp

•  CEH, CISSP & CSSLP

OBJETIVOS DE LA CHARLA

•  Desarrollo seguro: metodología y herramientas

•  ¡Protege tu software ya!

•  RED vs. BLUE en el software

AGENDA

1. Seguridad en el software: ¿mande?

2. Desarrollo seguro con poco dolor

3. Conclusiones

1. ¿SEGURIDAD PARA CUÁNDO?

1. ES UNA INVERSIÓN, NO UN GASTO

1. OPENSAMM

1. MICROSOFT SDL

1. NUESTRO FOCO

1. ¿DÓNDE LOS UTILIZAMOS?

1. DISPOSITIVOS MÓVILES CONTIENEN TU VIDA

•  Emails •  Contactos •  Fotos •  Redes sociales •  Banca online •  Gestores de contraseñas •  Acceso a redes corporativas y servidores

internos •  Apps •  Lo que quieras…

2. FORMACIÓN

•  Microsoft SDL https://www.microsoft.com/en-us/SDL

•  Safecode Training https://training.safecode.org/

•  OWASP Training https://www.owasp.org/index.php/Education/Free_Training

2. MODELO DE AMENAZAS I

•  Identificar y mitigar riesgos en el software antes de escribir una sola línea de código

•  Proceso •  Todos los actores

•  Obligatorio

2. MODELO DE AMENAZAS II

•  OWASP Application Threat Modeling https://www.owasp.org/index.php/Application_Threat_Modeling

•  Threat Model https://en.wikipedia.org/wiki/Threat_model

•  Threat Modeling https://msdn.microsoft.com/en-us/library/ff648644.aspx

2. SDL TM 2016 I

•  Herramienta de Microsoft para realizar modelos de amenazas en el software

•  Más información: https://blogs.microsoft.com/cybertrust/2015/10/07/whats-new-with-microsoft-threat-modeling-tool-2016/ https://www.microsoft.com/en-us/download/details.aspx?id=49168

2. SDL TM 2016 II

2. SDL TM 2016 III

2. REVISIONES DE CÓDIGO FUENTE

•  Revisiones de código desde seguridad

•  Automatizado y manual

•  Requieren tiempo

2. SEGURIDAD REPOSITORIOS DE CÓDIGO

•  Más información de la cuenta: •  Información sensible •  Vulnerabilidades •  OSINT

•  https://github.com/michenriksen/gitrob

•  https://github.com/UnkL4b/GitMiner

2. GITROB

2. RETOS DEL REST PENTESTING

•  No existe un estándar en REST como WSDL para SOAP – Swagger: http://swagger.io/ – Web Application Description Language

(WADL) http://www.w3.org/Submission/wadl/

•  REST utiliza parámetros en el URL – Web: GET http://www.acme.com/dir/ –  REST: GET http://www.acme.com/api/product/1/

2. ¿CÓMO ENCONTRAR EL API?

•  Vis i tar la web/documentación disponible

•  www.publicapis.com

•  ¿Estándares?

•  Ingeniería inversa app/software

2. CLIENTES REST

•  Advanced REST Client (Chrome) https://advancedrestclient.com/

•  POSTMAN https://www.getpostman.com/

•  SOAPUI https://www.soapui.org/

•  Simple Requests https://itunes.apple.com/es/app/simple-requests-api-tester/id1157557497?mt=8

2. API FUZZING

•  Syntribos, An Automated API Security Testing Tool https://github.com/openstack/syntribos

•  Fuzzapi https://github.com/lalithr95/fuzzapi

2. AUDITORÍA REST

•  Caja Blanca vs Caja Negra

•  Solicitar – Documentación – Estándares: WSDL, Swagger, WADL, – Información del API – Proceso autenticación – Cabeceras HTTP necesarias

•  Modelo de Amenazas

2. ALGUNOS FALLOS COMUNES API

•  Autenticación y Autorización •  Límites de peticiones •  Mensajes de errores •  Manipulación de los métodos HTTP •  Inyección SQL •  Información en Tránsito/Reposo •  Tokens (expiración, reutilizar,

predecibles, etc.)

2. HERRAMIENTAS API

•  Escáneres comerciales

•  HTTPie https://httpie.org/

•  Web Proxies: Zap, Burp Proxy

•  Scripting kung-fu

2. RECURSOS API

•  OWASP API Security Project (Top 10 API) https://www.owasp.org/index.php/OWASP_API_Security_Project

•  OWASP REST Security Cheat Sheet

https://www.owasp.org/index.php/REST_Security_Cheat_Sheet

•  OWASP REST Assessment Cheat Sheet https://www.owasp.org/index.php/REST_Assessment_Cheat_Sheet

•  OWASP Web Service Security Testing Cheat Sheet https://www.owasp.org/index.php/Web_Service_Security_Testing_Cheat_Sheet

•  WS-Attacks http://www.ws-attacks.org/Welcome_to_WS-Attacks

2. SMARTPHONE: VECTORES DE ATAQUE

2. OWASP MOBILE TOP 10 - 2016

• Incorrecto uso de la plataforma M1 • Inseguridad almacenamiento datos M2 • Comunicación insegura M3 • Autenticación insegura M4 • Insuficiente cifrado M5 • Autorización insegura M6 • Calidad del código M7 • Modificación del código M8 • Ingeniería inversa M9 • Funcionalidad extraña M10

2. HERRAMIENTAS APPS

•  Mobile Security Framework https://github.com/MobSF/Mobile-Security-Framework-MobSF

•  iMAS –iOS Mobile Application https://github.com/project-imas/about

•  QARK https://github.com/linkedin/qark

2. <5 MINUTOS INGENIERÍA INVERSA

2. MOBSF

2. RECURSOS APPS

•  OWASP Mobile Security Testing Guide https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide

•  NIST Special Publication 800-163: Vetting the Security of Mobile Applications http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-163.pdf

•  NIST Mobile Threat Catalog https://pages.nist.gov/mobile-threat-catalogue/

2. ACCIONES ADICIONALES

•  Programa de gestión de incidentes/vulnerabilidades

•  Programa de “Bug Bounty” •  Mozilla, Facebook, Yahoo,

Google, Reddit, Square, Microsoft, Riot Games, etc.

3. CONCLUSIONES

•  Proteger el software es posible, pero requiere trabajo

•  Es obligatorio implantar un marco de desarrollo seguro •  Eliminar y mitigar bugs

•  Metodología

•  Inversión SÍ, gasto NO

Q&A

•  ¡Gracias!

•  ¡Cervezas y copas son bienvenidas!

•  @simonroses •  @vulnexsl

•  www.vulnex.com •  www.simonroses.com