Deff Arnaldy 0818 0296 4763 1.

Slides:



Advertisements
Similar presentations
Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
 Dynamic policies o Change as system security state/load changes o GAA architecture  Extended access control lists  Pre-, mid- and post-conditions,
Computer Security and Penetration Testing
Intermediate TCP/IP TCP Operation.
CISCO NETWORKING ACADEMY PROGRAM (CNAP)
NMAP Scanning Options. EC-Council NMAP  Nmap is the most popular scanning tool used on the Internet.  Cretead by Fyodar ( it.
1 Reading Log Files. 2 Segment Format
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning.
IP Network Scanning.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Scanning.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning Last updated
Hacking Exposed 7 Network Security Secrets & Solutions Chapter 2 Scanning 1.
Cyber Security Network Security. ARP Spoofing A computer connected to an IP/Ethernet has two addresses Address of network card (MAC address) Globally.
System Security Scanning and Discovery Chapter 14.
ITP 457 Network Security Network Hacking 101. Hacking Methodology (review) 1. Gather target information 2. Identify services and ports open on the target.
Firewalls and Intrusion Detection Systems
Intruder Trends Tom Longstaff CERT Coordination Center Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by.
Scanning February 23, 2010 MIS 4600 – MBA © Abdou Illia.
TCP/IP Network and Firewall. IP Packet Protocol  1 ICMP packet  6 TCP packet  17 UDP packet.
Port Scanning Yiqian Zhang CS 265 Project. What is Port Scanning? port scanning is equivalent to knocking on the walls to find all the doors and windows.
FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. 6 Packet Filtering By Whitman, Mattord, & Austin© 2008 Course Technology.
Computer Security and Penetration Testing
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Port Scanning Prabhaker Mateti. Mateti, Port Scanning2 Port scanning Attackers wish to discover services they can break into. Attackers wish to discover.
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Port Scanning.
Ana Chanaba Robert Huylo
Scanning and Spoofing Lesson 7. Scanning Ping Sweeps Port Scanners Vulnerability Scanning tools.
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
FIREWALL Mạng máy tính nâng cao-V1.
1 Reconnaissance, Network Mapping, and Vulnerability Assessment ECE4112 – Internetwork Security Georgia Institute of Technology.
Chapter 6: Packet Filtering
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
Port Scanning 0x470~0x480 Presenter SangDuk Seo 1.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Scanning.
ECE4112 Lab 7: Honeypots and Network Monitoring and Forensics Group 13 + Group 14 Allen Brewer Jiayue (Simon) Chen Daniel Chu Chinmay Patel.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CIS 450 – Network Security Chapter 3 – Information Gathering.
1 CSCD434 Lecture 8 Spring 2014 Scanning Activities Network Mapping and Scanning.
Port Scanning. Introduction Port scanning –techniques that attackers use to discover services they can break into. Idea –sending a message to each port,
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
Snort & Nmap Mike O’Connor Eric Tallman Matt Yasiejko.
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
1 Reconnaissance, Network Mapping, and Vulnerability Assessment ECE4112 – Internetwork Security Georgia Institute of Technology.
Linux Networking and Security
1 Topic 2: Lesson 3 Intro to Firewalls Summary. 2 Basic questions What is a firewall? What is a firewall? What can a firewall do? What can a firewall.
Fundamentals of Proxying. Proxy Server Fundamentals  Proxy simply means acting on someone other’s behalf  A Proxy acts on behalf of the client or user.
Chapter 2 Scanning Last modified Determining If The System Is Alive.
Scanning & Enumeration Lab 3 Once attacker knows who to attack, and knows some of what is there (e.g. DNS servers, mail servers, etc.) the next step is.
1 Figure 4-1: Targeted System Penetration (Break-In Attacks) Host Scanning  Ping often is blocked by firewalls  Send TCP SYN/ACK to generate RST segments.
1 CSCD434 Lecture 7 Spring 2012 Scanning Activities Network Mapping and Scanning.
Advanced Packet Analysis and Troubleshooting Using Wireshark 23AF
DoS/DDoS attack and defense
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
Role Of Network IDS in Network Perimeter Defense.
Scanning.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Network and Port Scanning Chien-Chung Shen
Firewalls. Overview of Firewalls As the name implies, a firewall acts to provide secured access between two networks A firewall may be implemented as.
The Transport Layer Implementation Services Functions Protocols
Port Scanning James Tate II
Port Scanning (based on nmap tool)
TCP/IP Internetworking
TCP/IP Internetworking
CIT 480: Securing Computer Systems
Information Gathering
دیواره ی آتش.
EVAPI - Enumeration Auburn Hacking club
Presentation transcript:

Deff Arnaldy

 Art of Port Scanning  Various Scanning Techniques  OS Fingerprinting  Nmap - Introduction  Nmap with Linux and Windows  Basic Commands and Operations  Useful Scanning Techniques 2

 Scanning is the first phase of active hacking and is used to locate target systems or networks for later attack  Enumeration is the follow-on step once scanning is complete and is used to identify computer names, usernames, and shares  Scanning and enumeration are discussed together in this chapter because many hacking tools perform both steps simultaneously 3

 Scanning is the process of locating systems that are alive and responding on the network.  Ethical hackers use scanning to identify target systems’ IP addresses.  Scanning is also used to determine whether a system is on the network and available.  Scanning tools are used to gather information about a system such as IP addresses, the operating system, and services running on the target computer. 4

 Table 3.1 lists the three types of scanning. 5

 Port Scanning  Port scanning is the process of identifying open and available TCP/IP ports on a system.  Port-scanning tools enable a hacker to learn about the services available on a given system. Each service or application on a machine is associated with a well-known port number 6

 Network Scanning  Network scanning is a procedure for identifying active hosts on a network, either to attack them or as a network security assessment.  Hosts are identified by their individual IP addresses. Network-scanning tools attempt to identify all the live or responding hosts on the network and their corresponding IP addresses. 7

 Vulnerability Scanning  Vulnerability scanning is the process of proactively identifying the vulnerabilities of computer systems on a network.  Generally, a vulnerability scanner first identifies the operating system and version number, including service packs that may be installed. Then, the scanner identifies weaknesses or vulnerabilities in the operating system.  During the later attack phase, a hacker can exploit those weaknesses in order to gain access to the system. 8

 Attackers wish to discover services they can break into.  Security audit: Why are certain ports open?  sending a packet to each port, one at a time.  Based on the type of response, an attacker knows if the port is used.  The used ports can be probed further for weakness. 9

 An abstraction of the OS + Net Stds  Part of UDP and TCP packets  UDP and TCP port numbers are disjoint  Typical to use the same port number for both UDP and TCP service  E.g., 80/TCP and 80/UDP for www  16-bit unsigned integer  Well Known Ports ( )  Registered Ports ( )  Dynamic and/or Private Ports ( ).  port-numbers port-numbers 10

11

12 Socket calls for connection-oriented communication

13 socket() bind() sendto() close() socket() bind() recvfrom() sendto() close() blocks until server receives data from client data Server Client recvfrom() Socket calls for connectionless communication

 Only root-privileged programs are allowed to open these ports.  Examples  ftp-data 20/udp  ftp 21/tcp  ssh 22/tcp  telnet 23/tcp  Time 37/tcp  Time 37/udp  Whois 43/tcp  Imap 143/tcp 14

 Ordinary programs/users can use these  shockwave2 1257/tcp Shockwave 2 shockwave2 1257/udp Shockwave 2  x /tcp X Window System x /udp X Window System 15

 Ordinary programs can use these 16

 Open  A service process is listening at the port. The OS receives packets arriving at this port and gives the messages to the service process. If the OS receives a SYN at an open port, this is the first packet of the three way handshake.  Closed  No process is listening at the port. If the OS receives a SYN at a closed port, an RST is sent.  Filtered  A packet filter is listening at the port. 17

 Try connect()-ing to every port  If the port is listening, connect() will succeed.  Otherwise, the port isn ’ t reachable.  No need for any special privileges. Any user can use it.  Speed - slow.  Scanner can be identified. 18

 Often referred to as half-open scanning.  Send a SYN packet  Wait for a response.  A SYN/ACK indicates the port is listening.  If a SYN/ACK is received, send an RST to tear down the connection immediately.  Most sites do not log these.  Need root privileges to build SYN packets. 19

 Send a FIN packet (without a preceding SYN etc.)  FIN packets may pass through firewalls  Closed ports reply with RST.  Open ports ignore the FIN packet.  Some hosts violate RFC.  Reply with RST ’ s regardless of the port state  Thus, are not vulnerable to this scan. 20

 identd protocol (rfc1413): Disclose the username of the owner of any process connected via TCP, even if that process didn ’ t initiate the connection.  Example: connect to the http port (80), and then use identd to find out whether the server is running as root.  Must have full TCP connection to the port. 21

 Not a new scanning method in and of itself. A modification of other techniques.  Split the probe packet into IP fragments.  By splitting up the TCP header over several packets, it is harder for packet filters to detect a probe. 22

 A port scanner can exploit this to scan TCP ports form a proxy ftp server.  Connect to an FTP server behind a firewall, and then scan ports that are more likely to be blocked.  If the ftp server allows reading from and writing to a directory (such as /incoming), you can send arbitrary data to ports that you do find open. 23

 Take advantage of a vulnerability of FTP protocol.  Requires support for proxy ftp connections.  For example, evil.com can establish a control communication connection to FTP server-PI (protocol interpreter) of target.com.  Then it is able to request the server-PI to initiate an active server-DTP (data transfer process) to send a file anywhere on the Internet. 24

 Use the PORT command (of FTP) to declare that our passive user-DTP is listening on the target box at a certain port number.  LIST the current directory, and the results is sent over the server-DTP channel.  If our target host is listening on the port, the transfer will be successful.  Otherwise, connection will be refused.  Then issue another PORT command to try the next port on the target. 25

 Advantages  Harder to trace  Potential to bypass firewalls.  Disadvantages  Slow  Many FTP servers have (finally) disabled the proxy feature. 26

 UDP is simpler, but the scanning is more difficult  Open ports do not have to send an ACK.  Closed ports are not required to send an error packet.  Most hosts send an ICMP_PORT_UNREACH error when you send a packet to a closed UDP port.  Can find out if a port is NOT open. 27

 Neither UDP packets, nor the ICMP errors are guaranteed to arrive.  Slow: the ICMP error message rate is limited.  Need to be root for access to raw ICMP socket.  Non-root users cannot read port unreachable errors directly. 28

 But users can learn it indirectly.  For example, a second write() call to a closed port will usually fail.  recvfrom() on non-blocking UDP sockets usually return EAGAIN (try again), if the ICMP error hasn ’ t been received.  It will return ECONNREFUSED (connection refuse), if ICMP error has been received. 29

 Simple port scanning can be easily logged by the services listening at the ports.  E.g. they see an incoming connection with no data, thus they log an error.  Stealth scan refers to scanning techniques that can avoid being logged.  These techniques include fragmented packets, SYN scanning, FIN scanning etc. 30

 Scan slowly  A port scanner typically scans a host too rapidly  Some detectors recognize these “ signatures ”.  So, scanning very slowly (e.g., over several days) is a stealth technique.  Firing packets with fake IPs  Flood with spoofed scans and embed one scan from the real source (network) address. 31

 Several packets to different destination ports from the same source within a “ short period ” of time.  SYN to a non-listening port 32

 Open a socket  SOCK_RAW mode.  protocol type IPPROTO_IP  recvfrom() to capture the packets  Discovering stealth scans requires kernel level work.  A detector can inform us that we have been port-scanned, but the source address may have been spoofed. 33

 If the packets we received have an IP TTL of 255, we can conclude that it was sent from or local network, regardless of what the source address field says.  if TTL is 250, we can only tell that the attacker was no more than 5 hops away. 34

 Although scanning can quickly identify which hosts are listening and active on a network, it is also a quick way to be identified by an intrusion detection system (IDS)  Scanning tools probe TCP/IP ports looking for open ports and IP addresses, and these probes can be recognized by most security intrusion detection tools 35

 Depending on the type of scanning application and the speed of the scan, an IDS will detect the scanning and flag it as an IDS event.  Some of the tools for scanning have different modes to attempt to defeat an IDS and are more likely to be able to scan undetected 36

 Scanning Methodology 37

 Ping Sweep Techniques  ICMP scanning, or a ping sweep, is the process of sending an ICMP request or ping to all hosts on the network to determine which ones are up and responding to pings.  ICMP began as a protocol used to send test and error messages between hosts on the Internet. 38

 The benefit of ICMP scanning  It can be run in parallel, meaning all systems are scanned at the same time; thus it can run quickly on an entire network.  Most hacking tools include a ping sweep option, which essentially means performing an ICMP request to every host on the network.  Systems that respond with a ping response are alive and listening on the network. 39

 Sample Exercise 40

 Detecting Ping Sweeps  Almost any IDS or intrusion prevention system (IPS) system will detect and alert the security administrator to a ping sweep occurring on the network.  Most firewall and proxy servers block ping responses so a hacker can’t accurately determine whether systems are available using a ping sweep alone.  More intense port scanning must be used if systems don’t respond to a ping sweep. Just because a ping sweep doesn’t return any active hosts on the network doesn’t mean they aren’t available—you need to try an alternate method of identification. Remember, hacking takes time, patience, and persistence. 41

 Scanning Ports and Identifying Services  Port scanning is the method used to check for open ports.  The process of port scanning involves probing each port on a host to determine which ports are open.  Port scanning generally yields more valuable information than a ping sweep about the host and vulnerabilities on the system. 42

 Service identification is the third step in the CEH scanning methodology; it’s usually performed using the same tools as port scanning.  By identifying open ports, a hacker can usually also identify the services associated with that port number. 43

 Port-Scan Countermeasures  Countermeasures are processes or toolsets used by security administrators to detect and possibly thwart port scanning of hosts on their network  The following list of countermeasures should be implemented to prevent a hacker from acquiring information during a port scan:  Proper security architecture, such as implementation of IDS and firewalls, should be followed. 44

 Ethical hackers use their toolset to test the scanning countermeasures that have been  implemented. Once a firewall is in place, a port-scanning tool should be run against hosts on the network to determine whether the firewall correctly detects and stops the port-scanning activity.  The firewall should be able to detect the probes sent by port-scanning tools. The fire- wall should carry out stateful inspections, which means it examines the data of the packet and not just the TCP header to determine whether the traffic is allowed to pass through the firewall. 45

 Network IDS should be used to identify the OS-detection method used by some common hackers tools.  Only needed ports should be kept open. The rest should be filtered or blocked.  The staff of the organization using the systems should be given appropriate training on security awareness. They should also know the various security policies they’re required to follow. 46

 nmap Command Switches  Nmap is a free, open source tool that quickly and efficiently performs ping sweeps, port scanning, service identification, IP address detection, and operating system detection.  Nmap has the benefit of scanning a large number of machines in a single session. It’s supported by many operating systems, including Unix, Windows, and Linux. 47

48

49

 Scan Types 50

51

 Prabhaker Mateti  McClure S., Joel S. Hacking Exposed 5 th.  Graves Kimberly. Certified Ethical Hacker. Study Guide. Wiley Publishing.Inc. 52

53