Network Security. Network Scanning



Similar documents
Port Scanning. Objectives. Introduction: Port Scanning. 1. Introduce the techniques of port scanning. 2. Use port scanning audit tools such as Nmap.

An Introduction to Nmap with a Focus on Information Gathering. Ionuț Ambrosie

Network Security. Network Packet Analysis

CIT 380: Securing Computer Systems

Nmap Cookbook The fat-free guide to network scanning

Network Host Discovery and Service Detection Tools

Scanning Tools. Scan Types. Network sweeping - Basic technique used to determine which of a range of IP addresses map to live hosts.

Lecture 5: Network Attacks I. Course Admin

Host Discovery with nmap

Port Scanning and Vulnerability Assessment. ECE4893 Internetwork Security Georgia Institute of Technology

Host Fingerprinting and Firewalking With hping

Nmap: Scanning the Internet

Stop that Big Hack Attack Protecting Your Network from Hackers.

Network and Services Discovery

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Introduction. Nmap from an Ethical Hacker's View Part 1. By Kirby Tucker

Penetration Testing. NTS330 Unit 1 Penetration V1.0. February 20, Juan Ortega. Juan Ortega, juaorteg@uat.edu. 1 Juan Ortega, juaorteg@uat.

Firewalls. Chapter 3

NETWORK SECURITY WITH OPENSOURCE FIREWALL

Linux Network Security

Penetration Testing. What Is a Penetration Testing?

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

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

Attack and Defense Techniques

Chapter 6 Phase 2: Scanning

Advanced Network Scanning

Attacks and Defense. Phase 1: Reconnaissance

Practical Network Forensics

Remote Network Analysis

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

A host-based firewall can be used in addition to a network-based firewall to provide multiple layers of protection.

Firewall Firewall August, 2003

CS2107 Introduction to Information and System Security (Slid. (Slide set 8)

INTRODUCTION TO FIREWALL SECURITY

Looking for Trouble: ICMP and IP Statistics to Watch

Algorithms and Techniques Used for Auto-discovery of Network Topology, Assets and Services

SonicOS 5.9 / / 6.2 Log Events Reference Guide with Enhanced Logging

Keywords Vulnerability Scanner, Vulnerability assessment, computer security, host security, network security, detecting security flaws, port scanning.

Chapter 5. Figure 5-1: Border Firewall. Firewalls. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall

Network Traffic Analysis

Network Security. Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT)

During your session you will have access to the following lab configuration. CLIENT1 (Windows XP Workstation) /24

Secure Network Access System (SNAS) Indigenous Next Generation Network Security Solutions

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

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

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

General Network Security

Cisco Configuring Commonly Used IP ACLs

Intrusion Detection & SNORT. Fakrul Alam fakrul@bdhbu.com

Configure a Microsoft Windows Workstation Internal IP Stateful Firewall

Presented By: Holes in the Fence. Agenda. IPCCTV Attack. DDos Attack. Why Network Security is Important

Network Terminology Review

Network Scanning. What is a Network scanner? Why are scanners needed? How do scanners do? Which scanner does the market provide?

SECURITY TOOLS SOFTWARE IN AN OPEN SOURCE ENVIRONMENT. Napoleon Alexandru SIRETEANU *

Network Security CS 192

Lab 2. CS-335a. Fall 2012 Computer Science Department. Manolis Surligas

Penetration Testing SIP Services

Introduction to Network Security Lab 2 - NMap

FIREWALLS. Firewall: isolates organization s internal net from larger Internet, allowing some packets to pass, blocking others

Configuring a Backup Path Test Using Network Monitoring

Denial Of Service. Types of attacks

Network Security: Workshop. Dr. Anat Bremler-Barr. Assignment #2 Analyze dump files Solution Taken from


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

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

CYBER ATTACKS EXPLAINED: PACKET CRAFTING

Firewalls. Test your Firewall knowledge. Test your Firewall knowledge (cont) (March 4, 2015)

How To Understand A Network Attack

IxLoad-Attack: Network Security Testing

Chapter 8 Security Pt 2

Best Practices Guide: Vyatta Firewall. SOFTWARE-BASED NETWORKING & SECURITY FROM VYATTA February 2013

HP Intelligent Management Center v7.1 Network Traffic Analyzer Administrator Guide

IBM. Vulnerability scanning and best practices

Exam Name: Foundry Networks Certified Layer4-7 Professional Exam Type: Foundry Exam Code: FN0-240 Total Questions: 267

Securing Networks with PIX and ASA

WhatsUpGold. v3.0. WhatsConnected User Guide

CSCE 465 Computer & Network Security

ACP ThinManager Tech Notes Troubleshooting Guide

Network Mapper and Vulnerability Scanning

Lab Configuring Access Policies and DMZ Settings

- Basic Router Security -

Lab Objectives & Turn In

Network Forensics: Detection and Analysis of Stealth Port Scanning Attack

Computer forensics

Learn Ethical Hacking, Become a Pentester

Unix System Administration

Security Technology White Paper

Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

Using WhatsUp IP Address Manager 1.0

60467 Project 1. Net Vulnerabilities scans and attacks. Chun Li

CUSTOMIZED ASSESSMENT BLUEPRINT COMPUTER SYSTEMS NETWORKING PA. Test Code: 8148 Version: 01

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

co Characterizing and Tracing Packet Floods Using Cisco R

Installing and Configuring Nessus by Nitesh Dhanjani

Chapter 8 Phase3: Gaining Access Using Network Attacks

Lab 3: Recon and Firewalls

H3C Firewall and UTM Devices DNS and NAT Configuration Examples (Comware V5)

How do I get to

Web Authentication Proxy on a Wireless LAN Controller Configuration Example

Transcription:

Network Security Network Scanning Module 2 Keith A. Watson, CISSP, CISA IA Research Engineer, CERIAS kaw@cerias.purdue.edu 1

Network Scanning Definition: Sending packets configured to evoke a response from the target system; the result or lack of result is used to infer the configuration of the target. 2

Overview Scanning What, Why and Where Considerations nmap and other tools nmap features host discovery port states scan types output Exercises 3

Why scan? Network scanning is useful in determining the devices that exist in a network: Desktops, servers, laptops Routers, managed switches, firewalls Wireless access points Network monitoring and log collection systems Network printers and print servers IP-accessible CD-ROM drive arrays ipod Touch, iphone, Zune devices Apple Time Capsules and Airport Expresses Roku, Tivo, MythTV, Wii, Xbox, PlayStation Building and Access Management, IP cameras 4

Why scan? Network scanning is useful to determine what services exist on a network: File services (CIFS, SMB, Appletalk, NFS, FTP) Infrastructure (DHCP, DNS, Bootp, TFTP, SNMP) Authentication (AD services, LDAP, Kerberos) Remote Access (VPN, SSH, Remote Desktop) Printer and Scanner Sharing Web-based interfaces (printers, firewalls, WAPs) Peer-to-Peer file sharing Network game servers Backdoors 5

What do we scan? Specific systems Examine new systems placed on the network Verify network service configuration Re-check network service configuration Examine existing systems for changes in config Network segments Scan all systems on specific networks (lab, classroom, admin, test networks, DMZ) Scan the entire network space to look for rogue systems 6

From where do we scan? The position from which you scan can change the results Firewalls From inside, you will see more information From outside, you should see very little Routers w/acls If you are not scanning across ACLs, you will see more Scanning from multiple positions in the network will give you a better picture of the network security configuration 7

Things to Consider Network scanning can harm your network At least temporarily... Older systems may crash or hang Building management systems may do weird stuff The network performance may be impacted Network devices may drop packets Systems may generate significant amounts of log messages ID systems should be alerting when scans occur You probably shouldn t be scanning at peak times of network operation 8

Tools Available nmap, version 5 ipod Touch / iphone tools Net Scan ($0.99) inet ($3.99) Network Utility (Pro version: $0.99) iportscan PRO ($0.99) Portscan ($1.99) Mac: Network Utility application hping3 BackTrack bundled tools 9

nmap features multiple host discovery methods multiple scan methods service and version detection OS detection intrusion detection evasion techniques setting source port (20, 53, 67, 88), randomization performance tuning scripting engine runtime feedback multiple output types (txt, XML, l33t, grep) 10

nmap interfaces Command line nmap is designed to be used from the CLI all options and modes can be specified Graphical User Interface Zenmap is a GUI interface for nmap There are others but they are older, may not work 11

nmap target selection Targets can be IP addresses, hostnames, FQDNs, networks Listed as the last parameters on CLI Examples poly-server.cerias.purdue.edu purdue.edu/24 128.10.247.10,128.10.247.20,128.10.246.0/24 128.10.247-250.1-254 Use -il <file> to read targets from a <file> Use --exclude <host1>[,<host2>,...<hostn>] to exclude specific targets 12

nmap host discovery Host discovery is the process of determining what systems are on the network What s the traditional method for determining if a system is on the network? Ping (ICMP, Echo Request) nmap has additional methods 13

Ping Example Source Target ICMP Echo Request ICMP Echo Reply 14

nmap host discovery Host discovery is necessary to avoid scanning dead IP addresses where no system is responding for that address Proper host discovery can shorten large address range scans Using a UDP echo request (ping) may not be effective if the system s firewall blocks them Other nmap host discovery methods may be necessary 15

nmap host discovery Disable ping (-PN) Skips host discovery entirely List scan (-sl) Performs reverse DNS lookup Gets a target list Ping scan (-sp) Reports responding hosts only Uses ping, TCP SYN to port 443, TCP ACK to port 80, ICMP timestamp request to find hosts 16

nmap host discovery TCP SYN ping (-PS <portlist>) SYN sent to specified ports (default: 80) Host is up if SYN/ACK or RST received TCP ACK ping (-PA <portlist>) ACK sent to specified ports (default: 80) Host is up if RST received UDP ping (-PU <portlist>) Empty UDP packet sent to specified ports (default: 40125) Host is up if ICMP port unreachable received 17

TCP Connection Establishment Source Target SYN SYN+ACK ACK 18

SYN Ping Source Target SYN SYN+ACK Target is Up! 19

SYN Ping Source Target SYN RST Target is Up! 20

SYN Ping Source Target SYN Target is Down 21

nmap host discovery SCTP INIT ping (-PY <portlist>) Sends SCTP INIT packet to specified ports (default: 80) Host is up if any response received ICMP ping types (-PE, -PP, -PM) -PE is an echo request -PP is a timestamp request -PM is a address mask request Host is up if any ICMP reply received 22

nmap host discovery IP Protocol ping (-PO <protocollist>) Sends a packet with the specified protocol number in the header (default: send packets for ICMP, IGMP, IP-in-IP) Host is up if any response received ARP ping (-PR) Sends an ARP request on the local ethernet network Host is up if any response received Other ping methods are not used 23

nmap host discovery Common ports to use in host discovery Windows: TCP/135, UDP/137, UDP/138, TCP/139, TCP&UDP/445, TCP&UDP/1025-1030, TCP/3389 UNIX: TCP/21, TCP/22, TCP/23, TCP/25, UDP/53, TCP/80, TCP&UDP/111, UDP/161, UDP/514 Network devices: TCP/22, TCP/23, UDP/53, UDP/ 67-68, TCP/80, TCP/443, UDP/161 Bottom line: Unless your host is blocking standard ICMP pings, you can stick to the default host discovery methods 24

nmap port states open Accepts TCP, UDP, SCTP connections closed Responds but no application is listening filtered Little info available to determine actual state Firewalls may be dropping probes unfiltered Port accessible, but state cannot be determined Reported by ACK; other scans needed 25

nmap port states open filtered Unable to determine if port is open or filtered Reported by UDP, IP Protocol, FIN, NULL, Xmas closed filtered Unable to determine if port is closed or filtered Reported by IP ID idle 26

nmap scan modes TCP SYN scan (-ss) Starts TCP three-way handshake Open if a SYN/ACK received Closed if RST received Filtered if ICMP error or no response received TCP connect scan (-st) Opens TCP connection, sends no data Uses OS libraries to determine state 27

nmap scan modes UDP scan (-su) Sends empty UDP packet Closed if ICMP port unreachable received Filtered if other ICMP received Open filtered if there is no response Scan can be very slow, due to timeout periods SCTP INIT scan (-sy) Sends an empty SCTP INIT chunk Open if INIT-ACK received Closed if ABORT received Filtered if ICMP error or no response received 28

nmap scan modes NULL scan (-sn) Sends TCP packet with no header bits set FIN scan (-sf) Sends TCP packet with FIN set Xmas scan (-sx) Sends TCP packet with FIN, PSH, URG set Responses to NULL, FIN, Xmas: Closed is RST received Filtered is ICMP error received Open Filtered with no response 29

nmap scan modes TCP Window (-sw) and Maimon (-sm) scans Rely on implementation details in specific systems IP Protocol scans (-so) Determines what IP protocols are supported FTP Bounce scans (-b <ftprelay>) Old FTP server bug Idle scan (-si <zombie>) Can map out trust relationships between systems Custom TCP scan (--scanflags) Generate packets with specific headers flags 30

nmap port specification Port numbers are associated with specific network services or applications (1-65535) Most port number assignments are fixed Assigned by IANA Without specifying ports, nmap choose the 1000 most common ports to scan for each protocol 31

nmap port specification Specify additional ports with -p option -p- or -p1-65535 -p U:53,137,161,T:21,22,25,80,443,8080 Fast scan (-F) Scans only 100 common ports Avoid port randomization (-r) Scan port numbers in order 32

nmap fingerprint modes nmap attempts to detect the OS version based on fingerprinting the TCP stack Quirks and implementation details can be evaluated and compared against a database of known TCP stack implementations OS detection (-O) 33

Other options/features Service and Version detection (-sv) Attempts to determine the versions of software Timing and Performance options Retries, timeouts, delays, rate limiting, scan rates Scripting Engine Includes library of scan functions Write your own scripts Firewall/IDS Evasion and Spoofing Attempts bypass firewalls Attempts to avoid intrusion detection systems 34

nmap output example 1 golgafrincham:~ admin$ sudo nmap -sp dis Starting Nmap 5.00 ( http://nmap.org ) at 2009-11-05 14:34 EST Host 128.10.247.70 is up (0.00015s latency). MAC Address: 00:11:43:A0:98:42 (Dell) Nmap done: 1 IP address (1 host up) scanned in 16.61 seconds 35

nmap output example 2 golgafrincham:~ admin$ sudo nmap -ss dis Starting Nmap 5.00 ( http://nmap.org ) at 2009-11-05 14:23 EST Interesting ports on 128.10.247.70: Not shown: 998 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 00:11:43:A0:98:42 (Dell) Nmap done: 1 IP address (1 host up) scanned in 17.08 seconds 36

nmap output example 3 golgafrincham:~ admin$ sudo nmap -O milliways Starting Nmap 5.00 ( http://nmap.org ) at 2009-11-05 14:38 EST Interesting ports on 128.10.247.50: Not shown: 996 filtered ports PORT 22/tcp STATE SERVICE open ssh 9101/tcp open jetdirect 9102/tcp open jetdirect 9103/tcp open jetdirect MAC Address: 00:B0:D0:DB:A5:56 (Dell Computer) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running: FreeBSD 7.X OS details: FreeBSD 7.0-RELEASE-p1-7.1-RELEASE Network Distance: 1 hop 37

saving nmap output nmap output can be saved as Text (default): -on <file> XML: -ox <file> l33t: -os <file> Grepable: -og <file> All at once: -oa <basename> Verbose output (-v) Debugging (-d <level>) many others too... 38

nmap output differencing Differencing provides a method to see changes over time golgafrincham:~ admin$ ndiff yesterday.xml today.xml -Nmap 5.00 at 2009-11-05 14:59 +Nmap 5.00 at 2009-11-05 15:01 128.10.247.50, 00:B0:D0:DB:A5:56: -Not shown: 999 filtered ports +Not shown: 998 filtered ports PORT STATE SERVICE VERSION +23/tcp open telnet 39

I hate command lines... nmap includes a GUI tool called Zenmap It is a simple interface for constructing the command line options for nmap Notice that as you choose options, the command line listed changes The Zenmap output is the same as nmap It s a learning tool for nmap parameters For our exercises you can use which ever tool you are comfortable with 40

Let s get started... Boot up BackTrack if you haven t already OR Install nmap on your machine Connect to the exercise network 41

Exercise 1 Using Zenmap or nmap do a SYN scan on 192.168.1.20 What ports are open? 42

Exercise 2 Use Zenmap or nmap to do an OS detection scan against 192.168.1.25 What operating system does this machine have? 43

Exercise 3 Scan targets in the range of 192.168.1.20-26 Choose any scan method What OSs are used? What services are available? With everyone scanning at once watch for and note network side effects? 44

Exercise 4 Experiment with Zenmap and nmap Any IP on 192.168.1.0 is a target Attempt different scan modes and attempt to determine the OS and ports open/closed 45

End of Module 2 Questions? 46