Learning - Diary - IoT ShuFen Cheng
Learning - Diary - IoT ShuFen Cheng
These are optional fields about your identity, leave empty if you want to remain anonymous:
Email address (prefer your @students.oamk.fi email if you have such address):
[email protected]
Save the final version of this document as PDF and submit it for peer reviews via Moodle’s
workshop tool before the deadline. Last course week is for peer reviews.
Some courses may have 5 weeks, and some may have 8 weeks of assignments. This is a generic
learning diary template. Adapt and edit the document accordingly.
link for material and questions
https://tl.oamk.fi/iot/
1
Learning diary and answers
Week 1
Assignments to learning diary (You can do these assignments in small groups. Learning
diaries are personal):
1. Define the following terms and concepts shortly:
Answer
Terms Concepts
Network bandwidth Maximum speed at which data can be transferred
through the network, usually measured in bps (bits per
second)
Network throughput The actual data transfer rate achieved, showing
efficiency relative to bandwidth.
Packet loss and jitter Packet Loss: A data packet transmitted over a network
that does not reach its destination.
bps vs Bps bps (bits per second): number of bits per second, unit of
communication speed.
Bps (Bytes per second): number of bytes per second (1
byte = 8 bits), unit of data transfer rate.
Protocol payload The part of the Protocol Data Unit (PDU) that contains
the actual data.
Protocol overhead (especially for Additional data required to control and manage data
resource-constrained IoT purposes) transfer; protocols with low overhead are important in
the IoT as resources are limited.
Spanning Tree Protocol It is used between switches to avoid loops and manage
redundant paths in the network.
Collision domain The extent to which collisions occur when multiple
devices send data simultaneously on a network.
Broadcast domain The range of the network that broadcast packets can
reach. Usually separated by routers.
SOHO network Networks for small offices and home offices. Features
a simple, low-cost design.
MAC (physical) address Unique physical address assigned to a network
interface card (NIC).
Physical layer protocol data unit (PDU) Unit of bitstream. Format of data transmitted at the
physical layer of a network.
MAC layer protocol data unit (PDU) The data units, called frames, are exchanged at the data
link layer.
Half-duplex vs Full-duplex Half-Duplex: communication system that allows data
to be transmitted or received in one direction at a time.
Full-Duplex: A communication method that allows
data to be sent and received simultaneously in both
directions.
2
Learning diary and answers
Terms Concepts
Networking physical vs logical Physical Topology: the actual physical arrangement of
topology network devices.
Logical Topology: the logical structure of how data
flows through the network.
Ethernet cabling categories. For Classification of cable performance. For example, CAT
example, CAT 6 6 is a cable capable of transmitting data at up to 10
Gbps.
8P8C (RJ45) 8P8C connector. 8-pin connector, usually referred to as
RJ45, used to terminate Ethernet cables.
Wifi AD HOC A network configuration in which devices
communicate directly with each other without access
points.
IEEE 802.11ac, 802.11ax, 802.11be IEEE 802.11ac: standard that uses the 5 GHz band to
provide fast Wi-Fi communications.
2. Estimate how long does it take to download 3 TB file from cloud based backup service
if network download throughput is 200 Mbps for actual payload (i.e. data)?
Answer:
3TB data is 3 million megabits.
The download speed is 200Mbps.
To calculate the download time, we can use formula: Time = Total data/Speed.
Above all information, and formula, 3 m mbps/200mpbs = 15K seconds.
1 hour is 3600 seconds, 15K seconds is approximately 4.17 hours.
3. Locate the MAC address of your mobile phone, laptop wifi interface or some other
networked IT device
o How did you find it?
Answer:
There are several ways to find it:
Windows laptop (Wi-Fi interface)
Open the Start menu and type ‘cmd’ to open the command prompt.
At the command prompt, type ipconfig /all and press Enter.
In the information output, look for the section ‘Wireless LAN adapter Wi-Fi’.
The section marked ‘Physical Address’ is the MAC address. It is usually in the format
XX-XX-XX-XX-XX-XX-XX.
3
Learning diary and answers
iPhone
Open the Settings app.
Tap General, then tap Info.
The string displayed as ‘Wi-Fi address’ is the MAC address.
Android smartphones
Open the Settings app.
Tap Device Info or Device Info.
Locate the Status or Network section and check the Wi-Fi MAC address.
o List the MAC address in hex format (such as f0:1f:af:cf:d9:1a), but replace last
24 bits with zeros for your privacy
Answer:
If the MAC address f0:1f:af:cf:d9:1a is replaced by the last 24 bits with zeros to protect
privacy, the following is obtained
Modified MAC address: f0:1f:af:00:00:00
By presenting the MAC address in this format, the OUI (vendor identification part) can
be preserved while avoiding the identification of the device.
o Use OUI MAC address list(s) or lookup tools, and determine the device/chipset
vendor of that MAC address. For example, that f0:1f:af:cf:d9:1a is Dell inc.
Answer:
Using the first 24 bits (OUI) of the MAC address f0:1f:af to identify the vendor, the
manufacturer of this address is Dell Inc.
This indicates that the MAC address is assigned to a network device or chipset
manufactured by Dell; the OUI (Organizationally Unique Identifier) part can be used to
identify the manufacturer of the device.
4
Learning diary and answers
4. Describe shortly what are these network devices, functions, and services
Answer:
Core switch A core switch is the primary switch in a network, built to transfer
data fast. A core switch sits at the top of a network's structure. It
handles more data and offers enhanced reliability compared to
other switches. The core switch acts as the main artery of a
network.
Here you can see access switch and core switch
layers and how it working
Edge router Edge router is used at two main demarcation points, the internet
and wide area networks (WAN). WAN are networks that connect
multiple businesses or institutions but are not connected to the
internet as a whole. Edge routers are able to interface with any
network that an average router would.
5
Learning diary and answers
Core router A core router is a high-capacity router used in the central part of
large networks. Its main role is to quickly and reliably transport
data between different parts of the network It will often prioritize
speed and minimize congestion and packet loss.
6
Learning diary and answers
5. RFC assignments
o What are RFCs?
Answer:
Requests for Comments (RFCs) are a series of documents describing various aspects of
computer networking. These include protocols, procedures, policies, etc. RFCs are
published by the **Internet Engineering Task Force (IETF) and the Internet Society
(ISOC)**.
o How many PPP related RFC documents can you find from rfc-editor website?
Answer:
Point-to-Point Protocol has around 111 PP relate to RFC documents. The reference
website is https://www.rfc-editor.org/ . Below is the screenshot for the reference.
o What is the current status of RFC1597? What is the number for updated, more
recent RFC of same topic?
Answer:
It is the Address Allocation for Private internet. It does not specify an Internet standard
of any kind. It was superseded by RFC 1918, which is the more recent and updated
document on the same topic
o List authors of the CoAP RFC (June 2014). What is the RFC number?
Answer:
Authors as below list and the number is RFC7252 who published in June 2014. The
authors of RFC 7252 are:
Z. Shelby
K. Hartke
C. Bormann
7
Learning diary and answers
o Twitch.tv provides IRC access to the stream chats. Which RFC defines the
original Internet Relay Chat (IRC) Protocol?
Answer:
Twitch.tv: A live streaming platform for video games, esports, and creative content,
reference website https://www.twitch.tv/
The RFC that defines the original Internet Relay Chat (IRC) Protocol used by Twitch.tv
stream chats is RFC 1459.
Twitch.tv leverage the function define in RFC1459 to enable chat with stream.
8
Learning diary and answers
Week 2
Assignments to learning diary (You can do these assignments in small groups. Learning
diaries are personal):
7. What are VLANs and IEEE 802.1q?
Answer:
Virtual Local Area Networks (VLANs) is a technology for virtually partitioning the physical
network infrastructure. This allows the creation of different network segments within the same
physical network. This can improve the network management, security and efficiency.
IEEE 802.1Q is a standard for VLAN tagging. This standard defines a method for inserting
VLAN information into Ethernet frames.
IEEE 802.1Q is a standard for adding VLAN information to Ethernet frames and is used to
efficiently manage multiple VLANs.
9
Learning diary and answers
Terms Concepts
WoL (Wake-on-LAN) Wake-on-LAN (WoL) is a feature that allows
computers to wake up from sleep mode via the
network. The computer is switched on when certain
‘magic packets’ are received.
UPnP Universal Plug and Play (UPnP) is a protocol that
allows network devices to be automatically detected
and easily configured and connected. This makes it
easy to add and configure network devices.
Traceroute / Tracepath Traceroute or Tracepath is a tool that traces the
paths that packets take through a network. It
measures the response time of each hop (relay point)
on the network.
Network Address Translation (NAT) NAT (Network Address Translation) is a technology
that translates private IP addresses into public IP
addresses. This allows several internal devices to
share a single public IP address.
Tier 1 and 2 networks Tier 1 networks: large providers that make up the
global Internet backbone and exchange traffic over
interconnections.
Tier 2 networks: regional Internet service providers
that connect to Tier 1 networks and serve end-users.
Tier 3 ISP Tier 3 ISPs (Tier 3 Internet Service Providers) are
providers that offer services directly to end-users and
mainly obtain traffic from Tier 2 or Tier 1 networks.
Routing Autonomous System (AS or An AS (Autonomous System) is a collection of
ASN for BGP) networks that exchange routing information over the
Internet using the Border Gateway Protocol
(BGP).The ASN (Autonomous System Number) is a
unique number assigned to an AS.
127.0.0.1 address 127.0.0.1 is the ‘loopback address’ and refers to
your own computer. This address can be used to test
the network stack and access local services.
::1 address The::1 is an IPv6 loopback address and refers to
one's own IPv6 address; it is used for testing the
IPv6 network stack and accessing local services.
0.0.0.0/0 and ::/0 networks in the routing 0.0.0.0/0: Indicates the IPv4 default route and
table includes all IP addresses.
::/0: Indicates the IPv6 default route and contains all
IPv6 addresses.
Ranges of IPv4 multicast and IPv4 multicast address: range from 224.0.0.0 to
experimental addresses 239.255.255.255.
IPv4 experimental addresses: range from 240.0.0.0
to 255.255.255.255. These are usually reserved for
experimental or future use.
10
Learning diary and answers
o List some public peering exchange points the AS1741 connects to?
Answer:
Amsterdam Internet Exchange (AMS-IX) in the Netherlands.
London Internet Exchange (LINX) in the UK, and DE-CIX in Frankfurt,
o To which regional internet registry (RIR) the AS1741 belongs to?
Answer:
AS1741 (Cogent Communications) belongs to ARIN (American Registry for Internet
Numbers) ARIN is a Regional Internet Registry (RIR) covering North America (United
States, Canada and the Caribbean). RIR).
o What is the contact email address/phone/web form if you would need to inform
some security or abuse issues to the owner of the AS1741?
Answer:
You can report directly to Cogent Communications using the email address or web
form.
Security: [email protected]
Abuse: [email protected]
10. What it the difference between static and dynamic routing? Use example(s)
Answer:
Static routing (Static Routing)
Static routing is a method whereby the network administrator manually configures routes.
The routes are fixed and any changes to the network require manual updates. It consumes
fewer resources and traffic flows are more predictable but becomes more difficult to manage
as the network grows in size. An example is a simple network configured directly between
two routers.
11
Learning diary and answers
12. Create a DNS request (any tool such as ping, nslookup, whatever) to resolve the IP address
of www.oamk.fi
Answer:
I key these commands to my cmd, then you will see as screen shoot
12
Learning diary and answers
o Use some IP who is lookup web service to resolve which company is hosting and
has that IP address and server? (www.oamk.fi)
Answer:
Follow the IP address, and www.oamk.fi two different typs and check at who is lookup,
you will get result.
Hosting company is Upcloud Cloud Servers
13
Learning diary and answers
o How many hops (routers) are there to the www.whitehouse.gov from your
device?
Answer:
There are 6 hops to reach the destination 192.0.66.168.
o Use traceroute again, but this time to Google's public DNS server in 8.8.8.8, and
Quad9 DNS in 9.9.9.9. How far are those?
Answer
For Google's Public DNS servers 8.8.8.8 and 9.9.9.9 here are results:
o Why traceroute does not always work, and does not show the route up to the
final destination IP, or there are timeouts for some routers (* is timeout)? For
example, IP address of education.gov.au
Answer
Traceroute may not always show the complete route due to some reasons for esample:
firewalls, rate limiting, or network configuration.
14
Learning diary and answers
Firewalls and Security is most command reason because routers and servers along the
path might block ICMP packets used by traceroute, causing timeouts or missing hops.
ICMP Rate Limiting: Some routers might limit the rate of ICMP responses or prioritize
other types of traffic, resulting in timeouts. Network Configuration: Certain network
configurations, such as NAT or complex routing setups, can affect traceroute results.
Number of Hops: The number of lines displayed in the traceroute output represents the
total number of hops (routers) between your device and the destination
o Use traceroute and DNS to estimate/guess from response DNS names, round trip
times, and with IP whois lookups, where the web server reliefweb.int is located
(continent, country or so)?
Answer:
Below are results from reliefweb.int to the command prompt. (I need to manual stop it
after many request timed out.)
Analyze DNS Names and IP Addresses: From the traceroute results, the progression of
hops through networks such as twelve99.net suggests traversing through the network
infrastructure of Telia Company, a major network service provider, predominantly
operational in Europe.
15
Learning diary and answers
Round Trip Times: The round-trip times vary from 6 ms to 109 ms, with the longest
times occurring at hop 8. These times represent the delays experienced at various network
nodes (like routers and switches) between the origin and the destination server. These
measurements can vary depending on network congestion, the routes taken by packets, and
the configuration of intermediate routers.
16
Learning diary and answers
Explain This range supports a This range includes This block contains
network with 1,048,576 addresses. It 65,536 addresses,
16,777,216 private IP includes 16 contiguous encompassing all
addresses. It covers all class B network numbers addresses where the
addresses where the starting from 172.16.0.0 up first two octets are
first octet is 10. Often to 172.31.255.255. This is 192.168. It’s
used in large frequently used in medium- commonly used in
organizations due to sized networks. smaller networks
the vast number of such as home
hosts it can networks or small
accommodate. businesses.
These range are used tin combination with network address translation to facilitate
communication between a private network and the internet. Allow multiple devices to share
single public IP addresses.
IPv4 stands for Internet Protocol version 4. It is the underlying technology that makes it
possible for us to connect our devices to the web. Whenever a device accesses the Internet, it is
assigned a unique, numerical IP address such as 99.48.
17
Learning diary and answers
17. List and explain three or more purposes and features of the ICMP and or ICMPv6
protocol.
Answer:
The Internet Control Message Protocol (ICMP) and ICMPv6 are essential protocols used for
sending error messages and other operational information between hosts on the internet.
List ICMP and ICMPv6 purpose and features as below
key purposes ICMP: ICMPv6
and features
Error Report errors that occur during the Report errors in IPv6 packet
Reporting transmission of IP packets. Eg: if a transmission. It includes specific error
destination host is unreachable, a messages for IPv6-related issues, such
"destination host unreachable" as "packet too big," "address
message is sent back to the source unreachable," and "port unreachable."
host.
Echo It sends echo requests and receive It sends echo requests and replies,
Requests and echo replies, which are providing similar functionality for
Replies: fundamental for network IPv6 networks.
diagnostics and troubleshooting. By
sending an echo request to a
destination host and measuring the
time it takes for the reply to return,
administrators can determine
network latency, packet loss, and
other performance metrics.
Router No function for this. ICMPv6 includes specific messages
Solicitation However ICMP support network for router solicitation and
and layer management. It can help advertisement, which are essential for
Advertisement regulate the flow data. IPv6 network discovery and
configuration. Routers can send router
advertisements to announce their
presence and capabilities to other
hosts on the network, while hosts can
send router solicitations to request
information about available routers.
18. Try to solve these basic IP subnet calculations without checking the solutions:
If network address is 192.168.100.0, and subnet mask is 255.255.255.224, what is the
broadcast address of the network?
Answer
You can check these data from this website https://www.omnicalculator.com/other/ip-subnet
18
Learning diary and answers
After giving 192.168.100.0 and subnet mask is 255.255.255.224. We get same solution from the
link.
o If network address is 1.2.3.4, and broadcast address is 1.2.3.7, what is the subnet
mask of the network?
Answer:
This need to calculate the network address and broadcast address to get subnet mask
Network Address: 1.2.3.4
Broadcast Address: 1.2.3.7
The range includes 1.2.3.4 to 1.2.3.7, which suggests that the subnet mask allows for 4
addresses (4 - 0 = 3 + 1 = 4). The subnet mask that allows exactly four addresses in the
last octet (since only the last octet is changing) is 255.255.255.252. This subnet mask
uses the first 30 bits as network bits (since 2^2 = 4 and we need 2 bits for the host to
provide 4 addresses), so the subnet mask is 255.255.255.252.
(Check the solution from link, it is correct)
19
Learning diary and answers
19. Try to solve these IP subnetting assignments without checking the solutions and
document at least some examples/answers to the learning diary. Answers should
contain (for each subnet): Network address, broadcast address and subnet mask:
Answer:
We need each subnet and calculate the number of addresses to define number of host addresses
needed. The process as below:
A. Find the smallest power of 2: Find the smallest power of 2 that is equal to or greater than the
number of addresses required. This determines how many addresses are needed in the subnet.
B. Calculate subnet mask: Convert the number of addresses into the subnet mask. The subnet
mask determines the size of the subnet in terms of how many addresses it can hav
o Subnetting task 1:
▪ The address space available is 172.16.64.0/23. Subnet it and create 5 (A,
B, C, D and E) IPv4 subnets with following amount of hosts in each
network: A = 85, B = 45, C = 95, D = 57, E = 34.
▪ Leave some small amount of free addresses to each subnet. Avoid
unnecessary waste of IPs.
Answer:
Here are information we have on hand:
Network Address: 172.16.64.0/23/ Number of Subnets: 5/Number of Hosts per Subnet: A
= 85, B = 45, C = 95, D = 57, E = 34.
In different of network amount and host, the result of host and network:
Subnet A: Needs 85 hosts + some for network and broadcast addresses. The closest
subnet mask is /25 which supports 128 hosts (126 usable).
Subnet B: Needs 45 hosts. The closest subnet mask is /26 which supports 64 hosts (62
usable).
Subnet C: Needs 95 hosts. The closest subnet mask is /25 which supports 128 hosts (126
usable).
Subnet D: Needs 57 hosts. The closest subnet mask is /26 which supports 64 hosts (62
usable).
Subnet E: Needs 34 hosts. The closest subnet mask is /26 which supports 64 hosts (62
usable).
Base on the subnet host and network, we can get below
Host Network Broadcast Subnet Mask Assign subnets
Amount Address Address based on size
Network A 85 172.16.64.128 172.16.64.255 255.255.255.128 172.16.64.128/25
20
Learning diary and answers
o Subnetting task 2:
▪ Same as task 1, but available address space is now 192.168.0.0/25 and
networks/hosts are: A = 28, B = 10, C = 60, D = 4.
▪ Leave some small amount of free addresses to each subnet. Avoid
unnecessary waste of IPs.
Answer:
Process is like task1, since we need 4 subnets, we need to borrow 2 bits from the host
portion. Therefore, the subnet mask is 255.255.255.128 (25 + 2 = 27).
Subnet A: Needs 28 hosts. Use /27 which supports 30 usable hosts.
Subnet B: Needs 10 hosts. Use /28 which supports 14 usable hosts.
Subnet C: Needs 60 hosts. Use /26 which supports 62 usable hosts.
Subnet D: Needs 4 hosts. Use /29 which supports 6 usable hosts.
In this case, below is these host and network addresses:
Host Network Broadcast Subnet Mask Assign subnets
Amount Address Address based on size
Network A 30 192.168.0.0 192.168.0.127 255.255.255.128 192.168.0.64/27
o Subnetting task 3:
▪ IPv6 address space available: 2001:708:510::/48. Create four /64 IPv6
networks.
Answer:
The calculation for address space is (address amount)2: 642 addresses available for
subnets.
Creating four /64 subnets from a /48 is straightforward:
Network Broadcast Address Subnet Mask Usable host
Address
Subnet 1 2001:708:510:: 2001:708:510:ffff: 2001:708:510:: 2001:708:510:0001:00
ffff:ffff:ffff:ffff /64 00:0000:0000:0000 -
2001:708:510:ffff:ffff:f
fff:ffff:fffe
Subnet 2 2001:708:510:1:: 2001:708:510:1:fff 2001:708:510:: 2001:708:510:1:0001:0
f:ffff:ffff:ffff /64 000:0000:0000 -
2001:708:510:1:ffff:ffff
:ffff:fffe
Subnet 3 2001:708:510:2:: 2001:708:510:2:fff 2001:708:510:: 2001:708:510:2:0001:0
f:ffff:ffff:ffff /64 000:0000:0000 -
2001:708:510:2:ffff:ffff
:ffff:fffe
Subnet 4 2001:708:510:3:: 2001:708:510:3:fff 2001:708:510:: 2001:708:510:3:0001:0
f:ffff:ffff:ffff /64 000:0000:0000 -
2001:708:5
21
Learning diary and answers
Week 3
20. Use Linux or Windows command line telnet or any other TCP socket client application
(install Putty or any telnet client if needed) to access the TCP service in
pouta.ipt.oamk.fi listening TCP port 55555. What is the text string the server replies to
your TCP connection if you send some plain text string + newline to it?
Answer:
After install telnet at my ubuntu, and start doing the pouta.ipt.oamk.fi
22
Learning diary and answers
o What are the common well-known network service names for these TCP ports:
22, 23, 25, 80, 443, 3306?
Answer:
23
Learning diary and answers
o What are connectionless protocols features (or lack of), and why UDP is
connectionless protocol?
Answer:
24
Learning diary and answers
Connectionless protocols operate in this manner. One casts a datagram onto the network
with the understanding that it will be delivered on a best-effort basis to whomever it is
addressed to. In addition, we accept that there is no notification of a failure, nor can we
make assumptions about the sequence of delivery. UDP is a great example of this sort of
communication.
o Why most services using UDP prefer max 512 byte UDP datagrams?
Answer:
The maximum safe UDP payload is 508 bytes, not 512 bytes. This is a packet size of
576 (the "minimum maximum reassembly buffer size"), minus the maximum 60-byte IP
header and the 8-byte UDP header. So 576-60-8 = 508.
o
When it is more reasonable to use UDP instead of TCP?
Answer:
Here are these two differences
Factor TCP UDP
Connection Requires an established connection No connection is needed to start
type before transmitting data and end a data transfer
Data sequence Can sequence data (send in a specific Cannot sequence or arrange data
order)
Data Can retransmit data if packets fail to No data retransmitting. Lost data
retransmission arrive can’t be retrieved
Delivery Delivery is guaranteed Delivery is not guaranteed
Check for Thorough error-checking guarantees Minimal error-checking covers
errors data arrives in its intended state the basics but may not prevent all
errors
Broadcasting Not supported Supported
25
Learning diary and answers
Speed Slow, but complete data delivery Fast, but at risk of incomplete
data delivery
Overall comparation, UDP is best suited for transferring a steady flow of live data. This
allows many users to access data easily and quickly, if not in perfect condition. So in
some online game, video chatting or conferencing, VoIP(in app voice calling) are good
to use UDP.
o What is the length of TCP header without extra options? What about UDP
header?
Answer:
Without any extra options, the TCP header is 20 bytes long. And An 8-byte header
allows only compulsory function data.
26
Learning diary and answers
27
Learning diary and answers
you’re looking for the application that is said to implement the SMB
protocol.
CIFS stands for “Common Internet File System.”
CIFS is a dialect of SMB. CIFS is a particular implementation of the
Server Message Block protocol, created by Microsoft.
23. When listing services with netstat command, what is the meaning if some network
service is LISTENING and binded to the IP address 127.0.0.1? What if the service is
LISTENING IP address 0.0.0.0?
Answer:
When using the netstat command to list network services, and it encounter services that are
listening and bound to specific IP addresses:
LISTENING on 127.0.0.1: This IP address represents the loopback interface. The service is
only accessible from within the local machine. It cannot be accessed from external devices or
networks and is therefore mainly used for security purposes. The service is only accessible from
processes running on the same machine.
LISTENING at 0.0.0.0: This IP address is a special address that represents all available
network interfaces on a system. The service is accessible on all network interfaces of the
machine. It can also be accessed from other devices in the local network and, if properly
configured, from the Internet. The service is accessible from any network interface on the
machine.
24. Why some applications are using or offer “keepalive” mechanism to maintain
established connection (for example SSH connections)?
Answer:
Keep-alive mechanisms in network connections are designed to prevent idle connections from
being terminated by network devices or firewalls. It is used in various network applications to
ensure that connections remain open and active, especially when there are periods of idleness
during a session.
When these applications use SSH, that uses keepalive messages to prevent the session from
being dropped by intermediate devices (like routers or firewalls) that might close connections
they perceive as idle.
And it can detect disconnections, without keepalives, an application might not realize that a
session has been disconnected by a network error or server crash, potentially leading to delays
in recovery and reconnection.
This helps in maintaining consistent application performance and reliability.
25. Study available options with command line command “netstat /?” (Windows) or
netstat –help (Linux, maybe MacOS). What different things you can check with netstat
command?
Answer:
Use netstat it shows: (There are more but I just screen shot part of them)
28
Learning diary and answers
29
Learning diary and answers
30
Learning diary and answers
Week 4
27. Use Croc to move file or files between two or more hosts/devices. Answer shortly:
o How the Croc works?
Answer:
According to GitHub profile, the Croc uses PAKE (Password Authenticated Key
Exchange) to establish a secure connection. This means it is end-to-end encryption, that
files are encrypted before being sent and only the recipient can decrypt them using a
code phrase shared by the sender. Provide relay server, when devices can not establish a
direct connection, Croc uses a rely server to facilitate the files transfer. The sender is
given a randomly generated, human-readable code phrase which they must share with
the recipient. The recipient uses this code phrase to connect with the sender and start the
file transfer.
o How the Croc moves files if both hosts are not directly visible to each other?
(for example, both are behind NATs or basic firewalls)
Answer:
Croc uses 3 ways to move files while both hosts are not directly visible:
A. Relay Server: The Croc will create temporarily server if both port are not directly
visible for each other, it coordinates the transfer encrypted data between 2 parties.
B. End to End Encrypted Data: All data encrypted by Croc from end to end (no
matter use relay server or not). The server only access encrypted data and be
transferred.
C. No local server or port forwarding setup: No need to setup local server for file
transferring. It handles the complexities of transferring files behind
NATs/firewalls without any required configuration from the user.
28. Study how NTP protocol operates and analyse this Python NTP client code. Also
available here as plain text.
o This Python script uses direct socket programming to access the NTP server.
Comment individual socket programming related code lines. Also, answer
these:
▪ What is the NTP server (DNS) hostname?
Answer:
NTP clients can use public NTP servers like pool.ntp.org, or time.nist.gov or
0.pool.ntp.org. The exact hostname would be specified in the script, usually set when
defining the server address. (Here use pool.ntp.org)
▪ What is the destination port number being used?
Answer:
According to the python code, it use port 123. This is the standard port used for NTP
traffic across the Internet.
▪ Is this Python script using TCP or UDP? How do you know?
Answer:
The python code use both, first of all, to know what is TCP and UDP.
UDP is the underlying transport layer protocol used for sending and receiving data
packets.
31
Learning diary and answers
NTP is the application-level protocol that defines the specific format and purpose of
the data exchange, allowing the program to retrieve time information from a time
server.
Here are codes for UDP:
A. Socket Creation
The socket is for the Datagram socket, and use for UDP.
From the code, sendto() and recvfrom() used in the script are typically used with
UDP sockets. sendto() sends data to a specific address, and recvfrom() receives
data from any address, both of which are characteristics of UDP's connectionless
nature:
Due to NTP is the protocol design for synchronize the clocks of computers over a
network. And it relies on UDP for data transport.
So the NTP_PACK_FORMAT, NTP_DELTA and NTP_QUERY are constants relate
to NTP protocol.
This python code uses UDP for sending NTP (Network Time Protocol) queries and
receiving responses without continuous connection which suit for quick time
synchronization task.
29. Do these Python programming assignments with Windows or Linux (or with MacOS if
you want and know how)
o For example, use https://realpython.com/python-sockets/ or similar site(s) for
socket programming example codes and create TCP client and TCP server
Python scripts.
Answer
Two separate files for them
32
Learning diary and answers
Server code
Client code
o Establish a TCP connection between your client and server Python scripts
(either as localhost traffic or between two separate hosts if you have access to
two or more Python running hosts without firewall preventing the traffic)
Answer
Run the scripts on the same machine:
o
▪ TCP client connects to the server, sends some plain text string and then
disconnects
Answer
33
Learning diary and answers
When change message content, it will changed too (server and client side both).
▪ Save your source codes and work. You need scripts again during the
course week #5 (Wireshark protocol analyzer assignments)
o Use netstat or similar command line tools to check the TCP connection status
(for example the Python server script LISTENING the selected TCP port)
Answer:
Use netstat -an | find “65488”
34
Learning diary and answers
Week 5
30. Define following terms and concepts shortly:
Answer:
What is the difference between encoding and encryption?
Term Definition
Encoding Encoding is designed to protect the integrity and usability of
data. It converts data into a different format using a scheme that
is publicly available, such as ASCII, Unicode, URL encoding, or
Base64. The goal is often to ensure that the data can be properly
consumed by different types of systems.
HTML encoding to ensure special characters are handled
correctly in browsers.
Encoding is about representation and compatibility.
Encryption Encryption is used for securing data. It transforms data into a
format that can't be easily understood without a corresponding
decryption key or mechanism. It can protect sensitive
information from unauthorized access.
AES encryption used for securing sensitive user data in
databases, or SSL/TLS encryption used for securing data
transmitted over the internet.
Encryption is about security and confidentiality.
35
Learning diary and answers
o Encapsulation (protocol)
Answer:
It refers to the process of wrapping data from one layer of the OSI model within a packet
at a higher layer. This allows data to be transmitted across different network types and
protocols, ensuring that it reaches its intended destination.
A web browser sending an HTTP request to a web server. The HTTP request is
encapsulated within a TCP segment, which is then encapsulated within an IP packet. The
IP packet is further encapsulated within a frame at the Data Link layer before being
transmitted over the physical network.
36
Learning diary and answers
Example as below
{
"name": "John Doe",
"age": 30,
"city": "New York"
}
Above code, user can read these data type and detail
XML(Extensible Markup A markup language that defines a set of rules for encoding
Language) documents into a format that is both human-readable and
machine-readable.
Widely used for web services, RSS feeds, and configuration
files. It supports complex data structures and can be used to
describe hierarchical data.
Sample code:
<person>
<name>John Doe</name>
<age>30</age>
<city>New York</city>
</person>
name,age,city
John Doe,30,New York
Jane Smith,25,Los Angeles
31. Install Wireshark protocol analyser and inspect your IP traffic (DNS requests, web
browsing and such) with the Wireshark:
37
Learning diary and answers
o Analyse the plain text traffic between the TCP socket Python scripts you did during the
course week #4. Note: use localhost network interface when capturing host internal
traffic (localhost/127.0.0.1)
Answer
o Try to ping 8.8.8.8 from command prompt and capture the traffic. What protocols ping
was using? What is the total header length of your ping request (all used protocol
headers combined when ping sends echo request)?
Answer
The ping command is using ICMP (Internet Control Message Protocol), which is visible in the
"Protocol" column.
Total Header Length:
• IP Header: 20 bytes
38
Learning diary and answers
o Capture some web browsing traffic and related DNS requests. What are those A (and
maybe AAAA requests)? Which protocol is used for DNS requests? (Note: This cannot
be done with
the web browser if your browser uses DNS over HTTPS. Most do now. Either skip this
task or disable DoH temporary in the web browser settings)
Answer
39
Learning diary and answers
32. Download this zipper pcap traffic file and inspect it with Wireshark. The IP traffic
sample is about IoT device sending base64 encoded and JSON formatted data to a
server. Answer these questions:
40
Learning diary and answers
o Extract the payload as printable text (use right mouse button and copy as printable text
for the data part only). Use any base64 decoder to convert the data to a plain text JSON
message. What is the content of JSON formatted data?
Answer
To get the data is at Data (150 bytes) then copy the text it show below:
65776f6749434167496d6c7563485630546d46745a53493649434a505957317249456c51494735
6c64486476636d7470626d636759323931636e4e6c49474a316448527662694973436941670a49
434169596e56306447397555484a6c63334e31636d55694f6941694d544d7a4e794973436941674
9434169646d567963326c7662694936494349784c6a49754d79494b66516f3d0a
After use base64 website to decode
41
Learning diary and answers
33. Download this zipper pcap traffic file and inspect it with Wireshark. Traffic is simple
MySQL session example from Wireshark Wiki. Answer these questions:
o Use Wireshark's follow TCP stream feature (right mouse button) and inspect
what are the two database rows (animals) and related values which were
inserted to the foo table's animal and name columns?
Answer
42
Learning diary and answers
34. Download this zipped pcap traffic file and inspect it with Wireshark. Traffic has been
captured from host 192.168.80.32. Answer these questions:
o What is the MAC address of host 192.168.80.1? Which vendor has build the ethernet
chipset of host 192.168.80.1? (use Wireshark or IEEE OUI data)
Answer
43
Learning diary and answers
44
Learning diary and answers
45
Learning diary and answers
o Which IP address sent ICMP echo requests to this (192.168.80.32) host? Also,
there is a repeating short message inside ICMP datagrams the host sent as
ICMP echo request payload. What is the repeated message?
Answer
o What was the web page the host 192.168.80.32 visited first (full web page
address, not just the host)? What was the web browser or HTTP user agent
string used to access that web server?
Answer
Full Web Page Address: http://www.oamk.fi/~tkorpela/
User-Agent String: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 (as an example, please
verify the exact string in Wireshark).
46
Learning diary and answers
o What is the hostname in “Host:” field of the HTTP GET request sent by
192.168.80.32?
Answer
Hostname in "Host:" Field: www.oamk.fi
o What is most likely the default DNS server (the IP address) used by the host
192.168.80.32?
Answer
The most likely default DNS server for the host 192.168.80.32 is 8.8.8.8. The secondary
DNS server is 9.9.9.9.
47
Learning diary and answers
o Use Wireshark’s file/export objects/HTTP feature to extract the ZIP file which
was downloaded from the web server 193.167.100.88. What is inside the ZIP
file?
Answer:
Download Zip file name Autumn.zip, I found a jpg file after extracting the zip (see the
photo next to ) :
48
Learning diary and answers
o Host 192.168.80.32 sent DNS requests to host 9.9.9.9. What are the requests?
Answer
The three DNS requests sent by the host 192.168.80.32 to the DNS server 9.9.9.9 are:
Request 1: www.teemukorpela.fi
Request 2: nokia.com (Type MX - Mail Exchange request)
Request 3: www.youtube.com
35. Create a new JSON file with any text editor. JSON file should contain data for at least
two houses and related IoT sensor data. Each house must have few sensors with
following information and some random data for each sensor. Something like this:
House:
- IoT sensor:
- sensor ID number
- location description
- notes about sensor
- unix epoch timestamp
- sensor values:
- value nnn
- value nnn
- value nnn
49
Learning diary and answers
50
Learning diary and answers
• What is GraphQL? Also, check this traffic and parking API documentation from Oulu
(extra task uses this API)
Answer:
GraphQL is a query language for APIs and a runtime for executing those queries. It allows
clients to request exactly the data they need, making APIs more efficient and flexible compared
to REST.
The Oulu Traffic API provides real-time data via GraphQL on traffic flow, bus status, parking
available space, weather conditions, roadworks, and maintenance in the Oulu region.
The API supports queries related to traffic cameras, automatic measurement stations (LAM),
parking lots, and road weather stations. You can interact with the API through standard
GraphQL queries to retrieve data in JSON format, and it's updated frequently.
36. Install Cmder (or some other toolset where you have Curl or similar tool to make
HTTP requests from command line or application.) Use Curl to fetch XML formatted
weather data from FMI:
curl -s -L
"https://opendata.fmi.fi/wfs?request=getFeature&storedquery_id=fmi::observations::weathe
r::timevaluepair&place=oulu×tep=100¶meters=temperature"
Inspect and validate the received XML data with www.w3schools.com/xml/xml_validator.asp
Answer:
I use Postman to do this question, put the URL at Postman and get:
51
Learning diary and answers
37. Decode this base64 encoded message with any tool(s) you prefer:
SGVsbG8gdGhlcmUgT2FtayBzdHVkZW50ISBBcmUgeW91IGhhdmluZyBmdW4gbm93Pz8/
Answer:
I use this website to do https://www.base64decode.org/
And here is the answer
38. Encode this string:“I love data processing challenges!” with base64 encoding.
Answer:
I use python code to do this
Result is
'SSBsb3ZlIGRhdGEgcHJvY2Vzc2luZyBjaGFsbGVuZ2VzIQ=='
Week 6
39. Describe the difference between request-response and publish-subscribe
communication models
Answer
Item Differences
request-response 1. Interaction: It is direct point to point model.
model 2. Communication Type: Synchronous (client waits for server response)
3. Number of participants: One to one.
52
Learning diary and answers
53
Learning diary and answers
42. List shortly some reasons why MQTT may be better than HTTP for IP-based IoT
communication? (For example: HTTP vs. MQTT: A tale of two IoT
protocols and MQTT Vs. HTTP: Understanding the Differences)
54
Learning diary and answers
Answer
MQTT offers several advantages over HTTP for IP-based IoT communication:
1. Lightweight Protocol: MQTT is designed for low-bandwidth, high-latency, or unreliable
networks, making it ideal for IoT devices with limited resources.
2. Efficient Power Use: MQTT's minimal overhead reduces power consumption, which is
crucial for battery-powered IoT devices.
3. Publish-Subscribe Model: Unlike HTTP's request-response, MQTT uses a publish-
subscribe model, allowing efficient and real-time data distribution to multiple clients.
4. Persistent Connections: MQTT maintains persistent connections, reducing the overhead of
reconnecting repeatedly.
These features make MQTT more suitable for IoT environments compared to HTTP.
55
Learning diary and answers
47. Why classic computer network protocols like TCP/IP, data formats such as JSON and
XML, and security systems like (PKI/HTTPS) won’t usually work at all or are not very
optimal to be used in resource limited wireless sensor networks (low power and lossy
networks)?
Answer:
The classic computer network protocols, data formats, and security systems designed for
general-purpose networks may not be optimal for resource-limited wireless sensor networks
(WSNs) due to several factors:
Overhead: TCP/IP, JSON, and XML have significant data overhead, which increases
bandwidth consumption and power usage—critical in low-power networks.
Energy consumption: TCP’s connection setup and retransmission mechanisms consume more
energy compared to lightweight protocols like UDP or CoAP.
Processing power: Parsing complex formats like JSON/XML and encryption in PKI/HTTPS
requires more processing power, which resource-constrained devices often lack.
That is why more lightweigtht protocols like CoAP(Constrained Application Protocol),
MQTT(Message Queuing Telemetry Transport), CBOR, and data-compression are better suited
for WSNS.
48. What is the MTU challenge for IPv4 and IPv6 over common wireless low power and
lossy wireless connections (Hint: Research Zigbee/IEEE 802.15.4 and Bluetooth MTU
vs IPv4 or IPv6)?
Answer:
The Maximum Transmission Unit (MTU) is the largest size of a packet that can be transmitted
over a network without fragmentation. Low-power and lossy wireless networks (LLNs), such as
those used in IoT devices, the MTU challenge arises from the need to balance data transmission
efficiency with the limitations of these networks.
Differences between IPv4 and IPv6 MTU
IPv4 default MTU is 1500 bytes which is larger than 6. IPV4 allows for fragmentation which
can increase overhead and introduce additional delay.
IPv6 MTU is 575 bytes, the smaller MTU is more suitable for LLNs. IPv6 discourages
fragmentation by using smaller MTU and mechanisms like Path MTU Discovery (PMTUD) to
determine the maximum allowable MTU along a path.
56
Learning diary and answers
• High packet loss: LLNs are prone to packet loss due to factors like interference, fading, and
power constraints. Fragmentation can exacerbate this problem, as lost fragments can lead to
the loss of entire packets.
• Energy consumption: Fragmentation and retransmission of fragmented packets can
consume more energy, which is critical for battery-powered devices.
49. Compare and list few HTTP/1.1, HTTP/2 and HTTP/3 differences and features
Answer:
Features Differences
HTTP1.1 Introduced: 1997
Multiplexing: Yes
Header Compression: No,
Protocol: Text-base, TCP
HTTP2 Introduced: 2015
Multiplexing: Yes
Header Compression: Yes, using HPACK
Protocol: Binary
HTTP3 Introduced: 2021
Multiplexing: Yes
Header Compression: Yes
Protocol: QUIC instead of TCP
aster recovery from packet loss due to QUIC.
In summary, HTTP/2 and HTTP/3 offer significant improvements over HTTP/1.1, including
faster performance, better efficiency, and more features.
50. Use Chrome or other Chromium based browser and it's developer tools (F12), and
access the course web page tl.oamk.fi/iot/. From the developer tools network tab, select
the main page: iot/ and check the response headers.
Answer:
o What is the connection type?
Answer:
The connection type is keep-alive
57
Learning diary and answers
58
Learning diary and answers
Web Application Firewall (WAF): Can protect against common web attacks like SQL
injection and cross-site scripting.
API gateway: Can act as an API gateway, providing features like authentication, authorization,
and rate limiting for API endpoints.
53. What is Web application firewall (WAF). List some advantages and features
Answer:
A Web Application Firewall (WAF) is a security tool that monitors and filters HTTP/HTTPS
requests to and from a web application. It helps protect web applications from various threats,
including cross-site scripting (XSS), SQL injection, and other vulnerabilities.
Advantages of WAFs:
• Protection against web attacks: WAFs can detect and block common web attacks,
preventing unauthorized access and data breaches.
• Improved security posture: WAFs can help organizations comply with security
regulations and standards.
• Reduced risk of data breaches: By preventing attacks, WAFs can reduce the risk of
sensitive data being compromised.
• Enhanced website performance: Some WAFs can improve website performance by
caching content and optimizing traffic.
Features of WAFs:
• Signature-based detection: WAFs can use signatures to detect known attack patterns.
• Anomaly detection: WAFs can identify unusual behavior that may indicate an attack.
• Rate limiting: WAFs can limit the number of requests a single IP address can make within
a certain time period, preventing denial-of-service (DoS) attacks.
• Bot management: WAFs can detect and block malicious bots that attempt to automate
attacks.
• Web application scanning: WAFs can scan web applications for vulnerabilities and
provide remediation recommendations.
• Integration with other security tools: WAFs can integrate with other security tools like
intrusion detection systems (IDS) and security information and event management (SIEM)
systems.
Types of WAFs:
• Hardware WAF: A dedicated hardware appliance that sits between the web server and the
internet.
• Software WAF: A software application that can be installed on a web server or a separate
machine.
• Cloud WAF: A WAF service provided by a cloud provider.
59
Learning diary and answers
56. Use this tool to check few websites whether the server supports
HTTP/2: tools.keycdn.com/http2-test. Two examples: www.kaleva.fi and www.oulu.fi
Answer
It support https://www.kaleva.fi/ but not https://www.oulu.fi/fi
60
Learning diary and answers
57. Study Google Firebase documentation and advertisements. Think and list examples
how to use Firebase ecosystem with Android application(s) or with some IoT other
system?
Answer:
Firebase is a comprehensive platform that offers a wide range of tools and services for building
and growing mobile and web applications.
Android Application Real-time Database: Use Firebase Realtime Database to store and sync
data in real time across multiple clients. This is ideal for chat
applications, collaborative tools, and other applications that require real-
time updates.
Cloud Firestore and function: Store and retrieve structured data,
which is a flexible NoSQL database. This is suitable for applications
that need to store and query large amounts of data.
Function is Write serverless functions using JavaScript or Python to
handle business logic and integrate with other Firebase services. This
can be used for tasks like data processing, sending notifications, or
integrating with third-party APIs.
Authentication: Use Firebase Authentication to authenticate users with
various providers like Google, Facebook, Email/Password, or custom
authentication.
Cloud Storage: Store and serve user-generated content like images,
videos, and audio files using Cloud Storage.
Crashlytics: Monitor and debug your app's crashes and errors to
improve its stability.
Performance Monitoring: Track your app's performance metrics like
load times and error rates to identify and fix performance bottlenecks.
IoT System Remote Data Collection: Use Firebase Realtime Database or Cloud
Firestore to store and retrieve data from IoT devices.
Device Management: Use Cloud Functions to manage and control IoT
devices.
Real-time Monitoring: Use Firebase Realtime Database to monitor
sensor data from IoT devices in real time.
Notifications: Send notifications to users based on data from IoT
devices.
Integration with Cloud Services: Integrate IoT data with other cloud
services like Google Cloud Platform to perform advanced analytics or
machine learning.
The Google Firebase scalability, real-time capabilities and easy-to-integrate for android system
IoT.
58. Use hivemq.com open MQTT broker service with Python to publish MQTT messages. Use
this very basic Python MQTT publish example
o Install Paho MQTT library to your Python development environment. With pip it
should be something like this: pip3 install paho (Note: Using venv or other virtual
environment with Python is strongly recommended)
o Use web browser to connect HiveMQ websocket client interface. After connecting,
subscribe to oamkiotcourse/# channel (# is wildcard to receive all data)
Answer:
61
Learning diary and answers
Install paho at python code then trun and connected. Here just connected but no publish
any message from Python, so it wont show anything.
62
Learning diary and answers
o Modify the example Python code and publish some random data to the
oamkiotcourse (or some channel of your own). Example code and websocket client
should look something this
Answer:
After connected and subscribe oamkiotcourse/#, it will receive all messages published to
this topic. (see below)
o Analyse your Python MQTT client traffic with Wireshark (or with tcpdump if using
some Linux server). For example, this packet capture example file is from this kind
of MQTT publish message. From your Wireshark capture:
▪ What is the destination IP address?
Answer:
IP address 3.64.176.215
63
Learning diary and answers
The source ICP port is 63225 and destination TCP port is 1883.
▪ Can you find published data as plain text from your captured traffic sample?
Answer
Yes, In the Wireshark capture, the Info column for MQTT packets shows the
published messages. The payloads such as Paho learning: question58 and Successful:
Yes, correct are visible.
64
Learning diary and answers
Week 7
59. Explain below shortly
Answer:
Term Definition
65
Learning diary and answers
66
Learning diary and answers
60. Explain Microsoft’s STRIDE threat model shortly (see the old software vulnerability
slides)
Answer
Microsoft's STRIDE threat model categorizes different types of security threats. It's a
valuable tool for identifying potential vulnerabilities in software systems. It helps security
professionals identify potential threats during the system design and development phases.
STRIDE stands for six categories of security threats:
Threat Desired Threat Definition
property
S-Spoofing Authenticity Definition: Pretending to be something or someone other
than yourself.
Example: An attacker uses a stolen username and password
to access a system.
T-Tampering Integrity Definition: Modifying something on disk, network, memory,
or elsewhere.
Example: An attacker alters the contents of a file or
manipulates data in transit.
R-Repudiation Non- Definition: Claiming that you didn't do something or were
repudiability not responsible; can be honest or false.
Example: A user denies that they made a transaction or sent
a request because there are insufficient logs or evidence to
prove the action.
67
Learning diary and answers
61. Explain Microsoft’s DREAD risk model shortly (see the old software vulnerability
slides)
Answer:
Microsoft’s DREAD is part of a system for risk-assessing computer security threats that was
formerly used at Microsoft. It provides a mnemonic for risk rating security threats using five
categories. It evaluates and quantifies the risks associated with security vulnerabilities. It
provides a structured way to assess the impact of a threat on a system.
More damages or loss and the rating is more high.
Risk Risk Definition
Assessing
D-Damage Definition: How much damage can the threat cause if it is exploited? How
potential bad the attack be?
Example: What kind of sensitive data, financial loss or critical system issue
will happen?
R-Reproducibility Definition: How easy is it to reproduce or exploit the attack?
Example: An attacker alters the contents of a file or manipulates data in
transit.
E-Exploitability Definition: How much work is it to launch the attack? How esay to do?
Example: A user denies that they made a transaction or sent a request
because there are insufficient logs or evidence to prove the action.
A-Affected users Definition: how many people will be impacted?
Example: Hacker intercepts unencrypted data, such as credit card numbers
or personal information.
D-Discoverability Definition: How easy is it to discover the threat or attack?
Example: Hacker floods a web server with requests, causing it to crash or
become unavailable to legitimate users. It is very common attacker.
68
Learning diary and answers
62. Check some CVEs of widely used applications from https://www.cvedetails.com/ and
answer:
o Describe what is the CVE scoring system
Answer
CVE (Common Vulnerabilities and Exposures) is a glossary that classifies
vulnerabilities. The glossary analyzes vulnerabilities and then uses the Common
Vulnerability Scoring System (CVSS) to evaluate the threat level of a vulnerability. A
CVE score is often used for prioritizing the security of vulnerabilities. The scoring helps
organizations prioritize their responses to vulnerabilities based on their impact and
exploitability.
Break down the CVSS scoring system as below
Note: The CVSS standard is used by many
reputable organizations, including NVD,
IBM, and Oracle. If you want to see how
CVSS is calculated, or convert the scores
assigned by organizations that do not use
CVSS, you can use the NVD calculator.
o When was the last time when Exim (MTA, mail transfer agent, more modern
version of the application, not the Cambridge version) had a critical
vulnerability? What is the CVE number?
Answer:
The latest critical vulnerability found in Exim is CVE-2024-39929, which affects
versions up to 4.97.1. This vulnerability allows remote attackers to bypass a protection
mechanism by misinterpreting a multiline RFC 2231 header filename. This could
potentially allow executable attachments to be delivered to user mailboxes, bypassing
the $mime_filename extension-blocking protection mechanism.
If exploited, it could enable attackers to deliver harmful executable attachments that
users might unwittingly download and execute.
According to the Attack Surface Management firm Censys, 4,830,719 of the 6,540,044
public-facing SMTP mail servers run Exim. As of July 12, 2024, over 1.5 million Exim
servers are using versions vulnerable to CVE-2024-39929 (4.97.1 or earlier). The United
States, Russia, and Canada host the majority of these exposed servers.
69
Learning diary and answers
To prevent this, a lot of developer and companies fixed it, however to prevent in the
future, upgrade OpenSSH regularly, use stronger authentication methods.
It allows a remote attacker to execute arbitrary commands on the affected server through
a specially crafted Server Name Indication (SNI) string in the TLS handshake. This
vulnerability exists due to improper validation of SNI data during the TLS negotiation
process
The vulnerability can be exploited without authentication, meaning that an attacker does
not need to have any prior access to the server. The attacker just needs to send a
specially crafted SNI string to the vulnerable Exim server during the TLS handshake.
o Try to explain shortly (summarise) from the write-up, how the attacker can
elevate access to become root (administrator) user?
Answer:
As above description, it is a backdoor access exploit. The D-Link DNS-320 Share
Center has a backdoor access exploit. It allows attackers to gain unauthorized
administrative access to the device.
How Attacker Works:
70
Learning diary and answers
64. Read this short article about cracking SIM cards and answer these questions:
o What is “side-channel attack”?
Answer:
A side-channel attack is a type of security exploit that aims to gather information from
a system through indirect means rather than by directly breaking into it. Instead of
attacking the algorithm itself, a side-channel attack exploits the physical or observable
characteristics of a system, such as its power consumption, timing, electromagnetic
emissions, or even sound.
This article is about SIM card side channel attack, which is related to crack SIM cards
by exploiting the physical properties of the card during cryptographic operations. In the
case of SIM card attacks, attackers leveraged power analysis and timing analysis to
extract secret keys used in the SIM’s authentication process.
65. Browse this public penetration test report and news article and answer these
questions:
o Penetration test report has header security through obscurity (next to the item
171 and onwards). What does it mean?
Answer
Security through obscurity refers to relying on the secrecy of the implementation or the
internal details of a system as the primary method of providing security. This approach
is generally criticized because it suggests that the security of a system depends on
keeping its internal workings hidden. If the underlying details are discovered or guessed,
the security is compromised. Instead of relying solely on obscurity, robust security
designs should incorporate multiple layers of defenses and not depend on the secrecy of
the system's architecture or code.
71
Learning diary and answers
At the item 171, which is noted that lack of anti-debug mechanism the use of off-the-
shelf components made the Merlin@home device easier to reverse engineer and identify
vulnerabilities. This suggests that relying solely on obscurity (e.g., using off-the-shelf
components without additional security measures) is not a strong security practice.
o Penetration test report items 114 - 141 describe remote attack and
vulnerability. What kind of problem is it?
Answer:
The problem described is a remote attack that affects the Merlin@Home system. These
vulnerabilities allow attackers to execute various harmful actions remotely, such as
disabling therapy or draining device batteries. This can be life-threatening because it
compromises the functionality of cardiac devices, making it possible to stop therapeutic
care or deplete batteries rapidly, thus endangering the patient's health.
66. Read this news article about garage door security vulnerability and answer:
o What information security and privacy issues were found and listed in the
article?
Answer:
Universal Password: All devices use the same universal passwords which makes it easy
for attackers or unauthorized users to get access to devices.
Privacy breaches: Sensitive information like email addresses and device IDs was
exposed.
Unencrypted User Data: The system broadcasts unencrypted information such as email
addresses, device IDs, and commands.
Replay Attacks: Commands can be replayed to control devices remotely.
o Read the CVE-2023-1748 (it's about this vulnerability). How much (i.e. how
bad) is the base CVSS score? What is the CWE code for this kind of
vulnerability?
Answer:
The CSVV score is 9.3, which is very severity and very high score.
CWE code is related to CWE-798, and it refers to the use of hard-code credentials.
The listed versions of Nexx Smart Home devices use hard-coded credentials. An
attacker with unauthenticated access to the Nexx Home mobile application or the
affected firmware could view the credentials and access the MQ Telemetry Server
(MQTT) server and the ability to remotely control garage doors or smart plugs for any
customer.
67. Browse this “Secure development - towards approval” PDF document from National
Cyber Security Centre Finland and answer from TESTING AND VERIFICATION
chapter:
72
Learning diary and answers
73
Learning diary and answers
o What is fuzzing?
Answer:
Fuzz testing or fuzzing is an automated software testing
method that injects invalid, malformed, or unexpected
inputs into a system to reveal software defects and
vulnerabilities.
It can be done without accessing the source code, but it
can reveal problems.
68. Browse this “Instructions – Supply chain attack” PDF document from National Cyber
Security Centre Finland and research/answer:
o What is supply chain attack?
Answer:
Supply chain attack is a type of cyberattack that targets third-party vendors or suppliers
in order to compromise a larger organization. These attacks target weak points in the
supply chain, often involving software vendors, hardware manufacturers and third-party
services.
o What is 3-2-1 backup rule?
o
Answer
The 3-2-1 backup rule is a strategy for keeping data safe. It advises that keep three
copies of data on two different media with one copy off-site.
• Three copies of your data: Your three copies include your original or production
data plus two more copies.
• On two different media: You should store your data on two different forms of media.
This means something different today than it did in the late 2000s. I’ll talk a little
more about this in a bit.
• One copy off-site: You should keep one copy of your data off-site in a remote
location, ideally more than a few miles away from your other two copies.
74
Learning diary and answers
69. Check some recent vulnerabilities being exploited in the wild from cisa.gov. Select one,
summarise the problem, and search and study some news articles about the
vulnerability.
Answer
I pick up CVE-2021-42013. It affects the Apache HTTP server and a remote code execution
vulnerability cause by a path traversal flaw.
An attacker could use a path traversal attack to map URLs to files outside the directories
configured by Alias-like directives. If files outside of these directories are not protected by the
usual default configuration "require all denied", these requests can succeed. If CGI scripts are
also enabled for these aliased paths, this could allow for remote code execution. This issue only
affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.
This attack is valuable because it allows remote attackers to bypass security mechanisms and
gain unauthorized access to sensitive files. If left unpatched, this could lead to full system
compromise.
It impacted some server users if they used Apache HTTP Server versions 2.4.49 or 2.4.50.
Weakness Enumeration
The weakness enumeration for this vulnerability is categorized as CWE-22, which involves
improper limitation of a pathname to a restricted directory, also known as path traversal.
To mitigate the risk, users of affected Apache HTTP Server versions should immediately update
to version 2.4.51 or later, which provides the complete fix. Additionally, ensuring that the
default security configuration ("require all denied") is enforced can prevent exploitation of files
outside the allowed directories.
Solutions
1. Update Apache HTTP Server to version 2.4.51, which has fixed the vulnerability.
2. Ensure that files outside designated directories are protected by the default configuration
"require all denied.".
3. Regularly monitor security advisories and updates from Apache and other relevant sources
to stay informed about potential threats.
75