Security. https://outflux.net/slides/2015/osu-devops.pdf. DevOps Bootcamp, OSU, Feb 2015 Kees Cook (pronounced Case )

Similar documents
Sirindhorn International Institute of Technology Thammasat University

Man in the middle attack on TextSecure Signal. David Wind IT SeCX 2015

Man In The Middle Project completed by: John Ouimet and Kyle Newman

Expedition. Hardening Guide Version Palo Alto Networks, Inc.

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Let s Encrypt Apache Tomcat * * Full disclosure: Tomcat will not actually be encrypted.

Configuring OpenVPN on pfsense

Ethical Hacking as a Professional Penetration Testing Technique ISSA Southern Tier & Rochester Chapters

Man in the Middle Attacks and Secured Communications


Overview of SSL/TLS. Luke Anderson. 12 th May University Of Sydney.

TIBCO Cloud Integration Security Overview

OSM Hackfest Installation and first use. Gerardo García (Telefónica)

iptables and ip6tables An introduction to LINUX firewall

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

CPSC 467: Cryptography and Computer Security

PKI Quick Installation Guide. for PacketFence version 7.4.0

Legacy of Heartbleed: MITM and Revoked Certificates. Alexey Busygin NeoBIT

Securing Apache Tomcat. AppSec DC November The OWASP Foundation

SECURITY STORY WE NEVER SEE, TOUCH NOR HOLD YOUR DATA

Exercises: Basics of Networking II Experiential Learning Workshop

CLEO VLTrader Made Simple Guide

Firewall. Laboratory for the class Computer system security (02KRQ) Politecnico di Torino AA 2018/19 Prof. Antonio Lioy

This material is based on work supported by the National Science Foundation under Grant No

OWASP Thailand. Proxy Caches and Web Application Security. OWASP AppSec Asia October 21, Using the Recent Google Docs 0-Day as an Example

Crypto Programming with OpenSSL. (Creating Certificates)

U.S. E-Authentication Interoperability Lab Engineer

Scan Report Executive Summary

Scan Report Executive Summary

Linux Systems Security. Firewalls and Filters NETS1028 Fall 2016

CPSC 467b: Cryptography and Computer Security

But where'd that extra "s" come from, and what does it mean?

Public-Key Infrastructure (PKI) Lab

Load Balancing Bloxx Web Filter. Deployment Guide v Copyright Loadbalancer.org

Load Balancing Nginx Web Servers with OWASP Top 10 WAF in AWS

Featuring. and. Göteborg. Ulf Larson Thursday, October 24, 13

Dip Your Toes in the Sea of Security. James Titcumb PHP Dorset 2nd June 2014

A framework to 0wn the Web - part I -

PiranaJS installation guide

Exercises: Basics of Network Layer Experiential Learning Workshop

Ansible Tower Quick Setup Guide

Man-In-The-Browser Attacks. Daniel Tomescu

Installing and Configuring VMware Identity Manager Connector (Windows) OCT 2018 VMware Identity Manager VMware Identity Manager 3.

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Cryptographic Protocols 1

Web Application Firewall Getting Started Guide. September 7, 2018

Security. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Basic Linux Desktop Security. Konrad Rosenbaum this presentation is protected by the GNU General Public License version 2 or any newer

Agility2018-TCPdump Documentation

How to Secure SSH with Google Two-Factor Authentication

MSE System and Appliance Hardening Guidelines

SSL/TLS Deployment Best Practices

Scan Report Executive Summary. Part 2. Component Compliance Summary Component (IP Address, domain, etc.):

Load Balancing Nginx Web Servers with OWASP Top 10 WAF in Azure

n Learn about the Security+ exam n Learn basic terminology and the basic approaches n Implement security configuration parameters on network

How to Setup Total Application Security

Definition of firewall

Defeating All Man-in-the-Middle Attacks

PracticeDump. Free Practice Dumps - Unlimited Free Access of practice exam

Basic Linux Security. Roman Bohuk University of Virginia

DPI-SSL. DPI-SSL Overview

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Managing CX Devices in Multiple Device Mode

Distributed Systems Security

CNIT 121: Computer Forensics. 9 Network Evidence

Man in the middle. Bởi: Hung Tran

Paranoid Penguin Using iptables for Local Security

Securing Internet Communication: TLS

Once all of the features of Intel Active Management Technology (Intel

SSL/TLS & 3D Secure. CS 470 Introduction to Applied Cryptography. Ali Aydın Selçuk. CS470, A.A.Selçuk SSL/TLS & 3DSec 1

SSH and keys. Network Startup Resource Center

Evaluating the Security Risks of Static vs. Dynamic Websites

Security Specification

Web Authentication Proxy Configuration Example

When providing a native mobile app ruins the security of your existing web solution. CyberSec Conference /11/2015 Jérémy MATOS

MODERN WEB APPLICATION DEFENSES

System Configuration. The following topics explain how to configure system configuration settings on Firepower Management Centers and managed devices:

Server Certificate Validation

PVS Deployment in the Cloud. Last Updated: June 17, 2016

Numerics. Index 1. SSH See SSH. connection inactivity time 2-3 console, for configuring authorized IP managers 11-5 DES 6-3, 7-3

Good Fences Make Good Neighbors: Rethinking Your Cloud Selection Strategy

Assignment 3 Firewalls

WHITE PAPER. ENSURING SECURITY WITH OPEN APIs. Scott Biesterveld, Lead Solution Architect Senthil Senthil, Development Manager IBS Open APIs

CS 716: Introduction to communication networks. Instructor: Sridhar Iyer Demo by: Swati Patil IIT Bombay

Hacker Academy Ltd COURSES CATALOGUE. Hacker Academy Ltd. LONDON UK

Intro to OpenFlow Tutorial

SharkFest 17 Europe. SSL/TLS Decryption. uncovering secrets. Wednesday November 8th, Peter Wu Wireshark Core Developer

How to Enable Client Certificate Authentication on Avi

CPM Quick Start Guide V2.2.0

ArcGIS Enterprise Security: An Introduction. Randall Williams Esri PSIRT

Exercises Basics of Web Security Experiential Learning Workshop

Install the ExtraHop session key forwarder on a Windows server

Protecting MySQL network traffic. Daniël van Eeden 25 April 2017

This document describes the configuration of Secure Sockets Layer (SSL) decryption on the FirePOWER Module using ASDM (On-Box Management).

IERG Term 2 Tutorial 9

HTTPS Setup using mod_ssl on CentOS 5.8. Jeong Chul. tland12.wordpress.com. Computer Science ITC and RUPP in Cambodia

Bitnami Re:dash for Huawei Enterprise Cloud

SECRETS OF THE ENCRYPTED INTERNET: WORLDWIDE CRYPTOGRAPHIC TRENDS

Dell EMC ME4 Series vsphere Client Plug-in

Transcription:

https://outflux.net/slides/2015/osu-devops.pdf, Feb 2015 Kees Cook <kees@outflux.net> (pronounced Case )

Who is this guy? Fun: DefCon CTF team won in 2006 & 2007 Debian Ubuntu Jobs: OSDL (proto Linux Foundation) Canonical (Ubuntu ) Google (Chrome OS ) 2/34

Agenda Supplement last week's topics updates Threat models Finding vulnerabilities Secure communication SSL model Attackers Exercise 3/34

updates: do it Keeping systems secure: Follow principles of least privilege Promptly install latest security updates Everything else 4/34

updates: stay educated Find out where to learn more Find a mailing list e.g. Ubuntu's security update mailing list https://lists.ubuntu.com/mailman/listinfo/ubuntu-securityannounce Find a blog e.g. Chrome's release update blog http://googlechromereleases.blogspot.com/ I should upgrade 5/34

updates: even the kernel Installed a kernel update? Reboot! If this is annoying, then your production environment is not robust enough. Make reboots an expected part of the design and/or schedule: Load balancers? Scheduled downtime? 6/34

Threat models: attribution Who is the attacker? Purpose Vandalism Personal gain Funding Individuals tend not to be well funded Highly funded: state actors, corporations 7/34

Threat models: targeting Why is the attack happening? Scatter shot Vulnerable software version Personal Looking for specific information 8/34

Finding vulnerabilities: timeline What to DO if you discover a vulnerability Excellent summary on disclosure procedure Keep in mind, it's your discovery Communicate a desired timeline Linux kernel uses max 5 working days Google Project Zero uses max 90 days Adobe and others have gone months, if not years 9/34

Finding vulnerabilities: go looking What to do IF you discover a vulnerability How about when you discover Test everything Service monitoring Easy refactoring Fewer bugs flaws are just bugs, right? 10/34

Secure Communication: interception Most control over the server, service, etc Less control over the client Virtually zero control over communication path Alice Bob Mallory 11/34

Secure Communication: testing Encryption works, but only when done right Done right requires testing 12/34

Secure Communication: https Encryption built between TCP and HTTP http://httpd.apache.org/docs/2.4/ssl/ssl_intro.html Generally called SSL, strictly speaking it's TLS Trust via browser's Certificate Authority list 13/34

Secure Communication: SSL Cryptographic chain of trust Using https://outflux.net/ as an example... 14/34

Secure Communication: SSL Trust tied to domain names 15/34

Exercise: Programmatic https Demo website Log into server environment Watch some network interception tools Write some Python to perform: HTTP HTTP with authentication HTTPS with authentication Verified HTTPS with authentication 16/34

demo website http://outflux.net/osu/devops/ User: class Password: omgworstpassword 17/34

environment Log into my EC2 instance Username: class Password: osu-devops ssh class@osu-devops.outflux.net ECDSA key fingerprint is ae:9b:ed:87:72:b5:0c:4d:97:ef:d6:ac:56:72:a4:65. RSA: ef:e4:88:fe:16:66:7f:b3:6a:31:ed:75:dd:c8:5f:3e Please don't step on each other mkdir your-nick-here cd your-nick-here 18/34

simple HTTP fetch Create devops-test.py with an editor Run with: python devops-test.py #!/usr/bin/env python import urllib2 url = 'http://outflux.net/osu/devops/data.txt' request = urllib2.request(url) response = urllib2.urlopen(request) html = response.read() print html, 19/34

simple network interception We can watch network traffic with tcpdump: tcpdump -i eth0 -p port 80 20/34

HTTP fetch with authentication 21/34

decoded network interception We can watch decoded network traffic with wireshark's command line tshark tool: tshark -i eth0 -Y "http or ssl" \ -z "proto,colinfo,http.authbasic,http.authbasic" 22/34

HTTPS fetch with authentication 23/34

intercept: transparent proxy setup tshark not very useful any more I've set up a transparent MitM proxy, mitmproxy sysctl -w net.ipv4.ip_forward=1 echo 0 sudo tee \ /proc/sys/net/ipv4/conf/*/send_redirects iptables -t nat -A OUTPUT! -o lo \ -m owner --uid-owner 1001 -p tcp --dport 80 \ -j REDIRECT --to-port 8080 iptables -t nat -A OUTPUT! -o lo \ -m owner --uid-owner 1001 -p tcp --dport 443 \ -j REDIRECT --to-port 8080 24/34

intercept: mitmproxy Added some code to decode base64 of HTTP Basic Auth, otherwise stock: mitmproxy -T -p 8080 --host \ --anticache -s decode_basic.py 25/34

Guess what? urllib2 is broken. Prior to Python 2.7.9 (Dec 10, 2014), there was no sane way to get urllib2 to perform correct SSL verification of Certificate Chain nor host name checking! To quote from the Python documentation at https://docs.python.org/2/library/httplib.html#httplib.ht TPSConnection class httplib.httpsconnection Changed in version 2.7.9: context was added. This class now performs all the necessary certificate and hostname checks by default. To revert to the previous, unverified, behavior ssl._create_unverified_context() can be passed to the context parameter. 26/34

Python curl (no verify) #!/usr/bin/env python import pycurl url = 'https://outflux.net/osu/devops/secret/data.txt' curl = pycurl.curl() curl.setopt(pycurl.ssl_verifypeer, 0) curl.setopt(pycurl.ssl_verifyhost, 0) curl.setopt(pycurl.userpwd, 'class:omgworstpassword') curl.setopt(pycurl.url, url) curl.perform() 27/34

Python curl (verified) 28/34

Why is traffic still decrypted? mitmproxy can still see traffic contents pycurl test script thinks there is no problem SSL clients need to do two things: Check Certificate Trust Chain Check Certificate host name 29/34

Let's look at the Certificate $ echo QUIT openssl s_client \ -connect outflux.net:443... Certificate chain 0 s:/cn=www.outflux.net i:/cn=mitmproxy/o=mitmproxy 1 s:/cn=mitmproxy/o=mitmproxy i:/cn=mitmproxy/o=mitmproxy... 30/34

Where is the Trusted Cert list? $ strace -e trace=file./https-auth-curl.py 2>&1 \ grep open egrep 'crt pem' open("/etc/ssl/certs/ca-certificates.crt", O_RDONLY) = 5 $ grep BEGIN \ /etc/ssl/certs/ca-certificates.crt \ wc -l 169 31/34

Use Certificate Pinning 32/34

Test finally notices MitM Tiny certificate chain (only the 2 needed certificates) Changing host names is left as an additional exercise. Hint: add redirected IP addresses in /etc/hosts for the target server 33/34

Questions? https://outflux.net/slides/2015/osu-devops.pdf kees@{outflux.net,debian.org,ubuntu.com} keescook@{google.com,chromium.org} 34/34