Week 1
Week 1
Week 1
Topic
Lecture 1: IntroducDon to Ethical Hacking
q What is ethical hacking?
q Penetra1on tes1ng
3
IntroducDon to Ethical Hacking
• Ethical Hackers
• Employed by companies to perform penetra1on test.
• PenetraDon Test
• Legal aCempt to break into the company’s network to find the weak links.
• Tester only report findings, does not provide solu1ons.
• Security Test
• Also includes analyzing company’s security policy and procedures.
• Tester offers solu1ons to secure or protect the network.
4
Some Terminologies
5
Gaining access
• Front door • SoMware vulnerability exploitaDon
• Password guessing • OMen adver1sed on the OEMs web site
• Password/key stealing along with security patches.
• Back doors • Fer1le ground for script kiddies looking for
something to do.
• OMen leM by original developers as debug
and/or diagnos1c tools.
• Trojan Horses
• Usually hidden inside of soMware that we
download and install from the net.
• Many install backdoors.
6
Once inside, the hacker can...
• Modify logs
• To cover their tracks.
• Steal files
• Some1mes destroy aMer stealing.
• An expert hacker would steal and cover their tracks to remain undetected.
• Modify files
• To let you know they were there.
• To cause mischief.
• Install back doors
• So they can get in again.
• ACack other systems
7
The Role of Security and PenetraDon Testers
8
PenetraDon-TesDng Methodologies
• Tiger box
• Collec1on of OSs and hacking tools.
• Usually on a laptop.
• Helps penetra1on testers and security testers conduct vulnerabili1es assessments and
aCacks.
9
• Black box model
• Tester is not given details about the network.
• Burden is on the tester to find the details.
10
What You Can Do Legally
11
Laws of the Land
12
What You Cannot Do Legally
13
Ethical Hacking in a Nutshell
14
In this course, we shall cover:
15
16
Course Name: Ethical Hacking
Faculty Name: Prof. Indranil Sen Gupta
Department : Computer Science and Engineering
Topic
Lecture 2: Basic Concepts of Networking (Part I)
q Types of computer networks
q Virtual circuits
Networking: Basic Concepts
• Computer Network
• A communica;on system for connec;ng computers / hosts
• Why?
• Be@er connec;vity
• Be@er communica;on
• Be@er sharing of resources
• Bring people together
3
Types of Computer Networks
4
Data CommunicaLon over a Network
B D F
A
C E G H
5
Circuit Switching
B D F
A
C E G H
6
Circuit Switching (contd.)
b) Data transfer
• Can proceed at maximum speed.
c) ConnecLon terminaLon
• Required aUer data transmission is over.
• For dealloca;on of network resources.
7
Circuit Switching (contd.)
• Drawbacks:
• Channel capacity is dedicated during the en;re dura;on of communica;on.
v Acceptable for voice communica;on.
v Very inefficient for bursty traffic like data.
8
Packet Switching
9
Packet Switching (contd.)
H H H
PACKETS
10
Packet Switching (contd.)
11
Packet Switching (contd.)
• Advantages:
• Links can be shared; so link u;liza;on is be@er.
• Suitable for computer-generated (bursty) traffic.
• Buffering and data rate conversion can be performed easily.
• Some packets may be given priority over others, if desired.
12
Packet Switching (contd.)
13
(a) Virtual Circuit Approach
• Analogy:
• Telephone system.
14
(a) Virtual Circuit Approach (contd.)
• How it works?
• Route is established a priori.
• Packet forwarded from one node to the next using store-and-forward scheme.
• Only the virtual circuit number need to be carried by a packet.
v Each intermediate node maintains a table.
v Created during route establishment.
v Used for packet forwarding.
• No dynamic rou;ng decision is taken by the intermediate nodes.
15
16
Course Name: Ethical Hacking
Faculty Name: Prof. Indranil Sen Gupta
Department : Computer Science and Engineering
Topic
Lecture 3: Basic Concepts of Networking (Part II)
q Datagrams
• Basic concept:
• No route is established beforehand.
• Each packet is transmi>ed as an independent en?ty.
• Does not maintain any history.
• Analogy:
• Postal system.
3
Datagram Approach (contd.)
4
Datagram Approach (contd.)
• Advantages:
• Faster than virtual circuit for smaller number of packets.
v No route establishment and termina?on.
• More flexible.
• Packets between two hosts may follow different paths.
v Can handle conges?on/failed link.
B D F
A
C E G H
5
ComparaJve Study
6
Circuit Switching
• AUer ini?al circuit establishment, data bits sent con?nuously without any delay.
7
Virtual Circuit Packet Switching
8
Datagram Packet Switching
• No ini?al delay.
• The packets are sent out independently.
• May follow different paths.
• Also follows store-and-forward approach.
9
Layered Network Architecture
• Objec?ve:
• Systema?c approach to design.
• Changes in one layer should not require changes in other layers.
10
The 7-layer OSI Model
ApplicaJon
PresentaJon
Host-to-host
Session
Transport
Network
Datalink Point-to-point
Physical
11
ApplicaJon
Layer FuncJons PresentaJon
Session
• Physical
Transport
• Transmit raw bit stream over a physical medium.
• Data Link Network
• Reliable transfer of frames over a point-to-point link (flow control, error Datalink
control).
Physical
• Network
• Establishing, maintaining and termina?ng connec?ons.
• Routes packets through point-to-point links.
12
ApplicaJon
Layer FuncJons (contd.) PresentaJon
Session
• Transport
Transport
• End-to-end reliable data transfer, with error recovery and flow
control. Network
• Session Datalink
• Manages sessions.
Physical
• PresentaJon
• Provides data independence.
• ApplicaJon
• Interface point for user applica?ons.
13
How Data Flows
APPLICATION APPLICATION
PRESENTATION PRESENTATION
SESSION SESSION
TRANSPORT TRANSPORT
NETWORK N N NETWORK
PHYSICAL P P PHYSICAL
S A B D
14
Internetworking Devices
• Hub
• Extends the span of a single LAN.
• Bridge / Layer-2 Switch
• Connects two or more LANs together.
• Works at data link layer level.
• Router / Layer-3 Switch
• Connects any combina?on of LANs and WANs.
• Works at network layer level.
15
Typical Internetworking Structure
16
17
Course Name: Ethical Hacking
Faculty Name: Prof. Indranil Sen Gupta
Department : Computer Science and Engineering
Topic
Lecture 4: TCP/IP Protocol Stack (Part I)
q TCP/IP protocol stack
q Data encapsula5on
IntroducGon
3
Network Layering in TCP/IP
4
The 7-layer OSI Model The 4-layer TCP/IP Model
ApplicaGon
ApplicaGon Runs on top of layers 1,2,3
PresentaGon
Host-to-host
Transport End-to-end message
Session
transfer
Transport
Network Packet delivery across Internet
Network
Physical
5
Data Flow in 4-layer Model
ApplicaGon ApplicaGon
Transport Transport
A B C
6
TCP/IP Protocol Suite
7
TCP/IP Family Members (ParGal List)
User
FTP TFTP SMTP SNMP DNS Process
8
• Address ResoluGon Protocol (ARP)
• Map IP addresses to hardware (MAC) addresses.
9
Typical Scenario
User Process User Process
TCP UDP
IP
10
What does IP do?
11
What does TCP do?
12
What does UDP do?
13
Addresses in TCP/IP
User Process User Process
Port Address
TCP UDP
(16 bits)
IP Address
IP
(32 bits)
Physical Address
Datalink and Hardware Layer (e.g., Ethernet) (48 bits)
14
EncapsulaGon
• Basic concept:
• As data flows down the protocol hierarchy, headers (and trailers) get appended to it.
• As data moves up the hierarchy, headers (and trailers) get stripped off.
15
EncapsulaGon in TFTP
Data
16
17
Course Name: Ethical Hacking
Faculty Name: Prof. Indranil Sen Gupta
Department : Computer Science and Engineering
Topic
Lecture 5: TCP/IP Protocol Stack (Part II)
q IP Datagrams
q IP Header fields
IP Datagrams
The IP Layer
4
IllustraGon
Data
5
Format of IP Datagram
0 4 8 15 16 31
VER HLEN Service type Total Length
Source IP Address
DesGnaGon IP Address
OpGons
DATA
6
IP Header Fields
• VER (4 bits)
• Version of the IP protocol in use (typically 4).
• HLEN (4 bits)
• Length of the header, expressed as the number of 32-bit words.
• Minimum size is 5, and maximum 15.
• Total Length (16 bits)
• Length in bytes of the datagram, including headers.
• Maximum datagram size :: 216 = 65536 bytes.
7
IP Header Fields (contd.)
• Protocol (8 bits)
• Iden7fies the higher layer protocol being used.
8
IP Header Fields (contd.)
9
IP Header Fields (contd.)
10
Viewing IP Packets
11
Wireshark …
12
13