Port Scanning 0x470~0x480 Presenter SangDuk Seo 1.

Slides:



Advertisements
Similar presentations
Overview The TCP/IP Stack. The Link Layer (L2). The Network Layer (L3). The Transport Layer (L4). Port scanning & OS/App detection techniques. Evasion.
Advertisements

Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
 Dynamic policies o Change as system security state/load changes o GAA architecture  Extended access control lists  Pre-, mid- and post-conditions,
TCP Flooding. TCP handshake C S SYN C SYN S, ACK C ACK S Listening Store data Wait Connected.
TRUE Blind ip spoofed portscanning Thomas Olofsson C.T.O Defcom.
TCP/IP Fundamentals A quick and easy way to understand TCP/IP v4.
1 Topic 2 – Lesson 4 Packet Filtering Part I. 2 Basic Questions What is packet filtering? What is packet filtering? What elements are inside an IP header?
Computer Security Fundamentals
CIS 193A – Lesson13 Attack and Defense. CIS 193A – Lesson13 Focus Question Describe how Nmap, psad, and iptables work together for playing out attack.
Lecture 9 Page 1 CS 236 Online Denial of Service Attacks that prevent legitimate users from doing their work By flooding the network Or corrupting routing.
NMAP Scanning Options. EC-Council NMAP  Nmap is the most popular scanning tool used on the Internet.  Cretead by Fyodar ( it.
Network Security of Labnet ******. Introduction Test the network security of the servers on our Labnet domain Find Potential Weaknesses Find Security.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
Hands-On Ethical Hacking and Network Defense Second Edition Chapter 5 Port Scanning.
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
Scanning Determining if the system is alive IP Scanning Port Scanning War Dialing.
Hacking Exposed 7 Network Security Secrets & Solutions Chapter 2 Scanning 1.
ITP 457 Network Security Network Hacking 101. Hacking Methodology (review) 1. Gather target information 2. Identify services and ports open on the target.
Scanning February 23, 2010 MIS 4600 – MBA © Abdou Illia.
1 Anti-Hacker Tool Kit Port Scanners Chapter 6. 2 Introduction The first step in the process of hacking –Discover the services –Version label –Operation.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Port Scanners.
Examining IP Header Fields
Lecture 23: Network Primer 7/15/2003 CSCE 590 Summer 2003.
Computer Security and Penetration Testing
Deff Arnaldy
Port Scanning.
1Federal Network Systems, LLC CIS Network Security Instructor Professor Mort Anvair Notice: Use and Disclosure of Data. Limited Data Rights. This proposal.
Ana Chanaba Robert Huylo
SCSC 555 Frank Li.  Port scanning  Port-scanning tools  Ping sweeps 2.
1 Reconnaissance, Network Mapping, and Vulnerability Assessment ECE4112 – Internetwork Security Georgia Institute of Technology.
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
EECS 354 Network Security Metasploit Features. Hacking on the Internet Vulnerabilities are always being discovered 0day vulnerabilities Every server or.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Scanning.
1 CSCD434 Lecture 8 Spring 2014 Scanning Activities Network Mapping and Scanning.
Snort & Nmap Mike O’Connor Eric Tallman Matt Yasiejko.
CIT 380: Securing Computer Systems
1 Reconnaissance, Network Mapping, and Vulnerability Assessment ECE4112 – Internetwork Security Georgia Institute of Technology.
1 Reconnaissance, Network Mapping, and Vulnerability Assessment ECE4112 – Internetwork Security Georgia Institute of Technology.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Port Scanners.
Distributed Denial of Service Attacks Shankar Saxena Veer Vivek Kaushik.
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.
DoS Suite and Raw Socket Programming Group 16 Thomas Losier Paul Obame Group 16 Thomas Losier Paul Obame.
1 CSCD434 Lecture 7 Spring 2012 Scanning Activities Network Mapping and Scanning.
EC week Review. Rules of Engagement Teams selected by instructor Host will read the entire questions. Only after, a team may “buzz” by raise of.
Slide #1 CIT 380: Securing Computer Systems TCP/IP.
DoS/DDoS attack and defense
Hands-On Ethical Hacking and Network Defense
Scanning.
Lecture 17 Page 1 Advanced Network Security Network Denial of Service Attacks Advanced Network Security Peter Reiher August, 2014.
Network and Port Scanning Chien-Chung Shen
Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
Protection (tools).
Port Scanning James Tate II
The Linux Operating System
or call for office visit, or call Kathy Cheek,
or call for office visit,
Port Scanning (based on nmap tool)
CIT 480: Securing Computer Systems
Information Gathering
Module 18 (More Network Discovery)
Intro to Ethical Hacking
-sI Idlescan Greatest stealth of any nmap scan
Figure 3-23: Transmission Control Protocol (TCP) (Study Figure)
Transport Layer 9/22/2019.
TCP Connection Management
Attacks on TCP.
Presentation transcript:

Port Scanning 0x470~0x480 Presenter SangDuk Seo 1

Motivation 2

/ 24 Network Address = ZIP- CODE Host Address = Office Address What is Port ?

Motivation 4 Port = Windows :80 / 24 THIS IS PORT Scanning

What is Port Scanning? 5 Way of figuring out which ports are listening and accepting connections. Port scanning can find vulnerabilities in Server NMAP – Most popular open source port-scanning tools. nmap [-main option] [-sub option] [main option] sT – Full connection sS – Syn half sA – Ack Scan sI- Idle Scan D – Decoy Scan sU – UDP Scan sN – NULL Scan sX – Xmas Scan sF – FIN Scan d –show detail [sub option] sV - Identify Port application O – Identify OS oA - Save result p - Select Target [result] Open Filtered – cannot access port (firewall) Closed

Full Connection Scanning 6 Trying to open TCP connections to every possible port on the target system – Effective but noisy and detectable Attacke r Victim Open on target Attacke r Victim Closed on target

Full Connection Scanning 7 Nmap -sT

Stealth SYN Scan 8 Half- Open Scan - It doesn’t actually open a full TCP connection. RST packet is sent to tear down the connection to prevent the service from accidentally being DoSed. Attacke r Victim Open on target RST Attacke r Victim Closed on target

Stealth SYN Scan 9 Nmap -sS

FIN, X-mas, NULL Scan 10 These all involve sending a nonsensical packet to every port on the target system. If the port is closed and the implementation follows protocol (RFC 793), an RST packet will be sent Attacke r Victim Open on target Attacke r Victim Closed on target Nothing

FIN, X-mas, NULL Scan 11 Nmap –sF Nmap –sX Nmap -sN Failed

FIN, X-mas, NULL Scan add on -d Option 12 Failed

Spoofing Decoys 13 Spoofs connections from various decoy IP addresses in between each real port-scanning connection Spoofed decoy addresses must use real IP addresses of live hosts - the target may be accidentally SYN flooded.

Spoofing Decoys 14 Nmap –D

Idle Scanning 15 Scan a target using spoofed packets from an idle host, by observing changes in the idle host Find a usable idle host that is not sending or receiving any other network traffic TCP implementation that produces predictable IP IDs that change by a known increment with each packet. IP IDs are meant to be unique per packet per session, and they are commonly incremented by 1 or 254 (depending on byte ordering) on Windows 95 and 2000 Recent Linux kernel, OpenBSD, and Windows Vista using randomize the IP ID -> It didn’t Work NOW

Idle Scanning 16 1.Get the current IP ID 2.Identify the increment of IP ID 3.Send a spoofed SYN packet with the idle host’s IP address to a port on the target machine ID = ID+1 if the idle host isn't truly idle, the results will be skewed

Idle Scanning 17 Nmap -sI

Proactive Defense (Shroud) – Close Port 18 Close Ports what we don’t use fuser -n tcp [port], kill -9 [pid] iptables -A INPUT -p udp --dport j DROP

Proactive Defense (Shroud) – NO RST 19 FIN, Null, and X-mas scans can be prevented by a simple kernel modification If the kernel never sends reset packets, these scans will turn up nothing Return; YOU HAVE TO recompile kernel

Proactive Defense (Shroud) – NO RST 20 Attacke r Victim Open on target Attacke r Victim Closed on target Nothing

Proactive Defense (Shroud) 21

Proactive Defense (Shroud) – Full & Half Scan 22 Make sea of false positives. –Attacker can’t find what port is really open. Source -> Pretend to Destination Destination -> Return to Source Pretend all Ports are OPEN

Proactive Defense (Shroud) – Full & Half Scan 23 Make sea of false positives.

Proactive Defense (Shroud) 24 Sometimes it did not work..

Reach Out and Hack Someone 25 There is no code to limit the length. Ref)

Analysis with GDB 26 Compile with –g option to debug Run and find tinyweb’s PID Use GDB and Attach to the process after it’s already running

Why Doing like that? 27 Tinyweb requires root privileges, so the debugger must be run as root (Application that using 1~1024 port requires root privileges) Using sudo or running with root’s environment will change the stack The addresses seen in the debugger’s run of the binary won’t match the addresses when it’s running normally Sudo gdb./tinyweb Grep Pid

Analysis with GDB 28 Break We know this function has Vulnerability

Analysis with GDB 29 Breaking We will insert shell code there Let’s Find that Return Address

Analysis with GDB 30 0 Return = 0xbfff7b(4 + 8) = c Request’s Buffer Space = 540byte +200 for Avoid Buffer Start Point 0xbffff668 is return Address

Almost Only Counts with Hand Grenades 31 Change RetADDR Vim./tinyweb_exploit.c

Almost Only Counts with Hand Grenades 32 Attacker’s Terminal NOP sled Shell Code Victim’s Terminal We aren’t at the console, So this won’t do us any good!

Port-Binding Shellcode 33 Count Words Cut Address Add “/x “ and delete null Space Shell code for Binding Port

Port-Binding Shellcode 34 works like that cat program but over the network

Port-Binding Shellcode 35 Count words NOP Sled Rest / Return ADDR Size

Port-Binding Shellcode

QnA 37

38