SWEN-331: Engineering Secure Software Benjamin S Meyers
Networking & Network Attacks
Engineering Secure Software
Last Revised: August 28, 2020 1
Networking & Network Attacks Engineering Secure Software Last - - PowerPoint PPT Presentation
Networking & Network Attacks Engineering Secure Software Last Revised: August 28, 2020 SWEN-331: Engineering Secure Software Benjamin S Meyers 1 Why Do We Study Networks? Networks scans are the most prevalent method of understanding
SWEN-331: Engineering Secure Software Benjamin S Meyers
Last Revised: August 28, 2020 1
SWEN-331: Engineering Secure Software Benjamin S Meyers
2
SWEN-331: Engineering Secure Software Benjamin S Meyers
3
Source: https://www.electronicdesign.com/unused/article/21800810/whats-the-difference-between-the-osi-sevenlayer-network-model-and-tcpip
SWEN-331: Engineering Secure Software Benjamin S Meyers
4
SWEN-331: Engineering Secure Software Benjamin S Meyers
5
SWEN-331: Engineering Secure Software Benjamin S Meyers
6
SWEN-331: Engineering Secure Software Benjamin S Meyers
7
SWEN-331: Engineering Secure Software Benjamin S Meyers
8
SWEN-331: Engineering Secure Software Benjamin S Meyers
9
SWEN-331: Engineering Secure Software Benjamin S Meyers
10 10
SWEN-331: Engineering Secure Software Benjamin S Meyers
11 11
Classic Model 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 DataLink 1 Physical OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
12 12
Classic Model 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 DataLink 1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
13 13
Classic Model 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
14 14
Classic Model 7 Application 6 Presentation 5 Session 4 Transport 3 Network
Packet routing (IP Address source/dest and port) to socket
2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
15 15
Classic Model 7 Application 6 Presentation 5 Session 4 Transport
Responsible for quality of service and data integrity
3 Network
Packet routing (IP Address source/dest and port) to socket
2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
16 16
Classic Model 7 Application 6 Presentation 5 Session
Establishes connection between devices (also maintains, authenticates, etc.)
4 Transport
Responsible for quality of service and data integrity
3 Network
Packet routing (IP Address source/dest and port) to socket
2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
17 17
Classic Model 7 Application 6 Presentation
Ensures compatibility between the data formats from lower to upper layers
5 Session
Establishes connection between devices (also maintains, authenticates, etc.)
4 Transport
Responsible for quality of service and data integrity
3 Network
Packet routing (IP Address source/dest and port) to socket
2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
18 18
Classic Model 7 Application
Works with applications to provide communications & functions
6 Presentation
Ensures compatibility between the data formats from lower to upper layers
5 Session
Establishes connection between devices (also maintains, authenticates, etc.)
4 Transport
Responsible for quality of service and data integrity
3 Network
Packet routing (IP Address source/dest and port) to socket
2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
19 19
Classic Model Modern Model 7 Application
Works with applications to provide communications & functions
Applications (FTP, HTTP, SMTP, etc.) 6 Presentation
Ensures compatibility between the data formats from lower to upper layers
5 Session
Establishes connection between devices (also maintains, authenticates, etc.)
4 Transport
Responsible for quality of service and data integrity
TCP 3 Network
Packet routing (IP Address source/dest and port) to socket
IP 2 DataLink
Pack/unpack data frame (MAC source/dest) -- unique identifier
Ethernet 1 Physical
Physical connection, data rates, bit level handling
OSI 7-Layer Model vs. Modern Network/Internet Model
SWEN-331: Engineering Secure Software Benjamin S Meyers
20 20
Application Transport Network DataLink Network DataLink Network DataLink Application Transport Network DataLink Destination Computer Source Computer Router Router
SWEN-331: Engineering Secure Software Benjamin S Meyers
21 21
TCP Packet SEQ=1, LEN=700 TCP Packet SEQ=2, LEN=1000 TCP Packet SEQ=20, LEN=250
Client
TCP Packet ACK=1 TCP Packet ACK=2 TCP Packet ACK=20
Server
SWEN-331: Engineering Secure Software Benjamin S Meyers
22 22
TCP Packet SEQ=1, LEN=700 TCP Packet SEQ=1, LEN=700 TCP Packet SEQ=20, LEN=250
Client
TCP Packet ACK=1 TCP Packet ACK=20
Server
Timeout ➝ Retransmission
SWEN-331: Engineering Secure Software Benjamin S Meyers
23 23
Source Port Destination Port Sequence Number Ack Number Data Offset Reserved Flags Window Checksum Urgent Options and Padding Data (Variable Size) 4 octets (32 bits) Header (20 octets)
SWEN-331: Engineering Secure Software Benjamin S Meyers
24 24
SWEN-331: Engineering Secure Software Benjamin S Meyers
25 25
SWEN-331: Engineering Secure Software Benjamin S Meyers
26 26
SWEN-331: Engineering Secure Software Benjamin S Meyers
27 27
SWEN-331: Engineering Secure Software Benjamin S Meyers
28 28
SWEN-331: Engineering Secure Software Benjamin S Meyers
29 29 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-27 14:59 EDT Nmap scan report for bob.rit.edu (129.22.187.155) Host is up (0.041s latency). Not shown: 984 filtered ports PORT STATE SERVICE 22/tcp open ssh 443/tcp closed https 2020/tcp closed xinupageserver 6000/tcp closed X11 6001/tcp open X11:1 6002/tcp closed X11:2 6003/tcp closed X11:3 6004/tcp closed X11:4 6005/tcp closed X11:5 6006/tcp closed X11:6 6007/tcp closed X11:7 6666/tcp closed irc 8000/tcp closed http-alt 8081/tcp closed blackice-icecap 8082/tcp open blackice-alerts 8181/tcp open intermapper Nmap done: 1 IP address (1 host up) scanned in 4.46 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
30 30 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-27 15:02 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.00021s latency). Not shown: 65529 closed ports PORT STATE SERVICE 631/tcp open ipp 1716/tcp open xmsg 5432/tcp open postgresql 5433/tcp open pyrrho 27017/tcp open mongod 39517/tcp open unknown Nmap done: 1 IP address (1 host up) scanned in 3.13 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
31 31 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-27 15:06 EDT Nmap scan report for jill.rit.edu (129.25.189.221) Host is up (0.038s latency). PORT STATE SERVICE 21/tcp filtered ftp 22/tcp open ssh 23/tcp filtered telnet 25/tcp filtered smtp 53/tcp filtered domain 80/tcp filtered http 110/tcp filtered pop3 111/tcp filtered rpcbind ... 443/tcp closed https ... 995/tcp filtered pop3s 1723/tcp filtered pptp 3306/tcp filtered mysql ... 8080/tcp filtered http-proxy Nmap done: 1 IP address (1 host up) scanned in 1.63 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
32 32 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-30 10:03 EDT Nmap scan report for andy.rit.edu (129.27.184.101) Host is up (0.038s latency). Not shown: 984 filtered ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 f2:1a:87:3a:d7:04:b7:a8:b1:c5:25:83:c2:16:f1:07 (RSA) | 256 de:86:8b:5a:df:24:bb:71:9b:53:a6:ae:4e:80:11:1f (ECDSA) |_ 256 8f:97:db:c6:72:81:e4:a4:72:bd:bb:57:bb:b4:83:5d (EdDSA) ... 8082/tcp open http Tornado httpd 5.1.1 ... Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 118.82 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
33 33 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-27 15:10 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.00035s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 631/tcp open ipp CUPS 2.2 5432/tcp open postgresql PostgreSQL DB 9.6.0 or later 1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service : SF-Port5432-TCP:V=7.60%I=7%D=8/27%Time=5F480546%P=x86_64-pc-linux-gnu%r(SM SF:BProgNeg,8C,"E\0\0\0\x8bSFATAL\0VFATAL\0C0A000\0Munsupported\x20fronten SF:d\x20protocol\x2065363\.19778:\x20server\x20supports\x202\.0\x20to\x203 SF:\.0\0Fpostmaster\.c\0L2065\0RProcessStartupPacket\0\0"); Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 6.77 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
34 34
SWEN-331: Engineering Secure Software Benjamin S Meyers
35 35
SWEN-331: Engineering Secure Software Benjamin S Meyers
36 36 Starting Nmap 7.60 ( https://nmap.org ) at 2020-08-30 10:16 EDT NSE: Loaded 1 scripts for scanning. NSE: Script Pre-scanning. ... Nmap scan report for paul.rit.edu (129.24.133.233) Host is up (0.039s latency). Not shown: 984 filtered ports PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 2048 f2:1a:87:3a:d7:04:b7:a8:b1:c5:25:83:c2:16:f1:07 (RSA) | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnBX1anz+PcgdAq/7...vPxOkBGk8JxmdD/Sk1uG3pqqvQX6u5Hs8XDH8MxZvlKClAN9zdkq39S6gOYS | 256 de:86:8b:5a:df:24:bb:71:9b:53:a6:ae:4e:80:11:1f (ECDSA) | ecdsa-sha2-nistp256 2VjZHNhLXNoYTItbmlzdHAyNTYAbHAyNTYAAABBBOSBzc...BhVS5fHW6vd+Net4RouExNKzLlAT8xXx0qiIx8MBY2QHYH1w | 256 8f:97:db:c6:72:81:e4:a4:72:bd:bb:57:bb:b4:83:5d (EdDSA) |_ssh-ed25519 C3NzaC1lZDI1NTE5AAAAIDmN...+9aIa22fCx3y8pmHjyoHsZrz0ZoK2ZGB ... Nmap done: 1 IP address (1 host up) scanned in 5.73 seconds
SWEN-331: Engineering Secure Software Benjamin S Meyers
37 37
SWEN-331: Engineering Secure Software Benjamin S Meyers
38 38
Probe Response Assigned State No response received (even after retransmission) Open | Filtered TCP RST packet Closed ICMP unreachable error (type 3; code 1, 2, 3, 9, 10, or 13) Filtered Full response (ack, etc.) Open
SWEN-331: Engineering Secure Software Benjamin S Meyers
39 39
SWEN-331: Engineering Secure Software Benjamin S Meyers
root@kali:~# nmap -O 192.168.5.102 Starting Nmap 7.01 ( https://nmap.org ) at 2016-03-04 21:16 CET Nmap scan report for 192.168.5.102 Host is up (0.30s latency). Not shown: 977 closed ports PORT STATE SERVICE 21/tcp open ftp 53/tcp open domain 80/tcp open http 88/tcp open kerberos-sec 111/tcp open rpcbind 135/tcp open msrpc 139/tcp open netbios-ssn 389/tcp open ldap 445/tcp open microsoft-ds … 49152/tcp open unknown 49153/tcp open unknown 49154/tcp open unknown 49155/tcp open unknown 49157/tcp open unknown 49158/tcp open unknown Device type: general purpose Running: Microsoft Windows 7|2012|XP OS CPE: cpe:/o:microsoft:windows_7 cpe:/o:microsoft:windows_server_2012 cpe:/o:microsoft:windows_xp::sp3 OS details: Microsoft Windows 7 or Windows Server 2012, Microsoft Windows XP SP3 OS detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 153.47 seconds
40 40
Ports are identified and their state is listed
SWEN-331: Engineering Secure Software Benjamin S Meyers
41 41
SWEN-331: Engineering Secure Software Benjamin S Meyers
42 42
SWEN-331: Engineering Secure Software Benjamin S Meyers
43 43
SWEN-331: Engineering Secure Software Benjamin S Meyers
44 44