SlideShare a Scribd company logo
1 of 41
Download to read offline
Hands-On Ethical
Hacking and
Network Defense
Chapter 2
TCP/IP Concepts Review
Last modified 1-11-17
Objectives
• Describe the TCP/IP protocol stack
• Explain the basic concepts of IP addressing
• Explain the binary, octal, and hexadecimal
numbering system
Overview of TCP/IP
• Protocol
• Common language used by computers for speaking
• Transmission Control Protocol/Internet Protocol
(TCP/IP)
• Most widely used protocol
• TCP/IP stack
• Contains four different layers
• Network
• Internet
• Transport
• Application
The Application Layer
• Front end to the lower-layer protocols
• What you can see and touch – closest to
the user at the keyboard
• HTTP, FTP, SMTP, SNMP, SSH, IRC and
TELNET all operate in the Application Layer
The Transport Layer
• Encapsulates data into segments
• Segments can use TCP or UDP to reach a
destination host
• TCP is a connection-oriented protocol
• TCP three-way handshake
• Computer A sends a SYN packet
• Computer B replies with a SYN-ACK packet
• Computer A replies with an ACK packet
TCP Header Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TCP Segment Headers
• Critical components:
• TCP flags
• Initial Sequence Number (ISN)
• Source and destination port
• Abused by hackers finding vulnerabilities
TCP Flags
• Each flag occupies one bit
• Can be set to 0 (off) or 1 (on)
• Six flags
• SYN: synchronize flag
• ACK: acknowledge flag
• PSH: push flag
• URG: urgent flag
• RST: reset flag
• FIN: finish flag
Initial Sequence Number (ISN)
• 32-bit number
• Tracks packets received
• Enables reassembly of large packets
• Sent on steps 1 and 2 of the TCP three-
way handshake
• By guessing ISN values, a hacker can hijack a
TCP session, gaining access to a server without
logging in
TCP Ports
• Port
• Logical, not physical, component of a TCP
connection
• Identifies the service that is running
• Example: HTTP uses port 80
• A 16-bit number – 65,536 ports
• Each TCP packet has a source and
destination port
Blocking Ports
• Helps you stop or disable services that are
not needed
• Open ports are an invitation for an attack
• You can’t block all the ports
• That would stop all networking
• At a minimum, ports 25 and 80 are usually open
on a server, so it can send out Email and Web
pages
TCP Ports (continued)
• Only the first 1023 ports are considered well-
known
• List of well-known ports
• Available at the Internet Assigned Numbers
Authority (IANA) Web site (www.iana.org)
• Ports 20 and 21
• File Transfer Protocol (FTP)
• Use for sharing files over the Internet
• Requires a logon name and password
• More secure than Trivial File Transfer Protocol
(TFTP)
TCP Ports (continued)
• Port 25
• Simple Mail Transfer Protocol (SMTP)
• E-mail servers listen on this port
• Port 53
• Domain Name Service (DNS)
• Helps users connect to Web sites using URLs
instead of IP addresses
TCP Ports (continued)
• Port 69
• Trivial File Transfer
Protocol
• Used for transferring
router configurations
• Had the "Sorcer's
Apprentice Syndrome"
Denial-of-Service
vulnerability (link Ch2i)
• (image from luharu.com)
TCP Ports (continued)
• Port 80
• Hypertext Transfer Protocol (HTTP)
• Used when connecting to a Web server
• Port 110
• Post Office Protocol 3 (POP3)
• Used for retrieving e-mail
• Port 119
• Network News Transfer Protocol
• For use with newsgroups
TCP Ports (continued)
• Port 135
• Remote Procedure Call (RPC)
• Critical for the operation of Microsoft Exchange
Server and Active Directory
• Port 139
• NetBIOS
• Used by Microsoft’s NetBIOS Session Service
• File and printer sharing
19
TCP Ports (continued)
• Port 143
• Internet Message Access Protocol 4 (IMAP4)
• Used for retrieving e-mail
• More features than POP3
Demonstration
• Telnet to hills.ccsf.edu and netstat to see
the connections
• Port 23 (usual Telnet)
• Port 25 blocked off campus, but 110 connects
• Port 21 works, but needs a username and
password
Demonstration
• Wireshark Packet Sniffer
• TCP Handshake: SYN, SYN/ACK, ACK
• TCP

Ports
• TCP

Status

Flags
User Datagram Protocol (UDP)
• Fast but unreliable protocol
• Operates on transport layer
• Does not verify that the receiver is listening
• Higher layers of the TCP/IP stack handle
reliability problems
• Connectionless protocol
The Internet Layer
• Responsible for routing packets to their
destination address
• Uses a logical address, called an IP address
• IP addressing
• Packet delivery is connectionless
Internet Control Message Protocol
(ICMP)
• Operates in the Internet layer of the TCP/IP
stack
• Used to send messages related to network
operations
• Helps in troubleshooting a network
• Some commands include
• Ping
• Traceroute
ICMP Type Codes
33
Wireshark Capture of a PING
Warriors of the Net
• Network+ Movie
• Warriorsofthe.net (link Ch 2d)
IP Addressing
• Consists of four bytes, like 147.144.20.1
• Two components
• Network address
• Host address
• Neither portion may be all 1s or all 0s
• Classes
• Class A
• Class B
• Class C
IP Addressing (continued)
• Class A
• First byte is reserved for network address
• Last three bytes are for host address
• Supports more than 16 million host computers
• Limited number of Class A networks
• Reserved for large corporations and governments
(see link Ch 2b)
• Format: network.node.node.node
IP Addressing (continued)
• Class B
• First two bytes are reserved for network address
• Last two bytes are for host address
• Supports more than 65,000 host computers
• Assigned to large corporations and Internet
Service Providers (ISPs)
• Format: network.network.node.node
• CCSF has 147.144.0.0 – 147.144.255.255
IP Addressing (continued)
• Class C
• First three bytes are reserved for network address
• Last byte is for host address
• Supports up to 254 host computers
• Usually available for small business and home
networks
• Format: network.network.network.node
IP Addressing (continued)
• Subnetting
• Each network can be assigned a subnet mask
• Helps identify the network address bits from the host
address bits
• Class A uses a subnet mask of 255.0.0.0
• Also called /8
• Class B uses a subnet mask of 255.255.0.0
• Also called /16
• Class C uses a subnet mask of 255.255.255.0
• Also called /24
Planning IP Address Assignments
• Each network segment must have a unique
network address
• Address cannot contain all 0s or all 1s
• To access computers on other networks
• Each computer needs IP address of gateway
42
Planning IP Address Assignments
• TCP/IP uses subnet mask to determine if
the destination computer is on the same
network or a different network
• If destination is on a different network, it relays
packet to gateway
• Gateway forwards packet to its next destination
(routing)
• Packet eventually reaches destination
IPv6
• Modern operating systems like Windows 7
use IPv6 in addition to IPv4
• IPv6 addresses are much longer: 128 bits
instead of the 32 bits used by IPv4
Binary
Binary, Hexadecimal, and Base64
• Binary: uses only 0 and 1
• Eight bits per byte
• Hexadecimal: uses 0-9 and a-f
• 4 bits per character
• Two characters per byte
• Base64
• 6 bits per character
• 4 characters for 3 bytes
Base 64 Encoding
Used to evade anti-spam tools, and to
obscure passwords
Encodes six bits at a time (0 – 63) with a
single ASCII character
■ A - Z: 0 – 25
■ a – z: 26 – 51
■ 1 – 9: 52 – 61
■ + and - 62 and 63
See links Ch 3a, 3b
ORACLE -> T1JBQ0xF
■ Link Ch 3r
Base64 Example

More Related Content

What's hot

Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port ScanningSam Bowne
 
Chapter 1 Presentation
Chapter 1 PresentationChapter 1 Presentation
Chapter 1 PresentationAmy McMullin
 
Intrusion Detection with Neural Networks
Intrusion Detection with Neural NetworksIntrusion Detection with Neural Networks
Intrusion Detection with Neural Networksantoniomorancardenas
 
What is Penetration Testing?
What is Penetration Testing?What is Penetration Testing?
What is Penetration Testing?btpsec
 
Intruders
IntrudersIntruders
Intruderstechn
 
Ethical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jainEthical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jainSuvrat Jain
 
Ch 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringCh 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringSam Bowne
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissanceNishaYadav177
 
Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Sam Bowne
 
Computer Security and Intrusion Detection(IDS/IPS)
Computer Security and Intrusion Detection(IDS/IPS)Computer Security and Intrusion Detection(IDS/IPS)
Computer Security and Intrusion Detection(IDS/IPS)LJ PROJECTS
 
Packet sniffing in LAN
Packet sniffing in LANPacket sniffing in LAN
Packet sniffing in LANArpit Suthar
 
Vulnerability and Assessment Penetration Testing
Vulnerability and Assessment Penetration TestingVulnerability and Assessment Penetration Testing
Vulnerability and Assessment Penetration TestingYvonne Marambanyika
 
Network Security Fundamentals
Network Security FundamentalsNetwork Security Fundamentals
Network Security FundamentalsRahmat Suhatman
 

What's hot (20)

Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
 
Cyber Security Fundamentals
Cyber Security FundamentalsCyber Security Fundamentals
Cyber Security Fundamentals
 
Chapter 1 Presentation
Chapter 1 PresentationChapter 1 Presentation
Chapter 1 Presentation
 
Intrusion Detection with Neural Networks
Intrusion Detection with Neural NetworksIntrusion Detection with Neural Networks
Intrusion Detection with Neural Networks
 
What is Penetration Testing?
What is Penetration Testing?What is Penetration Testing?
What is Penetration Testing?
 
Intruders
IntrudersIntruders
Intruders
 
Ethical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jainEthical Hacking n VAPT presentation by Suvrat jain
Ethical Hacking n VAPT presentation by Suvrat jain
 
Ch 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringCh 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social Engineering
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissance
 
Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging
 
Ipsec
IpsecIpsec
Ipsec
 
Pen-Testing with Metasploit
Pen-Testing with MetasploitPen-Testing with Metasploit
Pen-Testing with Metasploit
 
Computer Security and Intrusion Detection(IDS/IPS)
Computer Security and Intrusion Detection(IDS/IPS)Computer Security and Intrusion Detection(IDS/IPS)
Computer Security and Intrusion Detection(IDS/IPS)
 
Ceh v5 module 04 enumeration
Ceh v5 module 04 enumerationCeh v5 module 04 enumeration
Ceh v5 module 04 enumeration
 
ip security
ip securityip security
ip security
 
Packet sniffing in LAN
Packet sniffing in LANPacket sniffing in LAN
Packet sniffing in LAN
 
Ceh v5 module 03 scanning
Ceh v5 module 03 scanningCeh v5 module 03 scanning
Ceh v5 module 03 scanning
 
Vulnerability and Assessment Penetration Testing
Vulnerability and Assessment Penetration TestingVulnerability and Assessment Penetration Testing
Vulnerability and Assessment Penetration Testing
 
Network Security Fundamentals
Network Security FundamentalsNetwork Security Fundamentals
Network Security Fundamentals
 
Chapter- I introduction
Chapter- I introductionChapter- I introduction
Chapter- I introduction
 

Similar to Ch 2: TCP/IP Concepts Review

CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)Sam Bowne
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network SecuritySam Bowne
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network SecuritySam Bowne
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.pptssuser3acfba
 
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...MathivananP4
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppthoangdinhhanh88
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptanwarkade1
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdfhelloraja
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdfhelloraja
 
tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtouseeqzulfiqar1
 

Similar to Ch 2: TCP/IP Concepts Review (20)

CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network Security
 
ADDRESSING PADA TCP IP
ADDRESSING PADA TCP IPADDRESSING PADA TCP IP
ADDRESSING PADA TCP IP
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network Security
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.ppt
 
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
The Internet protocol suite, commonly known as TCP/IP, is a framework for org...
 
Tcp ip
Tcp ipTcp ip
Tcp ip
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
tcpip.ppt
tcpip.ppttcpip.ppt
tcpip.ppt
 
Tcp
TcpTcp
Tcp
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdf
 
Ismail TCP IP.pdf
Ismail TCP IP.pdfIsmail TCP IP.pdf
Ismail TCP IP.pdf
 
tcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptxtcp-140613123317-phpapp01.pptx
tcp-140613123317-phpapp01.pptx
 
Internetworking
InternetworkingInternetworking
Internetworking
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 

Recently uploaded

Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 

Recently uploaded (20)

Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 

Ch 2: TCP/IP Concepts Review

  • 1. Hands-On Ethical Hacking and Network Defense Chapter 2 TCP/IP Concepts Review Last modified 1-11-17
  • 2. Objectives • Describe the TCP/IP protocol stack • Explain the basic concepts of IP addressing • Explain the binary, octal, and hexadecimal numbering system
  • 3. Overview of TCP/IP • Protocol • Common language used by computers for speaking • Transmission Control Protocol/Internet Protocol (TCP/IP) • Most widely used protocol • TCP/IP stack • Contains four different layers • Network • Internet • Transport • Application
  • 4.
  • 5. The Application Layer • Front end to the lower-layer protocols • What you can see and touch – closest to the user at the keyboard • HTTP, FTP, SMTP, SNMP, SSH, IRC and TELNET all operate in the Application Layer
  • 6.
  • 7. The Transport Layer • Encapsulates data into segments • Segments can use TCP or UDP to reach a destination host • TCP is a connection-oriented protocol • TCP three-way handshake • Computer A sends a SYN packet • Computer B replies with a SYN-ACK packet • Computer A replies with an ACK packet
  • 8. TCP Header Format 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgment Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | |U|A|P|R|S|F| | | Offset| Reserved |R|C|S|S|Y|I| Window | | | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  • 9. TCP Segment Headers • Critical components: • TCP flags • Initial Sequence Number (ISN) • Source and destination port • Abused by hackers finding vulnerabilities
  • 10. TCP Flags • Each flag occupies one bit • Can be set to 0 (off) or 1 (on) • Six flags • SYN: synchronize flag • ACK: acknowledge flag • PSH: push flag • URG: urgent flag • RST: reset flag • FIN: finish flag
  • 11. Initial Sequence Number (ISN) • 32-bit number • Tracks packets received • Enables reassembly of large packets • Sent on steps 1 and 2 of the TCP three- way handshake • By guessing ISN values, a hacker can hijack a TCP session, gaining access to a server without logging in
  • 12. TCP Ports • Port • Logical, not physical, component of a TCP connection • Identifies the service that is running • Example: HTTP uses port 80 • A 16-bit number – 65,536 ports • Each TCP packet has a source and destination port
  • 13. Blocking Ports • Helps you stop or disable services that are not needed • Open ports are an invitation for an attack • You can’t block all the ports • That would stop all networking • At a minimum, ports 25 and 80 are usually open on a server, so it can send out Email and Web pages
  • 14. TCP Ports (continued) • Only the first 1023 ports are considered well- known • List of well-known ports • Available at the Internet Assigned Numbers Authority (IANA) Web site (www.iana.org) • Ports 20 and 21 • File Transfer Protocol (FTP) • Use for sharing files over the Internet • Requires a logon name and password • More secure than Trivial File Transfer Protocol (TFTP)
  • 15.
  • 16. TCP Ports (continued) • Port 25 • Simple Mail Transfer Protocol (SMTP) • E-mail servers listen on this port • Port 53 • Domain Name Service (DNS) • Helps users connect to Web sites using URLs instead of IP addresses
  • 17. TCP Ports (continued) • Port 69 • Trivial File Transfer Protocol • Used for transferring router configurations • Had the "Sorcer's Apprentice Syndrome" Denial-of-Service vulnerability (link Ch2i) • (image from luharu.com)
  • 18. TCP Ports (continued) • Port 80 • Hypertext Transfer Protocol (HTTP) • Used when connecting to a Web server • Port 110 • Post Office Protocol 3 (POP3) • Used for retrieving e-mail • Port 119 • Network News Transfer Protocol • For use with newsgroups
  • 19. TCP Ports (continued) • Port 135 • Remote Procedure Call (RPC) • Critical for the operation of Microsoft Exchange Server and Active Directory • Port 139 • NetBIOS • Used by Microsoft’s NetBIOS Session Service • File and printer sharing
  • 20. 19 TCP Ports (continued) • Port 143 • Internet Message Access Protocol 4 (IMAP4) • Used for retrieving e-mail • More features than POP3
  • 21. Demonstration • Telnet to hills.ccsf.edu and netstat to see the connections • Port 23 (usual Telnet) • Port 25 blocked off campus, but 110 connects • Port 21 works, but needs a username and password
  • 22. Demonstration • Wireshark Packet Sniffer • TCP Handshake: SYN, SYN/ACK, ACK • TCP
 Ports • TCP
 Status
 Flags
  • 23. User Datagram Protocol (UDP) • Fast but unreliable protocol • Operates on transport layer • Does not verify that the receiver is listening • Higher layers of the TCP/IP stack handle reliability problems • Connectionless protocol
  • 24. The Internet Layer • Responsible for routing packets to their destination address • Uses a logical address, called an IP address • IP addressing • Packet delivery is connectionless
  • 25. Internet Control Message Protocol (ICMP) • Operates in the Internet layer of the TCP/IP stack • Used to send messages related to network operations • Helps in troubleshooting a network • Some commands include • Ping • Traceroute
  • 28. Warriors of the Net • Network+ Movie • Warriorsofthe.net (link Ch 2d)
  • 29. IP Addressing • Consists of four bytes, like 147.144.20.1 • Two components • Network address • Host address • Neither portion may be all 1s or all 0s • Classes • Class A • Class B • Class C
  • 30.
  • 31. IP Addressing (continued) • Class A • First byte is reserved for network address • Last three bytes are for host address • Supports more than 16 million host computers • Limited number of Class A networks • Reserved for large corporations and governments (see link Ch 2b) • Format: network.node.node.node
  • 32. IP Addressing (continued) • Class B • First two bytes are reserved for network address • Last two bytes are for host address • Supports more than 65,000 host computers • Assigned to large corporations and Internet Service Providers (ISPs) • Format: network.network.node.node • CCSF has 147.144.0.0 – 147.144.255.255
  • 33. IP Addressing (continued) • Class C • First three bytes are reserved for network address • Last byte is for host address • Supports up to 254 host computers • Usually available for small business and home networks • Format: network.network.network.node
  • 34. IP Addressing (continued) • Subnetting • Each network can be assigned a subnet mask • Helps identify the network address bits from the host address bits • Class A uses a subnet mask of 255.0.0.0 • Also called /8 • Class B uses a subnet mask of 255.255.0.0 • Also called /16 • Class C uses a subnet mask of 255.255.255.0 • Also called /24
  • 35. Planning IP Address Assignments • Each network segment must have a unique network address • Address cannot contain all 0s or all 1s • To access computers on other networks • Each computer needs IP address of gateway
  • 36. 42 Planning IP Address Assignments • TCP/IP uses subnet mask to determine if the destination computer is on the same network or a different network • If destination is on a different network, it relays packet to gateway • Gateway forwards packet to its next destination (routing) • Packet eventually reaches destination
  • 37. IPv6 • Modern operating systems like Windows 7 use IPv6 in addition to IPv4 • IPv6 addresses are much longer: 128 bits instead of the 32 bits used by IPv4
  • 39. Binary, Hexadecimal, and Base64 • Binary: uses only 0 and 1 • Eight bits per byte • Hexadecimal: uses 0-9 and a-f • 4 bits per character • Two characters per byte • Base64 • 6 bits per character • 4 characters for 3 bytes
  • 40. Base 64 Encoding Used to evade anti-spam tools, and to obscure passwords Encodes six bits at a time (0 – 63) with a single ASCII character ■ A - Z: 0 – 25 ■ a – z: 26 – 51 ■ 1 – 9: 52 – 61 ■ + and - 62 and 63 See links Ch 3a, 3b
  • 41. ORACLE -> T1JBQ0xF ■ Link Ch 3r Base64 Example