# Securing the Future of Web-Enabled IoT: A Critical Analysis of Web of Things Security
## 5 Security Analysis of WoT
### Attack Modeling  
In this section, we explore the process of modeling attacks within the context of our WoT architecture. Attack modeling is a crucial step in understanding how potential security threats can exploit vulnerabilities within the system. By visualizing attacks through UML diagrams, we can gain insights into how these attacks unfold, identify weak points in the architecture, and develop effective countermeasures. This modeling is an essential tool for developing more secure and resilient WoT architectures, which we consider as our future objective.  
We use the UML sequence diagram which allow us to represent the step-by-step interactions between different components in the WoT system during an attack. These diagrams provide a clear depiction of the flow of communication between things, nodes, and the other components, illustrating how an attacker might intercept, alter, or manipulate this flow to achieve malicious objectives.  
Further, we show the attack steps of A3, which is a Man-in-the-Middle (MitM) attack. We show how an attacker can exploit the communication between components in the WoT system. In this case, we use the UC1 (adjust irrigation), where the attacker interception occurs between the thing device (sensor) and the node to adjust the command. The following is a description of the scenario.  
Use Case-2 (UC2): MitM attack in adjust irrigation scenario  
Summary: this use case illustrates a security breach in a smart irrigation system where an IoT moisture sensor autonomously monitors soil moisture levels. The system is designed to activate the irrigation process through a smart ecosystem when necessary. However, during this sequence, a Man-in-the-Middle (MitM) attack is executed, where an attacker intercepts and manipulates the communication between the IoT sensor and the node, leading to the failure of the irrigation system activation. Figure 5 shows the sequence diagram for the described attack scenario.  
Actor: an attacker.  
Precondition: the sensor is actively monitoring the soil moisture level and detects that it is below the predetermined threshold, which should trigger the irrigation system.  
1. The sensor measures the soil moisture level and detects that the moisture is below the predetermined threshold, which should trigger the irrigation system.
2. The sensor sends the moisture data to the node for processing.
3. The attacker, positioned between the IoT sensor and the node, intercepts the data being sent by the sensor, and modifies the intercepted data, making it appear as though the soil moisture level is sufficient, thereby preventing the node from activating the irrigation system.
4. The attacker forwards the manipulated data to the node.
5. The node, now receiving the altered data, believes that the soil moisture level is adequate and does not send a command to the irrigation controller.  
Postcondition: the node sends a report to the user indicating that the soil moisture level is sufficient and that no irrigation action was necessary, while in reality, the soil remains dry due to the attack.