Port Knocking for Security. 2010 LearnMikroTik.com 1



Similar documents
Building Effective Firewalls with MikroTik P R E S E N T E D B Y: R I C K F R E Y, N E T W O R K E N G I N E E R I P A R C H I T E C H S O P E R AT I

The Use of Mikrotik Router Boards With Radius Server for ISPs.

Common VoIP problems, How to detect, correct and avoid them. Penny Tone LLC 1

Firewall Examples. Using a firewall to control traffic in networks

Load Balancing Using PCC & RouterOS

Reducing the impact of DoS attacks with MikroTik RouterOS

RouterOS with Radius Server for Android

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

Webinar - MikroTik RouterOS Statefull Firewall Howto

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

» David Bisschoff» Durban, South Africa» Work at Kinsey Computers» Discovered MikroTik in Kinsey Computers cc

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

MikroTik Invisible Tools. By : Haydar Fadel 2014

How To Configure L2TP VPN Connection for MAC OS X client

Firewall Firewall August, 2003

VPN Lesson 2: VPN Implementation. Summary

CS5008: Internet Computing

Evading Infrastructure Security Mohamed Bedewi Penetration Testing Consultant

Virtual Private Networks

High Availability on MikroTik RouterOS

GregSowell.com. Mikrotik Security

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Don't Get Owned at DEF CON

Linux Network Security

MikroTik RouterOS Workshop Load Balancing Best Practice. Warsaw MUM Europe 2012

Load Balancing Using PCC & RouterOS

Firewalls. Chien-Chung Shen

Quality of Service in wireless Point-to-Point Links

NETWORK SECURITY WITH OPENSOURCE FIREWALL

Polycom. RealPresence Ready Firewall Traversal Tips

Load Balance with Masquerade Network on RouterOS. Prepared by: Janis Megis (Mikrotik) Valens Riyadi (Citraweb)

Remote Desktop Gateway. Accessing a Campus Managed Device (Windows Only) from home.

CSE331: Introduction to Networks and Security. Lecture 12 Fall 2006

Skywire TCP Socket Examples

Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

Configuring MassTransit Server to listen on ports less than 1024 using WaterRoof on Macintosh Workstations

Protocol Security Where?

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

Network Security. Network Packet Analysis

Implementation IPV6 in Mikrotik RouterOS. by Teddy Yuliswar

Exam Questions SY0-401

Firewall Testing. Cameron Kerr Telecommunications Programme University of Otago. May 16, 2005

GregSowell.com. Mikrotik Basics

Solution of Exercise Sheet 5

MIKROTIK NETWORK SIMULATOR

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Inside-Out Attacks. Covert Channel Attacks Inside-out Attacks Seite 1 GLÄRNISCHSTRASSE 7 POSTFACH 1671 CH-8640 RAPPERSWIL

Firewall Design Principles

Low cost secure VPN MikroTik SSTP over OpenIXP (Indonesian Internet) ASTA INFORMATICS Faisal Reza

Linux MDS Firewall Supplement

Virtual Private Networks

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

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

Classic IOS Firewall using CBACs Cisco and/or its affiliates. All rights reserved. 1

IP Address: the per-network unique identifier used to find you on a network

Linux Routers and Community Networks

Internet Security Firewalls

MikroTik Certified Network Associate (MTCNA) Training outline

Cornerstones of Security

Overview. Firewall Security. Perimeter Security Devices. Routers

VULNERABILITY ASSESSMENT WHITEPAPER INTRODUCTION, IMPLEMENTATION AND TECHNOLOGY DISCUSSION

Case Study 2 SPR500 Fall 2009

Controlling Ashly Products From a Remote PC Location

Bandwidth Management and QOS

Networking Security IP packet security

CSC574 - Computer and Network Security Module: Firewalls

Firewall VPN Router. Quick Installation Guide M73-APO09-380

Virtual private network. Network security protocols VPN VPN. Instead of a dedicated data link Packets securely sent over a shared network Internet VPN

Lecture 2-ter. 2. A communication example Managing a HTTP v1.0 connection. G.Bianchi, G.Neglia, V.Mancuso

Multi-Homing Dual WAN Firewall Router

School of Information Science (IS 2935 Introduction to Computer Security, 2003)

Definition of firewall

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

Cisco PIX vs. Checkpoint Firewall

Load Balancing SIP Quick Reference Guide v1.3.1

Firewalls & Intrusion Detection

Computer Networks/DV2 Lab

CS 665: Computer System Security. Network Security. Usage environment. Sources of vulnerabilities. Information Assurance Module

Understanding VLAN Translation/Rewrites using Switches and Routers

Inside-Out Attacks. Security Event April 28, 2004 Page 1. Responses to the following questions

General Network Security

FIREWALLS IN NETWORK SECURITY

Network Access Security. Lesson 10

How To Pass The Information And Network Security Certificate

Network Packet Analysis and Scapy Introduction

OS/390 Firewall Technology Overview

CYBER ATTACKS EXPLAINED: PACKET CRAFTING

VPN s and Mobile Apps for Security Camera Systems: EyeSpyF-Xpert

Formación MTCUME. MikroTik Certified User Manager Engineer. Pre-requisitos: - Certificación MTCNA

Linux Networking: IP Packet Filter Firewalling

Lab Objectives & Turn In

Quick Connect. Overview. Client Instructions. LabTech

Networking Basics and Network Security

Lecture 23: Firewalls

Chapter 8 Router and Network Management

Transcription:

Port Knocking for Security 2010 LearnMikroTik.com 1

Introduction Steve Discher - LearnMikroTik.com MikroTik RouterOS training, including MTCNA, MTCRE, MTCTCE, MTCWE and MTCUME Own a WISP 2010 LearnMikroTik.com 2

Introduction Just completed a 10,000 mile, 100 day journey around western USA teaching RouterOS, the MikroTik Road Show 2010 LearnMikroTik.com 3

The Road Show was a 100 day journey that started in College Station, Texas in April Purpose was to travel all over the western US conducting MikroTik RouterOS training in as many locations as possible 2010 LearnMikroTik.com 4

Road Show Stats Miles Traveled: 10,000 by motor home 3,000 by Jeep Fuel Used: 1,111 gals of Diesel Nights on the road: 100 Areas Traveled: 11 US states, 3 islands and 2 Canadian Provinces 2010 LearnMikroTik.com 5

Road Show Stats Trainings Conducted: 5 public, 6 private, consulted with 9 different companies MT Certifications Issued: 35 Look for the next MikroTik Road Show, Summer 2011 www.mtroadshow.com 2010 LearnMikroTik.com 6

Port Knocking for Security 2010 LearnMikroTik.com 7

What is Port Knocking? Port knocking is a method of externally opening ports on a firewall by generating a connection attempt on a set of prespecified series of closed ports 2010 LearnMikroTik.com 8

What is Port Knocking? The port "knock" itself is similar to a secret handshake and can consist of any number of TCP, UDP, or ICMP or other protocol packets to numbered ports on the destination machine 2010 LearnMikroTik.com 9

What is Port Knocking? The knock may also consist of text strings sent to the device being knocked to add additional complexity and security 2010 LearnMikroTik.com 10

Port Knocking Example 1. Send a connection to PORT-1234 2. The router stores the requester s IP for an amount of time 3. Send a connection to PORT-4321 4. The router checks to see if the IP is the same IP from the first connection (PORT-1234) 5. If the IP is the same and the time between 1 st attempt and 2 nd is within a specified time then the requester IP will be allowed to access the router Knocking Port PORT 1234 PORT 4321 2010 LearnMikroTik.com 11

Firewall Chain Review 2010 LearnMikroTik.com 12

Input Chain Input Chain used to process packets entering the router through one of the interfaces with the destination IP address which is one of the router's addresses. Packets passing through the router are not processed against the rules of the input chain. Protects the router itself. 2010 LearnMikroTik.com 13

Forward Chain Forward Chain - used to process packets passing through the router. Protects the clients. 2010 LearnMikroTik.com 14

Output Chain Output Chain used to process packets generated by the router. Packets passing through the router are not processed against the rules of the output chain. 2010 LearnMikroTik.com 15

Port Knocking Strategy 1. Detect a connection to a port and put it in an address list we will name temporary for 10 seconds. 2. Detect a connection to a second port and check to see if the source IP is in the address list temporary. If so, put in the list secured. 3. Allow access to the router from hosts in the address list secured. 2010 LearnMikroTik.com 16

Port Knocking Strategy First Host 12.10.1.3 PORT 1234 Second Host 12.10.1.3 PORT 4321 Router Create Address List Entry temporary 12.10.1.3 for 10 secs FW Rule: If 12.10.1.3 is in temporary, add to secured 2010 LearnMikroTik.com 17

Address Lists If you have not used Address Lists in RouterOS before, you are missing a great way to reduce the number of rules in your firewall and create a much more extensible firewall device Let s take a look at Address Lists 2010 LearnMikroTik.com 18

Address Lists 2010 LearnMikroTik.com 19

Address Lists 2010 LearnMikroTik.com 20

Address Lists 2010 LearnMikroTik.com 21

Address Lists 2010 LearnMikroTik.com 22

Port Knocking Strategy 1. Detect a connection to a port and put in an address list entry temporary for 10 seconds. 2. Detect a connection to a second port and check to see if the source IP is in the address list temporary. If so, put in the list secured. 3. Allow access to the router from hosts in the address list secured. 2010 LearnMikroTik.com 23

Configuration Step 1 2010 LearnMikroTik.com 24

Configuration Step 1 2010 LearnMikroTik.com 25

Configuration Step 1 Trap TCP(1234) and put the source address to address-list temporary for 10 seconds Spectrum indonesia 26 2010 LearnMikroTik.com 26

Configuration Step 2 Trap TCP(4321) and src-address is in temporary. Put it to address-list secured 2010 LearnMikroTik.com 27

Configuration Step 3 Allow access from src-address-list secured 2010 LearnMikroTik.com 28

Configuration Step 4 Drop everything else 2010 LearnMikroTik.com 29

Configuration Summary 2010 LearnMikroTik.com 30

Generating The Knock To generate the knock you need a client. There are numerous clients for download for Windows, Linux or Mac. Knock.exe http://www.zeroflux.org/proj/knock/files/knockcygwin.zip Or, build your own! 2010 LearnMikroTik.com 31

Generating The Knock 2010 LearnMikroTik.com 32

Knock Is Complete! 2010 LearnMikroTik.com 33

What s The Effectiveness? Because any combination of ports and transport protocols can be used, the number of possible sequences that an attacker would have to guess is very high. Even if the hacker knew only two port knocks were involved, as in the very simple example above, with 64,000 possible TCP, UDP, and ICMP ports to choose from, the resulting set of possible combinations for the hacker to try runs into the millions. 2010 LearnMikroTik.com 34

What s The Effectiveness? Port scanners will be frustrated because port knocking uses closed ports to do the listening. 2010 LearnMikroTik.com 35

What s The Effectiveness? The biggest advantage of all is that port knocking is platform-, service-, and application-independent: Any OS with the correct client and server software can take advantage of its protection 2010 LearnMikroTik.com 36

What s The Effectiveness? Port knocking can also serve as an extra layer of security to protect high-risk remote management services, such as SSH and RDP. 2010 LearnMikroTik.com 37

What s The Effectiveness? Critics often point to the fact that eavesdropping hackers might be able to capture and replay the successful portknocking sequence or series of bytes. True, but port knocking should be just a layer on top of other types of security such as tunnels, or allowed IP addresses. 2010 LearnMikroTik.com 38

What s The Effectiveness? If a hacker does manage to glean your combination, the worst-case scenario is that the intruder bypasses the portknocking protection and now has to face your normal service security measures. 2010 LearnMikroTik.com 39

Some Ideas Use port knocking to augment existing security such as VPN tunnels. For example, client must knock before you allow VPN connection. Extend port knocking to include sending text passphrases. Client must knock correct ports, correct protocol, correct sequence and send the right string during the sequence. 2010 LearnMikroTik.com 40

Extending Knock - Example Using Autoit (www.autoitscript.com), create an application to send text strings to udp ports in sequence Use Layer 7 rules to watch for strings sent to certain ports Based my firewall filter rules on Layer 7 rules 2010 LearnMikroTik.com 41

Create Knock Client App Step 1 Autoit script: UDPStartup() $socket = UDP Open("10.0.1.1", 1234) $status = UDPSend($socket, "supersecretpassword1") UDPCloseSocket($socket) $socket = UDP Open("10.0.1.1", 4321) $status = UDPSend($socket, "supersecretpassword2") UDPCloseSocket($socket) UDPShutdown() 2010 LearnMikroTik.com 42

Create Layer 7 Rules Step 2 /ipfirewall layer7-protocol add comment="" name=knock1 regexp="^supersecretpassword1\$" add comment="" name=knock2 regexp="^supersecretpassword2\$" 2010 LearnMikroTik.com 43

Create Firewall Rules Step 3 /ipfirewall filter add action=add-src-to-address-list address-list=temporary \ address-list-timeout=10s chain=input comment="" disabled=no dst-port=1234 \ layer7-protocol=knock1 protocol=udp add action=add-src-to-address-list address-list=secured address-list-timeout=\ 10s chain=input com ment="" disabled=no dst-port=4321 layer7-protocol=\ knock2 protocol=udp src-address-list=temporary add action=accept chain=input com ment="" disabled=no src-address-list=secured add action=drop chain=input com ment="" disabled=no 2010 LearnMikroTik.com 44

Demonstration 2010 LearnMikroTik.com 45

Questions? 2010 LearnMikroTik.com 46

Thank You LearnMikroTik.com http://www.learnmikrotik.com info@learnmikrotik.com 2010 LearnMikroTik.com 47