Scanning. Scanning. Goals Useful Tools. The Basics NMAP. Scanning 1 / 34

Similar documents
CIT 480: Securing Computer Systems

INF5290 Ethical Hacking. Lecture 3: Network reconnaissance, port scanning. Universitetet i Oslo Laszlo Erdödi

HP High-End Firewalls

IK2206 Internet Security and Privacy Firewall & IP Tables

Layered Networking and Port Scanning

Table of Contents. 1 Intrusion Detection Statistics 1-1 Overview 1-1 Displaying Intrusion Detection Statistics 1-1

Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning

Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

20-CS Cyber Defense Overview Fall, Network Basics

Module 19 : Threats in Network What makes a Network Vulnerable?

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

Introduction to Network. Topics

A quick theorical introduction to network scanning. 23rd November 2005

HP High-End Firewalls

Security+ Guide to Network Security Fundamentals, Fourth Edition. Network Attacks Denial of service Attacks

Attack Prevention Technology White Paper

CSC 574 Computer and Network Security. TCP/IP Security

Interested in learning more? Global Information Assurance Certification Paper. Copyright SANS Institute Author Retains Full Rights

Network Security. Kitisak Jirawannakool Electronics Government Agency (public organisation)

Different Layers Lecture 20

Scanning. Course Learning Outcomes for Unit III. Reading Assignment. Unit Lesson UNIT III STUDY GUIDE

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

Network Security. Network Vulnerabilities

Dan Boneh, John Mitchell, Dawn Song. Denial of Service

Network concepts introduction & wireshark

Interconnecting Networks with TCP/IP

ch02 True/False Indicate whether the statement is true or false.

Common Network Attacks

CS61C Machine Structures Lecture 37 Networks. No Machine is an Island!

network security s642 computer security adam everspaugh

H3C SecPath Series High-End Firewalls

Configuring attack detection and prevention 1

Network concepts introduction & wireshark. workshop

AN TOÀN LỚP 4: TCP/IP ATTACKS NGUYEN HONG SON PTITHCM

Internet Protocol and Transmission Control Protocol

Dan Lo Department of Computer Science and Software Engineering Southern Polytechnic State University

Packet Header Formats

502 / 504 GATEWAY_TIMEOUT errors when browsing to certain sites

Chapter 8 roadmap. Network Security

Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path. Review of TCP/IP Internetworking

ECE 435 Network Engineering Lecture 10

ICS 351: Networking Protocols

Last lecture we talked about how Intrusion Detection works. Today we will talk about the attacks. Intrusion Detection. Shell code

Nsauditor White Paper. Abstract

Network Vulnerability Scan

Configuring attack detection and prevention 1

Transport Layer (TCP/UDP)

Network Security. Evil ICMP, Careless TCP & Boring Security Analyses. Mohamed Sabt Univ Rennes, CNRS, IRISA Thursday, October 4th, 2018

Payment Card Industry (PCI) Technical Report 11/07/2017

NETWORK SECURITY. Ch. 3: Network Attacks

Global Information Assurance Certification Paper

Nmap & Metasploit. Chun-Jen (James) Chung. Arizona State University

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security. Chapter 8

Volume INFOSEC4FUN/UNIX4FUN DOCS. IT Troubleshooting Documentation. Troubleshooting the Stack

Snort Tuning 101. Nick Moore Sr. Sales Engineer Sourcefire

CSCD58 WINTER 2018 WEEK 6 - NETWORK LAYER PART 1. Brian Harrington. February 13, University of Toronto Scarborough

Basics of executing a penetration test

CSCI 1800 Cybersecurity and Interna4onal Rela4ons. Design and Opera-on of the Internet John E. Savage Brown University

Computer and Network Security

Starting Nmap 6.40 ( ) at :54 Pacific Daylight Time Nmap scan report for mass_dns: warning: Unable to

Computer Networks A Simple Network Analyzer PART A undergraduates and graduates PART B graduate students only

DDoS Testing with XM-2G. Step by Step Guide

Network Security. Thierry Sans

Internet Control Message Protocol (ICMP), RFC 792. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

Network problem determination: AIX tools for a system administrator: Part 1, The basics of network troubleshooting

Exit from Hell? Reducing the Impact of Amplification DDoS Attacks Marc Kührer, Thomas Hupperich, Christian Rossow, and Thorsten Holz

Hands-On Ethical Hacking and Network Defense

ICS 451: Today's plan

CSE 565 Computer Security Fall 2018

ELEC5616 COMPUTER & NETWORK SECURITY

Denial of Service. Eduardo Cardoso Abreu - Federico Matteo Bencic - Pavel Alexeenko -

BIG-IP otse vastu internetti. Kas tulemüüri polegi vaja?

network security cs642 computer security adam everspaugh

ARP, IP, TCP, UDP. CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1

When does it work? Packet Sniffers. INFO Lecture 8. Content 24/03/2009

Project 4: Penetration Test

Internetwork Expert s CCNA Security Bootcamp. Common Security Threats

Nessus Scan Report. Hosts Summary (Executive) Hosts Summary (Executive) Mon, 15 May :27:44 EDT

CSc 466/566. Computer Security. 18 : Network Security Introduction

Networking By: Vince

Windows Insecurity. Penetrated. v0.11

Network Security Laboratory 23 rd May STATEFUL FIREWALL LAB

CIS 551 / TCOM 401 Computer and Network Security

Applied Networks & Security

CS 457 Lecture 11 More IP Networking. Fall 2011

Transport: How Applications Communicate

EC0-479 Q&A. DEMO Version

Internet Tool Practice. 이지민 장동현

LESSON 5 SYSTEM IDENTIFICATION

Denial of Service (DoS) attacks and countermeasures

Wireshark: Are You Under Attack? Kyle Feuz School of Computing

8/19/2010. Computer Forensics Network forensics. Data sources. Monitoring

ISA 674 Understanding Firewalls & NATs

n Given a scenario, analyze and interpret output from n A SPAN has the ability to copy network traffic passing n Capacity planning for traffic

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Network Security: Scan

Computer Security: Principles and Practice

FOCUS on Intrusion Detection: Intrusion Detection Level Analysis of Nmap and Queso Page 1 of 6

Lecture 6. Internet Security: How the Internet works and some basic vulnerabilities. Thursday 19/11/2015

Transcription:

Goals Useful s 1 / 34

Goals Useful s Suppose you re an attacker You want to attack a site How do you proceed? 2 / 34

Goals Goals Useful s Find an interesting (or vulnerable) machine Find a vulnerable service Attack... 3 / 34

Useful s Goals Useful s Ping Arp Dig Nmap rpcinfo; showmount Tcpdump Others, for special purposes 4 / 34

Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP 5 / 34

Getting Started Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP What s the first thing we know about the target? The domain name! Your probably know at least one host, too: www.domainname There s more in the DNS 6 / 34

What are the Hosts? Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP Most hosts have DNS entries can we list them? First try do zone transfer Use dig ns cs.columbia.edu to learn the name servers Pick one, then $ dig axfr cs.columbia.edu @dns2.itd.umich.edu ; <<>> DiG 9.3.2 <<>> axfr cs.columbia.edu @dns2 ; (1 server found) ;; global options: printcmd ; Transfer failed. But a different name server worked... 7 / 34

What Happened? Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP It s possible to configure a name server to reject unauthorized zone transfer requests But most sites have multiple name servers; frequently, some are under different management (including 2 of 4 cs.columbia.edu name servers) Not everyone has the same policy... 8 / 34

Enumerating Hosts Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP Learn the IP address of one host: www.cs.columbia.edu is 128.59.23.100 Use dig -x on other IP addresses in the range: for i in seq 1 254 do dig -x 128.59.23.$i done Some sites give useless answers; 135.207.23.32 is H-135-207-23-32.research.att.com Another caveat: watch out for smaller or larger nets 9 / 34

Other Information in the DNS Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP HINFO: $ dig hinfo play.cs.columbia.edu. play.cs.columbia.edu. 3600 IN More: see WKS records, TXT records, NAPTR records, etc. $ dig wks cs.columbia.edu cs.columbia.edu. 3600 IN WKS 128.59.16.20 6 13 17 21 23 25 37 42 53 79 111 119 67 69 161 162 Of course, those might be wrong... 10 / 34

What Hosts Really Exist? Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP The DNS lists what you think you have What do you really have? You can ping IP addresses for i in seq 1 254 do ping 128.59.23.$i done 11 / 34

How About a Broadcast ping? Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP # ping -L -r -w 100 128.59.23.255 PING 23-net.cs.columbia.edu (128.59.23.255): 56 data 64 bytes from 128.59.18.102: icmp_seq=0 ttl=255 time 64 bytes from 128.59.20.155: icmp_seq=0 DUP! ttl=64 64 bytes from 128.59.22.252: icmp_seq=0 DUP! ttl=64 64 bytes from 128.59.18.133: icmp_seq=0 DUP! ttl=64 64 bytes from 128.59.18.134: icmp_seq=0 DUP! ttl=64 64 bytes from 128.59.22.7: icmp_seq=0 DUP! ttl=64 ti 12 / 34

Off- Broadcasts Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP # ping -L -r -w 100 128.59.23.255 PING 23-net.cs.columbia.edu (128.59.23.255): 56 data ping: sendto: Network is unreachable Directed broadcasts are blocked to prevent Smurf attacks Smurf attack: send a ping packet to a broadcast address, with the (forged) source address of your victim Many hosts will send back to it, using up lots of the victim s bandwidth 13 / 34

ARP Getting Started What are the Hosts? What Happened? Enumerating Hosts Other Information in the DNS What Hosts Really Exist? How About a Broadcast ping? Off- Broadcasts ARP If we re on the same, we can learn more via ARP: # arp -a mudd-edge-1.net.columbia.edu (128.59.16.1) at 00 dynasty.cs.columbia.edu (128.59.16.5) at 00:03:b disco.cs.columbia.edu (128.59.16.7) at 08:00:20: razor.cs.columbia.edu (128.59.16.8) at 00:01:02: Note that the first three bytes of the MAC address tell who manufactured the card: 00:d0:06 is Cisco, 00:03:ba and 08:00:20 are Sun, etc. 14 / 34

Port- UDP 15 / 34

Port- UDP General-purpose scanner Does everything I ve described and more Practically point-and-click scanning (but it s command-line) 16 / 34

Port- UDP # nmap -sp 128.59.23.0/21 Host mudd-edge-1.net.columbia.edu (128.59.16.1) appe Host dynasty.cs.columbia.edu (128.59.16.5) appears t Host mailswitch.cs.columbia.edu (128.59.16.6) appear Host disco.cs.columbia.edu (128.59.16.7) appears to Host razor.cs.columbia.edu (128.59.16.8) appears to... 17 / 34

Port- UDP # nmap -sp 128.59.23.0/21 Host mudd-edge-1.net.columbia.edu (128.59.16.1) appe MAC Address: 00:D0:06:26:9C:00 (Cisco Systems) Host dynasty.cs.columbia.edu (128.59.16.5) appears t MAC Address: 00:03:BA:14:A3:68 (Sun Microsystems) Host mailswitch.cs.columbia.edu (128.59.16.6) appear MAC Address: 00:17:08:B5:41:00 (Hewlett Packard)... 18 / 34

Port- Port- UDP Find out what ports are open on a machine Better yet, find out what applications are behind those ports Extras: avoid detecting, detect firewalls, bypass some firewalls, etc. 19 / 34

About CS.... Port- UDP # nmap -p 1-200 cs.columbia.edu Not shown: 195 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 111/tcp open rpcbind 139/tcp open netbios-ssn MAC Address: 00:03:BA:62:6A:39 (Sun Microsystems) Nmap finished: 1 IP address (1 host up) scanned in 6 Many fewer ports than in the WKS record... 20 / 34

Port- UDP 7/tcp filtered echo 9/tcp filtered discard 19/tcp filtered chargen 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 111/tcp open rpcbind 135/tcp filtered msrpc 136/tcp filtered profile 137/tcp filtered netbios-ns 138/tcp filtered netbios-dgm 139/tcp filtered netbios-ssn 21 / 34

Port- UDP # nmap -sa -p 1-200 www.cs.columbia.edu PORT STATE SERVICE 135/tcp filtered msrpc 22 / 34

Port- UDP 3/tcp filtered compressnet 7/tcp filtered echo 36/tcp filtered unknown 116/tcp filtered ansanotify 132/tcp filtered cisco-sys 135/tcp filtered msrpc 147/tcp filtered iso-ip 157/tcp filtered knet-cmp 177/tcp filtered xdmcp Different paths? Or a scan failure? Unclear. 23 / 34

Port- UDP How does nmap detect a filtered service? A TCP SYN is normally answered with a SYN+ACK or a RST A filtered port generally returns nothing 24 / 34

Port- UDP Send a packet with the ACK bit set Gets through packet filters! Can t distinguish between open and closed services; can be used to map firewall rules 25 / 34

Port- UDP If a program does a connect() call, the usual 3-way TCP handshake will occur The application can log the fact and source of the connection Nmap hand-crafts SYN packets, and responds to any SYN+ACK with RST The TCP open never completes, so the application never notices and can t log 26 / 34

UDP Port- UDP Send a UDP packet Watch for a response or an ICMP Port Unreachable No answer at all may indicate a filtered port 27 / 34

Port- UDP Why do we want to? Particular applications may have (security) bugs Particular versions of particular applications may have (security) bugs 28 / 34

Port- UDP # nmap -A -p 1-200 www.cs.columbia.edu Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) Interesting ports on shadow.cs.columbia.edu (128.59. Not shown: 196 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 3.9p1 (protocol 1.99) 25/tcp open smtp Sendmail 8.12.10/8.12.10 80/tcp open http Apache httpd 1.3.33 ((Unix) mo 111/tcp open rpcbind 2-4 (rpc #100000) MAC Address: 00:03:BA:C5:A0:DD (Sun Microsystems) Device type: general purpose Running: Sun Solaris 8 OS details: Sun Solaris 8 Uptime 13.412 days (since Thu Oct 19 15:52:13 2006) Service Info: OS: Unix 29 / 34

Port- UDP How does nmap get that data? Many services announce it right away: # telnet www.cs.columbia.edu 80 Trying 128.59.23.100... Connected to shadow.cs.columbia.edu. Escape character is ^]. GET / HTTP/1.0 HTTP/1.1 200 OK Date: Thu, 02 Nov 2006 05:49:38 GMT Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 Open X-Powered-By: PHP/4.3.11 In other cases, it uses heuristics 30 / 34

Port- UDP $ dig version.bind txt chaos @kedu.cc.columbia.edu version.bind. 0 CH TXT "9.2.6-P1" $ dig version.bind txt chaos @cs.columbia.edu VERSION.BIND. 0 CH TXT "surely you must be joking" Hiding the version helps less than you might think 31 / 34

Port- UDP Various heuristics can be used to identify OS and version Example: look at initial sequence number patterns, support for TCP otpions, initial window size, etc. Get uptime from TCP timestamp option Evaluate sequence number and IPid field predictability But good guys need version numbers for site management Net result: hiding version numbers tends to hurt the good guys more than the bad guys 32 / 34

Port- UDP Nmap has many techniques to avoid detection Example: randomized scan orders, decoy hosts, zombies, bounce attacks, etc. Nasty example: --badsum Send packet with a bad TCP checksum Hosts will drop such packets but some IDS won t... 33 / 34

Port- UDP is a very powerful attack technique It s very hard to hide from a clever scanning program 34 / 34