Don't Get Owned at DEF CON



Similar documents
Firewall Piercing. Alon Altman Haifa Linux Club

Lab Objectives & Turn In

Definition of firewall

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Load Balancing SIP Quick Reference Guide v1.3.1

Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Linux firewall. Need of firewall Single connection between network Allows restricted traffic between networks Denies un authorized users

Network Security. Routing and Firewalls. Radboud University Nijmegen, The Netherlands. Autumn 2014

Netfilter. GNU/Linux Kernel version 2.4+ Setting up firewall to allow NIS and NFS traffic. January 2008

Firewalls. Chien-Chung Shen

Firewall Examples. Using a firewall to control traffic in networks

Exam Questions SY0-401

Virtual Private Networks

TELE 301 Network Management. Lecture 16: Remote Terminal Services

Security in IPv6. Basic Security Requirements and Techniques. Confidentiality. Integrity

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Linux Routers and Community Networks

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Firewall Troubleshooting

Generalized Single Packet Authorization for Cloud Computing Environments

Michal Ludvig, SUSE Labs, 01/30/2004, Secure networking, 1

+ iptables. packet filtering && firewall

Linux Networking: IP Packet Filter Firewalling

Corporate VPN Using Mikrotik Cloud Feature. By SOUMIL GUPTA BHAYA Mikortik Certified Trainer

Load Balancing Clearswift Secure Web Gateway

Protocol Security Where?

Linux Administrator (Advance)

Linux Firewall. Linux workshop #2.

Linux: 20 Iptables Examples For New SysAdmins

Parallels Plesk Panel. VPN Module for Parallels Plesk Panel 10 for Linux/Unix Administrator's Guide. Revision 1.0

A Stateful Inspection of FireWall-1

How To Understand A Firewall

FIREWALL AND NAT Lecture 7a

Load Balancing Trend Micro InterScan Web Gateway

Assignment 3 Firewalls

PIX/ASA: Allow Remote Desktop Protocol Connection through the Security Appliance Configuration Example

Controlling Ashly Products From a Remote PC Location

Príprava štúdia matematiky a informatiky na FMFI UK v anglickom jazyku

Configuring an IPsec VPN to provide ios devices with secure, remote access to the network

Secure Network Filesystem (Secure NFS) By Travis Zigler

Netfilter / IPtables

How to Tunnel Remote Desktop Through SSH on a Windows Computer

APNIC elearning: IPSec Basics. Contact: esec03_v1.0

Internet infrastructure. Prof. dr. ir. André Mariën

Firewalls. Firewall types. Packet filter. Proxy server. linux, iptables-based Windows XP s built-in router device built-ins single TCP conversation

Internet Firewall CSIS Internet Firewall. Spring 2012 CSIS net13 1. Firewalls. Stateless Packet Filtering

ELEN 689: Topics in Network Security: Firewalls. Ellen Mitchell Computing and Information Services 20 April 2006

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

Free Dynamic DNS account you can use one of your choosing I like DynDNS but there's also No-IP and probably others.

Focus on Security. Keeping the bad guys out

Defeating Firewalls : Sneaking Into Office Computers From Home

Firewalls, Tunnels, and Network Intrusion Detection. Firewalls

Firewalls, Tunnels, and Network Intrusion Detection

CS155 - Firewalls. Simon Cooper <sc@sgi.com> CS155 Firewalls 22 May 2003

Firewalls. Pehr Söderman KTH-CSC

Load Balancing Smoothwall Secure Web Gateway

Firewalls. October 23, 2015

Load Balancing Bloxx Web Filter. Deployment Guide

Fig : Packet Filtering

Firewalls. configuring a sophisticated GNU/Linux firewall involves understanding

CSCI 4250/6250 Fall 2015 Computer and Networks Security

Lab 3: Recon and Firewalls

CS Computer and Network Security: Firewalls

ΕΠΛ 674: Εργαστήριο 5 Firewalls

Wireless Networks. Welcome to Wireless

How to Secure RHEL 6.2 Part 2

Overview. Author: Seth Scardefield Updated 11/11/2013

CIT 480: Securing Computer Systems. Firewalls

Network Security and Firewall 1

Introduction to Computer Security

Topics in Network Security

Network Traffic Analysis

GL254 - RED HAT ENTERPRISE LINUX SYSTEMS ADMINISTRATION III

NETWORK SECURITY HACKS

Vuurmuur - iptables manager

Security Engineering Part III Network Security. Security Protocols (II): IPsec

IPv6 Network Security.

Network Packet Analysis and Scapy Introduction

PROTECTING DATA IN TRANSIT WITH ENCRYPTION IN M-FILES

Application Note. Onsight TeamLink And Firewall Detect v6.3

Firewall Defaults and Some Basic Rules

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

CS Computer and Network Security: Firewalls

Firewalls. Basic Firewall Concept. Why firewalls? Firewall goals. Two Separable Topics. Firewall Design & Architecture Issues

Configuring Personal Firewalls and Understanding IDS. Securing Networks Chapter 3 Part 2 of 4 CA M S Mehta, FCA

TELE 301 Network Management. Lecture 17: File Transfer & Web Caching

1:1 NAT in ZeroShell. Requirements. Overview. Network Setup

7.1. Remote Access Connection

Load Balancing Sophos Web Gateway. Deployment Guide

Firewalls. ITS335: IT Security. Sirindhorn International Institute of Technology Thammasat University ITS335. Firewalls. Characteristics.

Firewalls. Contents. ITS335: IT Security. Firewall Characteristics. Types of Firewalls. Firewall Locations. Summary

Secure use of iptables and connection tracking helpers

12/8/2015. Review. Final Exam. Network Basics. Network Basics. Network Basics. Network Basics. 12/10/2015 Thursday 5:30~6:30pm Science S-3-028

Guideline for setting up a functional VPN

CIT 480: Securing Computer Systems. Firewalls

Building a Home Gateway/Firewall with Linux (aka Firewalling and NAT with iptables )

Transcription:

Don't Get Owned at DEF CON Single Packet Authorization and SSH Tunneling DEF CON 22 Jay Beale InGuardians

Single Packet Authorization Single packet authorization is an advancement on the port knocking concept. I can set my firewall to allow no incoming connection attempt packets, while allowing myself to SSH in from any IP. Portscans don t show an open port.

Dynamically Open a Port We can send a packet to the firewall to ask it to open up the SSH port for 10 seconds to only our IP. The recipient port doesn't have to be open - the firewall can get the packet from either pcap (sniffing) or Netfilter's ulogd. The recipient machine doesn't even need to exist!

fwknop This concept has been implemented a number of times over the years. This talk looks at one of the longstanding implementations that is most actively maintained: fwknop, by Michael Rash. Rash wrote the No Starch Press Linux firewalls book. Fwknop, the Firewall Knock Operator, grew out of a port knocking solution. http://www.cipherdyne.com/fwknop/

fwknop Basics In its default configuration, the client, fwknop, sends a packet to UDP port 62201 that contains authentication information. The server, fwknopd, is configured to open specific (or all) ports for each user. I configure it to open my SSH port, tcp/19851. Why might I change my SSH port?

Platforms Server runs on: Linux iptables Mac OS X ipfw FreeBSD ipfw OpenBSD PF Client runs on the above operating systems, and also on Windows, Android and jailbroken ios.

fwknop Packet Contains Random Data! Username! Timestamp! Action! Access details (ip, port)! Hash of data (integrity checking)!

Fighting Replay Attacks Replay has always been a weakness in port-knocking.!! Fwknop uses random data to keep packets changing and uses timestamps.!! Fwknopd stores hashes of previous packets, not allowing a repeat packet.!

fwknop Authentication The default configuration uses a shared secret to encrypt the payload. You can also use GPG (free PGP) instead: Client signs to authenticate and encrypts with the server s public key.

Setup Let s set this up for a Linux system that has sshd listening, but has a default-deny firewall rule for TCP port 19851.

fwknop Installation First, compile and install. # tar -xzvf fwknop-*.tar.bz2! # cd fwknop-*! #./configure && make && make install!! (You made need to install gcc or the libpcap-devel RPMs via yum)

Configure Network Interface In /etc/fwknop/fwknopd.conf, add a line with the network interface: PCAP_INTF eth0;! (If you built from source, this file is likely in: /usr/local/etc instead of /etc.)

Configure Server Sniffing If packets are addressed to firewall itself, edit the ENABLE_PCAP_PROMISC line in /etc/fwknop/ fwknopd.conf:! # Set this to no if the knocks will always be destined for this system.! ENABLE_PCAP_PROMISC N;!

Create Keys on the Client $ fwknop -A tcp/19851 -a 192.168.1.1 -D spaserver.domain.com --key-gen --use-hmac -- save-rc-stanza! [+] Wrote Rijndael and HMAC keys to rc file: / home/jay/.fwknoprc!! $ grep KEY /home/jay/.fwknoprc! KEY_BASE64 Sz16sS8BTUsg=! HMAC_KEY_BASE64 1211H3NM5Q==!

Place Keys on the Server Create a shared secret entry in /etc/fwknop/access.conf: SOURCE ANY! REQUIRE_SOURCE_ADDRESS Y! KEY_BASE64 Sz16sS8BTUsg=! HMAC_KEY_BASE64 1211H3NM5Q==!!

Start Server and Test server # fwknopd client # ssh spaserver.domain.com <hangs> client # fwknop -n spaserver.domain.com client # ssh spaserver.domain.com client # iptables-save grep FWKNOP -A FWKNOP_INPUT -s 1.1.1.1/32 -p tcp -m tcp --dport 22 -m comment --comment "_exp_1406882245" -j ACCEPT

fwknop Effect This opens port 19851 to syn packets from our IP for 10 seconds. Rules are added to and removed from the Netfilter FWKNOP_INPUT chain. Watch /var/log/messages.!

fwknop and GPG You can use the power of asymmetric encryption for environments with more than one user. This requires GPG.

Exchange GPG Keys http://www.cipherdyne.com/fwknop/docs/gpghowto.html)! Client $ gpg --gen-key! Client $ gpg -a --export <keyid> > client.asc! Client $ scp client.asc root@server:.! Server # gpg --import client.asc! Server # gpg --edit-key <ClientkeyID>! >sign! >save! Server # gpg --gen-key! Server # gpg -a --export <keyid> > server.asc! Server # scp server.asc user@client:.! Client $ gpg --import server.asc! Client $ gpg --edit-key <ServerkeyID>! >sign! >save!

Configure for GPG Keys Stanza for each user in /etc/fwknop/access.conf:! SOURCE ANY! GPG_REMOTE_ID 7234ABCD! GPG_DECRYPT_ID EBCD1234! GPG_ALLOW_NO_PW Y! REQUIRE_SOURCE_ADDRESS Y! REQUIRE_USERNAME alice! FW_ACCESS_TIMEOUT 30! HMAC_KEY_BASE64 STQ9m03h!

fwnop Fin This is very powerful technology. If you can keep your Internet-accessible services from being accessible to most attackers, they'll never get a shot at them.

SSH SSH has a SOCKS proxy built right in. If I want to encrypt my traffic and get it off the con network, but I haven't yet set up a VPN, I might just use the SOCKS proxy built into SSH. ssh D 31337 p 19851 jay@his_ssh_server

Slides Jay's slides at: www.inguardians.com/defconjay.pdf Larry's WI-FI Village slides at: www.inguardians.com/defconlarry.pdf