Dataset Viewer
filename
stringlengths 34
130
| summary
stringlengths 481
5.43k
| body
stringlengths 14.5k
109k
|
---|---|---|
A_New_Injection_Threat_on_S7-1500_PLCs_-_Disrupting_the_Physical_Process_Offline.txt | Programmable Logic Controllers (PLCs) are increasingly connected and integrated into the Industrial Internet of Things (IIoT) for a better network connectivity and a more streamlined control process. But in fact, this brings also its security challenges and exposes them to various cyber-attacks targeting the physical process controlled by such devices. In this work, we investigate whether the newest S7 PLCs are vulnerable by design and can be exploited. In contrast to the typical control logic injection attacks existing in the research community, which require from adversaries to be online along the ongoing attack, this article introduces a new exploit strategy that aims at disrupting the physical process controlled by the infected PLC when adversaries are not connected neither to the target nor to its network at the point zero for the attack. Our exploit approach is comprised of two steps: 1) Patching the PLC with a malicious Time-of-Day interrupt block once an attacker gains access to an exposed PLC, 2) Triggering the interrupt at a later time on the attacker will, when he is disconnected to the system s network. For a real attack scenario, we implemented our attack approach on a Fischertechnik training system based on S7-1500 PLC using the latest version of S7CommPlus protocol. Our experimental results showed that we could keep the patched interrupt block in idle mode and hidden in the PLC memory for a long time without being revealed before being activated at the speci c date and time that the attacker de ned. Finally, we suggested some potential security recommendations to protect industrial environments from such a threat. | Received 6 December 2021; revised 22 January 2022; accepted 6 February 2022. Date of publication 14 February 2022; date of current version 2 March 2022. The review of this paper was arranged by Associate Editor Yang Shi. Digital Object Identi er 10.1109/OJIES.2022.3151528 A New Injection Threat on S7-1500 PLCs - Disrupting the Physical Process Of ine WAEL ALSABBAGH1,2(Member, IEEE), AND PETER LANGEND ERFER1,2 1IHP Leibniz-Institut f r innovative Mikroelektronik, 15236 Frankfurt (Oder), Germany 2Brandenburg University of Technology Cottbus-Senftenberg, 03046 Cottbus, Germany CORRESPONDING AUTHOR: WAEL ALSABBAGH (e-mail: Alsabbagh@ihp-microelectronics.com) This work was supported by the Open Access Fund of Leibniz Association. INDEX TERMS Programmable logic controllers, industrial control systems, injection attack, time-of-day block, of ine attack. I. INTRODUCTION Industrial Control Systems (ICSs) are used to automate critical control processes such as production lines, electrical power grids, oil and gas facilities, petrochemical plants, and others. Each ICS environment consists of two main sites: a control site and a eld site. Fig. 1 shows a typical ICS environment. The control center runs ICS services such as Human Machine Interfaces (HMIs) and engineering worksta- tions. The eld site has sensors, actuators, and Programmable Logic Controllers (PLCs) that are installed locally to monitor and control physical processes. The engineering workstation is used to con gure and program PLCs. It has a PLC vendor- speci c programming software to write control logic that de- nes how the PLC should control and maintain the physical process at a desired state. PLCs are offered by several vendorssuch as Siemens, Allen-Bradley, Mitsubishi, Schneider and Modicon. Each has its own proprietary rmware, program- ming language, communication protocols and maintenance software. In the past, when PLCs were rst introduced, it was un- common for them to be connected to the outer world and they were often running independently i.e., the PLC-based ICS environments were air-gapped. This separation is no longer possible due to new demands such as maximizing the pro ts, minimizing the costs, and achieving a better ef ciency [1]. Therefore, it is not surprising that most of modern ICS en- vironments are increasingly connected to corporate networks and no longer controlled/monitored on-site. Unfortunately, this higher connectivity has also enlarged the attack surface, and brought its security challenges allowing attacks that were This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ 146 VOLUME 3, 2022 FIG. 1. An example of an industrial control system environment. not existing in the times of the air-gapped industrial plants. Stuxnet [12], which targeted the Iranian uranium enrichment in 2010, played an important role in increasing awareness of security for industrial control systems. This attack showed that no plant is resilient to cyber-attacks and that PLCs could be potentially hacked causing disastrous damages. But since then, several other ICS have been successfully attacked, for example the Ukrainian power grid [17], the German steel Mill [22], TRITON [16], etc. In this work, we show that modern PLC-based ICS envi- ronments are not fully protected against control logic injec- tion attacks, and that these systems are still quite far from being completely secure. To this end, we present a new at- tack strategy that allows malicious adversaries to disrupt the physical process controlled by PLCs of ine i.e., without being connected to the target or to its network at the point zero for the attack. The main focus of our investigations is on Siemens devices, precisely the latest PLC models i.e., devices from S7- 1500 family, and the latest version of S7CommPlus protocol i.e., S7CommPlusV3. Our attack approach is structured into two main phases: 1) Patching the control logic program of a PLC with an interrupt, precisely with Time-of-Day (ToD) interrupt block using the speci c Organization Block 10 (OB10). This is done online i.e., when the adversary has access to the target device. During this phase, the patch has no impact, neither on the physical process nor on the execution process of the control logic program i.e., the patch is in the idle mode. 2) Activating the patch injected in the target later at a certain date and time. This is done of ine i.e., withoutthe need of being connected to the target PLC at the point zero for the attack. To conduct experiments for proving the research, a Fis- chertechnik training industry plant1controlled by an S7-1500 PLC was used to test our attack approach. Our new threat is network based, and can be successfully conducted by any attacker with network access to any S7-1500 PLC with a rmware V2.9.2 or lower. A. MOTIVATION The objective of this article is to introduce a new control logic injection on cryptographically secured PLCs that use sophisticated protection methods. The intention of discussing this new type of attack is to raise awareness for sophisticated attacks and to assist in determining new vulnerabilities and weaknesses existing in PLCs as they are running in millions of critical industrial plants, and play a major point of in- teracting between the cyber and physical world. Our main focus is to understand the attack vectors in the rst place, and show the security research community, engineers, and industrial vendors what the consequence of the vulnerabilities would be if they are exploited. To conduct a real-world attack scenario, we chose a device from Siemens S7-1500 family. Our selection is based on two factors. First, Siemens is the leading provider of industrial automation components and their SIMATIC families have approximately 30-40% of the industry market [23] [25]. Secondly, Siemens claimed that its newest PLCs generation is well-secure against various attacks, 1https://www. schertechnikwebshop.com/de-DE/ schertechnik- lernfabrik-4-0-24v-komplettset-mit-sps-s7-1500-560840-de-de VOLUME 3, 2022 147 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE and their new developed S7CommPlus protocol supports im- proved security measures like an advanced anti-replay mech- anism and a sophisticated integrity check. These two factors motivated us to show how the most secure PLCs in Siemens SIMATIC lines can be exploited by external adversaries, and how attackers can confuse the physical process even without being connected to the victim devices. This could lead to dis- astrous damages to the plants employing such compromised devices. The major bene t of our attack strategy is that, the time running the attack and the point in time, when it shall hit the victim can be fully decoupled. For example, if motivated adversaries want to collapse a certain system at a speci c date/time e.g., the day before elections, or the day before going to the stock market to harm a country or a company respectively, they have suf cient time to inject their malicious code very well in advance, and do not need to be successful with the attack just at the right time. B. PROBLEM STATEMENT Most of the injection attacks have two critical challenges: First is that the typical injection attacks are designed to gain access to the target or its network in very speci c circumstances i.e., when the security measure implemented is absent or disabled for a certain reason [2], [3], [5] [7], [9] [11], [13], [18], [29], [30], [34] for example, the security mean is being updated, the ICS operator is running some maintenance processes, other devices are being removed/replaced/added to the network, etc. The system is at high risk to get a malicious infection during these critical phases, but it is not operating in its normal state i.e., the physical process is more likely to be temporally off. Hence, if attackers manage successfully to gain access to the target device during these times, and perform their attacks right after that, they will, pretty likely, not impact the physical process. The second challenge is that after the ICS operator is done with the ongoing maintenance processes, he usually reactivates the security measure before re-operating the sys- tem once again. This allows him to reveal and prevent any attempt to inject the PLC if the attacker is still connected to the network. Our attack approach overcomes both challenges by patching the PLC with a malicious block at that point in time at which the attacker accesses the network success- fully, keeping the infection hidden in the PLC s memory, and lunching the attack at a later time on his will. This ensures that the attack is not being performed when the system is not operating normally or being detected by an introduced or reactivated security measure. It is also important to highlight that ICS operators are still able to reveal any infection or modi cation in the control logic program, by uploading and comparing both programs the one running on the PLC and the one running in the engineering software [10]. In this article, we also overcome this challenge by exploiting a vulnerability existing in the newest S7CommPlus protocol (explained in Section V) to hide the infection from the ICS operator i.e., who will always be shown the original code that runs on his engineering software whilst the PLC runs the attacker s code.C. ATTACKER MODEL Assumption: Our attacker model assumes that an attacker has access to the level-3 network of the Purdue Model2(i.e., control center network). This assumption is based on real- world ICS attacks e.g., TRITON [16] and Ukraine power grid attack [17] that gained access to the control center via a typical IT attack vector such as infected USB stick and social engineering attack. We also assume that the attacker has access to the PLC and its respective engineering software along with a packet-snif ng tool such as Wireshark.3After the level-3 network access, an attacker can make use of software and libraries to communicate with the target PLC over the network. As our assumptions have already been reported to hold true in reports on real world attacks, we are convinced that our attack is a realistic one. Attacker s goal: The attacker s goal is as follows: disrupting the physical process at a time when he is completely of ine, i.e., without being connected to the target or its network at the point zero for the attack, while the physical process of the target network is controlled by the infected PLC. In order to ensure achieving the overall goal, the injection may not be revealed by the ICS operator in the time between infecting the PLC and the attack launch date. In this work, we assume that an attacker achieves these goals if the following three tasks are accomplished: 1) patching the malicious code when the attacker is con- nected to the target s network. 2) keeping this infection hidden in the PLC s memory without being revealed. 3) disrupting the physical process at a later time when the attacker is completely of ine of the target s network. Attacker s capabilities: The attacker can employ one or more of these capabilities to achieve the goals mentioned earlier: 1) Eavesdropping: read any messages between two com- municating parties. 2) Fabrication: initiate conversation with any other party and compose/send a new message. 3) Interception: intercept messages, and block or mod- ify/resend them. D. CONTRIBUTIONS In this article, we take the attack approach presented in our former paper [10] one step further in the direction of ex- ploiting PLCs of ine, and extend our experiences to involve the modern S7-1500 PLCs that use S7CommPlusV3 protocol. Our main contributions in this article are summarized as fol- lows: 1) Extending our control logic injection attack approach presented in [10] from S7-300 to S7-1500 PLCs. 2) Hiding the malicious interrupt code in the PLC s mem- ory until the very moment determined by the attacker. 2https://www.goingstealthy.com/the-ics-prude-model/ 3https://www.wireshark.org/ 148 VOLUME 3, 2022 3) Disrupting the physical process controlled by the com- promised PLC of ine i.e., when the attacker is not con- nected to the target or its network. 4) Demonstrating our attack using a real Siemens S7- 1512SP controlling a Fischertechnik training factory. 5) Revealing two new vulnerabilities in the integrity protection method that S7-1500 PLCs and their S7CommPlus protocol use. The rest of this work is organized as follows. Section II provides an overview of control logic injection attacks and related work. Section III presents the technical background, followed by the description of the protection mechanism of the latest S7CommPlus protocol in Section IV. Our attack approach is presented and explained in details in Section V. In Section VI, we evaluate and discuss the impact of our attack, as well as suggest some possible mitigation methods. Finally, we conclude our work in Section VII. II. OVERVIEW AND RELATED WORK One of the recent threats targeting ICSs is the control logic in- jection attack. Such an attack involves modifying the original control logic running on a target PLC by engaging its engi- neering software, typically employing the man-in-the-middle approach [3] [5], [9], [10], [13], [30] [32]. The main vulnera- bility exploited in this type of attacks is the lack of authentica- tion measures in the PLC protocols. ICS vendors responded to this threat by providing their PLCs with passwords to protect the control logic from unauthorized access i.e., whenever an ICS supervisor attempts to access the control logic running in a PLC, the device rst requires an authentication to allow him to read/write the code. This is normally done via propri- etary authentication protocol. But, this solution is not fully preventing the controllers from being compromised. Previous academic efforts [2] [5], [9], [35] managed successfully to bypass the authentication and to access the control logic in different password-protected PLCs. The authors of the above- mentioned papers discussed two prime ways to bypass the authentication: either by extracting the hash of the password and then pushing it back to the PLC (known as a replay attack), or using a representative list of plain-text password, encoded-text password pairs to brute-force each byte of ine. Overall, protecting the control logic by password authenti- cation only failed. Attackers are still capable of accessing the PLCs program and manipulating the physical processes controlled by the exposed devices. In the research community there are two types of control logic injection attacks: traditional control logic injection and rmware injection. However, infecting a PLC rmware would be a challenging task in a real ICS environment as most PLC vendors protect their PLCs from unauthorized rmware updates by cryptographic methods e.g., digital signature, or allowing rmware updates only by local access (e.g., SD cards and USB). This work does not cover a rmware injection and only focuses on the traditional control logic injection attack. In the following, we classify the existing injection attacks aiming at disrupting the physical process into two groups. FIG. 2. Disrupting the physical process online. A. DISRUPTING THE PHYSICAL PROCESS ONLINE The attacks in this group are designed to modify the original control logic program by engaging its engineering software. The physical process controlled by the infected device is im- pacted right after the malicious code is successfully injected. Fig. 2 shows the attack sequence. The most well-known attack representing this kind is the one that was conducted on Iranian nuclear facilities in 2010, named as Stuxnet to sabotage centrifuges at a uranium enrich- ment plant. The Stuxnet attack [12], [20], [21] used a windows PC to target Siemens S7-300 and S7-400 PLCs that were con- nected to variable frequency drives. It infects the control logic of the PLCs to monitor the frequency of the attached motors, and launches an attack if the frequency is within a certain range (i.e., 807 Hz and 1,210 Hz). More recent examples of such attacks on ICS occurred in Ukraine [17], [19]. These attacks targeted the electrical distribution grid causing wide- spread blackouts. In 2014, the German federal of ce for infor- mation security also announced a cyber-attack at an unnamed steel mill [22]. The hackers manipulated and disrupted control systems to such a degree that a blast furnace could not be properly shot down, resulting in a massive damage. McLaugh- lin [45] conducted a control logic injection attack on a train interlocking program. The malicious program he introduced was reverse engineered using a format program. With the help of the decompiled program, he extracted the eld-bus ID that indicated the PLC vendor and model, and then retrieved clues about the process structure and operations. Afterwards he designed his own program that generates unsafe behaviors for the train e.g., causing con ict states for the train signals. As a real attack scenario, he targeted timing-sensitive signals and switches. In a follow up work, McLaughlin et al. [46] implemented SABOT. It required a high-level description of the physical process, for example, the plant contains two in- gredient valves and one drain valve . Such information could be got from public channels, and are similar for processes in the same industrial sector. With this information, SABOT generates a behavioral speci cation for the physical processes and used incremental model checking to search for a mapping between a variable within the program, and a speci ed physi- cal process. Using this map, SABOT compiled a dynamic pay- load customized for the physical process. Both studies were limited to Siemens PLCs, without illustrating many details on reverse engineering. Valentine [48] introduced attacks that could install a jump to a subroutine command, and modify the interaction between two or more ladders in a program. This could be disguised as an erroneous use of scope and linkage by a novice programmer. In 2015, Klick et al. [6] VOLUME 3, 2022 149 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE presented the injection of malware into the control logic of a SIMATIC PLC, without disrupting the service. The authors showed that a knowledgeable adversary with access to a PLC can download and upload code to it, as long as the code consists of MC7 bytecode. In a follow on work, Spenneberg et al. [7] introduced a PLC worm. The worm spreads inter- nally from one PLC to other target PLCs. During the infection phase, the worm scans the network for new target PLCs. A Ladder Logic Bomb malware written in ladder logic or one of the compatible languages was introduced in [8]. Such a malware is inserted by an attacker into existing control logic on PLCs. A group of researchers [9] demonstrated a remote attack on the control logic of PLCs. They were able to infect the PLC and to hide the infection from the engineering soft- ware at the control center. They implemented their attack on Schneider Electric Modicon M221, and its vendor-supplied engineering software SoMachine-Basic. Senthivel et al. [18] presented three control logic injection attacks where an at- tacker interferes with engineering operations of downloading and uploading PLC control logic. In the rst attack scenario, an attacker, placed in a man-in-the-middle position between a target PLC and its engineering software, injects malicious control logic to the PLC and replaces it with original control logic to deceive the engineering software when the uploading operation is requested. The second scenario that their paper presented is very similar to the rst scenario but differs in that an attacker uploads malformed control logic instead of the original control logic to crash the engineering software. The last scenario does not require a man-in-the-middle position, as the attack just injects crafted malformed control logic to the target PLC. Lei et al. [31] demonstrated a spear that can break the security wall of the S7CommPlus protocol that Siemens SIMATIC S7-1200 PLCs utilize. The authors rst used the Wireshark software to analyze the communications between the TIA Portal software and S7 PLCs. Then, they applied the reverse debugging software WinDbg4to break the encryption mechanism of the S7CommPlus protocol. Afterwards, they demonstrated two attacks. First a replay attack was performed to start and stop the PLC remotely. In the second attack sce- nario, the authors manipulated the input and output values of the victim causing a serious damage for the physical process controlled by the infected PLC. In 2021, researchers in [3] also showed that S7-300 PLCs are vulnerable to such attacks and demonstrated that exploiting the control logic running in a PLC is feasible. After they compromised the security mea- sures of PLCs, they conducted a successful injection attack and kept their attack hidden from the engineering software by engaging a fake PLC impersonating the real infected de- vice. Researches behind Rogue7 [30] were able to create a rogue engineering station which can masquerade as the TIA Portal to S7 PLCs, and to inject any messages favorable to the attacker. By understanding how cryptographic messages were exchanged, they managed to hide the code in the user memory, which is invisible to the TIA Portal engineering 4http://www.windbg.org/ FIG. 3. Disrupting the physical process of ine. station. In [44], a group of security researchers analyzed the anti-replay mechanism that the new S7 PLCs used, and man- aged successfully to steal an existing communication session and to make unauthorized changes to the PLC states. As a part of their experiments, they identi ed speci c bytes necessary to craft valid network packets, and demonstrated a successful replay attack on S7 PLCs. All the attacks mentioned above are limited and require that attackers are connected to the target at the point zero for the attack, which increases the possibility of being revealed by the ICS operators beforehand, or detected by security measures. B. DISRUPTING THE PHYSICAL PROCESS OFFLINE The attacks in this class are quite similar to the ones men- tioned in the prior class, but differs in that an adversary does not aim at attacking the physical process right after gaining access to the target device. Meaning that, he patches his ma- licious code once he accesses an exposed PLC, then closes any live connection with the target keeping his patch inside the PLC s memory in idle mode. Afterwards, he activates his patch and compromises the physical process at a later time he wishes even without being connected to the system network (see Fig. 3). To the best of our knowledge, only a few academic ef- forts discussing this new threat were published. Serhane et al. [47] focused on Ladder logic code vulnerabilities and bad code practices that may become the root cause of bugs and subsequently be exploited by attackers. They showed that attackers could generate uncertainly uctuating output vari- ables e.g., performing two timers to control the same output values could lead to a race condition. Such a scenario could result in a serious damage to the devices controlled, similar to Stuxnet [12]. Another scenario that the authors pointed out is that skilled adversaries could also bypass some functions, manually set certain operands to desired values, and apply empty branches or jumps. In order to achieve a stealthy modi- cation, attackers could use array instructions or user-de ned instructions, to log insert critical parameters and values. They also discussed that attackers could apply an in nite loop via jumps, and use nest timers and jumps to only trigger the attack at a certain time. We, in our former paper [10], presented a novel approach based on injecting the target PLC with a 150 VOLUME 3, 2022 FIG. 4. A typical S7 PLC Architecture. Time-Of-Day interrupt code, which interrupts the execution sequence of the control logic at the time the attacker sets. Our evaluation results proved that an attacker could confuse the physical process even being disconnected from the target system. Although our research work was only tested on an old S7-300 PLC, and was just aiming at forcing the PLC to turn into stop mode, the attack was successful and managed to interrupt executing the original control logic code running in the patched PLC. Such attacks are severer than the online ones as the PLC keeps executing the original control logic correctly without being disrupted for hours, days, weeks, months and even years until the very moment determined by the attacker. The only realistic way to reveal this kind of attack is that the ICS operator requests the program from the PLC and compares the online code running in the infected device with the of ine code that he has on the engineering station. But in this work, we overcome this challenge as illustrated later in Section V. III. TECHNICAL BACKGROUND In this section, we outline the architecture of a standard S7 PLC and its operating system, engineering software, user pro- gram, Time-of-Day interrupt, and S7Communication proto- cols. A. SIMATIC S7 PLC ARCHITECTURE Siemens produces several PLC product lines in the SIMATIC S7 family e.g., S7-300, S7-400, S7-1200, and S7-1500. All have the same architecture. Fig. 4 depicts a standard archi- tecture of an S7 PLC that includes input and output modules, power supply, and memory such as Random Access Mem- ory (RAM) and Electrically Erasable Programmable Read- only Memory (EEPROM). The rmware, known as Operating System (OS), as well as the user-speci c program is stored in the EEPROM. Input and Output devices such as sensors, switches, relays, and valves are connected with the input and output modules. The PLC is connected to a physical process; the input devices provide the current state of the process to FIG. 5. Overview of program execution, extracted from [43]. the PLC, which the PLC processes through its control logic, and controls the physical process accordingly via the output devices. The control logic that an S7 PLC runs is programmed and compiled into a lower representation of the code i.e., to MC7 or MC7+ bytecode for S7-300/S7-400 or S7-1200/S7- 1500 PLCs respectively. After the code being compiled by the engi- neering station, its blocks, in MC7/MC7+ format, are down- loaded and installed into the PLC via Siemens S7Comm or s7CommPlus protocol for S7-300/S7-400 or S7-1200/S71500 PLCs respectively. Then, the MC7/MC7+ virtual machine in the S7 PLC will dispatch the code blocks, interpret and exe- cute the bytecode. B. OPERATING SYSTEM (OS) Siemens PLCs run a real time OS, which initiates the cycle time monitoring. Afterwards, the OS cycles through four steps as shown in Fig. 5. In the rst step, the CPU copies the values of the process image of outputs to the output modules. In the second step, the CPU reads the status of the input modules and updates the process image of input values. In the third step, the user program is executed in time slices with a duration of 1 ms (ms). Each time slice is divided into three parts, which are executed sequentially: The operating system, the user program and the communication. The number of time slices depends on the complexity of the current user program and the events interrupting the execution of the program. In normal operation, if an event occurs, the block currently being executed is interrupted at a command boundary and a different organization block that is assigned to the particular event is called. Once the new organization block has been executed, the cyclic program resumes at the point at which it was interrupted. This holds true as the maximum allowed cycle time (150 ms by default) is not exceeded. In other words, if there are too many interrupt OBs called in the main OB1, the entire cycle time might be extended more than it is set in the PLC hardware con guration. Exceeding the maximum allowed execution cycle generates a software error, and the PLC calls a speci c block to handle this error i.e., OB80. VOLUME 3, 2022 151 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE FIG. 6. S7 PLC s user program blocks. There are two ways to handle with this error: 1) PLC turns to a stop mode if the OB80 is not loaded in the main program, 2) PLC executes the instructions that OB80 is programmed with e.g., an alarm. C. ENGINEERING SOFTWARE Siemens provides their Total Integrated Automation (TIA) Portal software to engineers for developing PLC programs. It consists of two main components. The STEP 7 as develop- ment environment for PLCs and WinCC to con gure Human Machine Interfaces (HMIs). Engineers are able to program PLCs in one of the following programming languages: Ladder Diagram (LAD), Function Block Diagrams (FBD), Structured Control Language (SCL), and Statement List (STL). D. USER PROGRAM S7 PLC programs are divided into the following units: Or- ganization Blocks (OBs), Functions (FCs), Function Blocks (FBs), Data Blocks (DBs), System Functions (SFCs), System Function Blocks (SFBs) and System Data Blocks (SDBs) as shown in Fig. 6. OBs, FCs and FBs contain the actual code, while DBs pro- vide storage for data structures, and SDBs for the current PLC con gurations. The pre x M, memory, is used for addressing the internal data storage. A simple PLC program consists of at least one organization block called OB1, which is comparable to the main () function in a traditional C program. In more complex programs, engineers can encapsulate code by using functions and function blocks. The only difference is an ad- ditional DB as a parameter for calling an FB. The SFCs and SFBs are built into the PLC. However, the operating system calls OB cyclically and with this call it starts cyclic execution of the user program. E. TIME-OF-DAY (TOD) INTERRUPTS ATime-of-Day (TOD) interrupt is executed at a con gured time, either one-time or periodically depending on the needs of interrupt e.g., every minute, hourly, daily, monthly, yearly, and at the end of the month. A CPU 1500 provides 20 organi- zation blocks with the numbers OB10 to 0B17 and after OB 123 for processing a TOD interrupt. To start a TOD interrupt, a user must rst set the start time and then activate the interrupt. He can carry out both activitiesseparately in the block properties, automatic con guration, or also with system functions, manual con guration. Activating the block properties means that the Time-of-Day interrupt is automatically started. However, in the following we illustrate both ways brie y: 1)Automatic con guration: The user adds an organization block with the event class Time-of-Day and enters the name, programming language, and number. He programs the OB10 with the required instructions to be executed when the inter- rupt occurs. 2)Manual con guration: In this method, the user uses sys- tem function blocks to set, cancel, and activate a Time-of-Day interrupt. He sets the necessary parameters for the interrupt in the main OB1, by using system function blocks while the interrupt instructions to be executed are programmed in OB10. [49] provides technical details to set and program Time-of-Day interrupts in S7-1500 PLCs. F. S7COMMUNICATION PROTOCOLS The S7 protocol de nes an appropriate format for exchanging S7 messages between devices. Its main communication mode follows a client-server pattern: the HMI or TIA Portal device (client) initiates transactions and the PLC (server) responds by supplying the requested data to the client, or by taking the action requested in the instruction. Siemens provides its PLCs with two different protocol avors: the older SIMATIC S7 PLCs implement an S7 avor that is identi ed by the protocol number 0x32 (S7comm), while the new generation PLCs im- plement an S7 avor that is identi ed by the protocol number 0x72 (S7CommPlus). The newer S7CommPlus protocol has three sub-versions: S7CommPlusV1, S7CommPlusV2, and S7CommPlusV3. In this article, we only focus on the S7CommPlusV3 Pro- tocol that is used in the newer versions of the TIA Portal from V13 on, and in the newer PLC S7-1500 rmware e.g., V1.8, 2.0, etc. This protocol requires that both the TIA Por- tal and the PLC support its features, and has more complex integrity protection mechanisms as illustrated in the next sec- tion. S7CommPlusV3 protocol is considered as the most se- cure protocol compared to the older S7CommPlus versions, i.e., S7CommPlusV1 and S7CommPlusV2. IV. S7COMMPLUSV3 PROTOCOL The S7CommPlusV3 protocol is used only by the newer ver- sion of the TIA Portal, and the S7-1500 PLCs. It supports var- ious operations that are performed by the TIA Portal software as follows: 1) Start/Stop the control program currently loaded in the PLC memory. 2) Download a control program to the PLC. 3) Upload the current control program from the PLC to the TIA Portal. 4) Read the value of a control variable. 5) Modify the value of a control variable. The above-mentioned operations are translated by the TIA Portal software to S7CommPlus messages before they are 152 VOLUME 3, 2022 FIG. 7. The S7 Session Key Establishment Mechanism. transmitted to the PLC. The PLC acts then on the messages it receives, executes the control operations, and responds back to the TIA Portal accordingly. The messages are transmitted in the context of a session, each session has a session ID chosen by the PLC. A session begins with a four-message handshake used to select the cryptographic attributes of the session in- cluding the protocol version and keys. After the handshake, all messages are integrity protected using a cryptographic protection mechanism as illustrated in the next subsection. A. THE S7 INTEGRITY PROTECTION MECHANISM Siemens integrated cryptographic protection in its newer S7 proprietary protocol in order to protect its PLCs from unau- thorized access. The new mechanism uses two main modules: 1)A session key exchange protocol that the two parties (PLC and TIA Portal) use to establish a secret shared key in each session. 2)Per-fragment message protection that calculates a Message Authentication Code (MAC) value. 1) S7 KEY EXCHANGE PROTECTION Siemens improved its S7CommPlus protocol by replacing the key generation process in the prior version, i.e., the S7CommPlusV2, by a more complex process in the newer version S7CommPlusV3. The new mechanism involves a new key exchange technique, that uses elliptic-curve public-key cryptography [33] as depicted in Fig. 7. FIG. 8. The Structure of the SecurityKeyEncriptedKey BLOB Data. The rst request message is a Hello message that the TIA Portal sends to initialize a new session. Then, the PLC re- sponds back with sharing its rmware version, model, Session ID, and speci c 20-bytes known as PLC_Challenge . The PLC rmware version determines the elliptic-curve public-key pair to be used in the key exchange. After the TIA Portal receives the second message from the PLC, it activates a derivation algorithm to randomly select a key Derivation Key (KDK ), and to generate the session key from the PLC_Challenge and the selected KDK . Afterwards, the TIA Portal transmits the key encrypted using Elliptic-Curve Cryptography (ECC) to the PLC over the third message. The third message contains, among other things, two main parts: a) A data structure called SecurityKeyEncryptedKey shown in Fig. 8, which contains the selected key encrypted with the PLC s public key. b) Two 8-bytes key ngerprints (additional key), of the PLC public key ID and the selected key, respectively. Finally, the PLC veri es the third message. If this is done successfully, it returns OK in the fourth message, and from this point on, all the following messages in the session are integrity protected with the derived Session Key. 2) PER-FRAGMENTATION MESSAGE PROTECTION When the TIA Portal downloads/uploads the control logic program to/from an S7-1500 PLC, the assigned S7CommPlus messages are fragmented to many small fragments sent over the TCP/IP packets. All messages exchanged between the two parties are integrity protected HMAC-SHA256 [27]. This integrity protection is applied at the fragment level. Meaning that, it replaces the signal MAC value at the end of each message, and a cryptographic digest is placed at each frag- ment between the fragment header and the fragment data as shown in Fig. 9. [27] presents more technical details about this protection mechanism. Although fragmenting the S7 messages was more chal- lenging for attackers, they eventually overcame this protec- tion mechanism and compromised the PLCs using this tech- nique. The vulnerability reported in [28] shows that attackers VOLUME 3, 2022 153 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE FIG. 9. S7CommPlus message with integrity protection at fragment level. could implement man-in-the-middle approach and managed successfully to modify the network traf c exchanged on port 102/TCP due to the certain properties in the calculation used for this integrity protection. B. S7COMMPLUS DOWNLOAD MESSAGES - OBJECTS AND ATTRIBUTES S7 is a request response protocol. Each request message con- sists of a request header, and a request set. The header con- tains a function code, which identi es the requested operation e.g., 0x31 for a download message (see Fig. 9). A single S7CommPlus message might contain multiple objects, each containing multiple attributes. All objects and attributes have unique class identi ers. However, the CreateObject request builds a new object in the PLC memory with a unique ID (in our example, 0x04ca ). The program download message then creates an object of the class ProgramCycleOB . This object contains multiple attributes, each one having values dedicated to a speci c purpose. For instance, the FunctionalObject.Code contains the binary executable code that the PLC runs i.e., the compiled program in the PLC s machine language (MC7+). The Block.AdditionalMac is used as an additional MAC value in the integrity process, and both Block.OptimizedInfo and Block.BodyDescription are equivalent to the program written by the ICS operator which are stored in the PLC and can be later uploaded, upon request, to a TIA Portal project. From the security point of view, these attributes are critical data that is transmitted over the S7CommPlusV3 protocol. Meaning that, if an attacker can intercept the S7 packets con- taining these attributes, and manage successfully to modifythem independently, he is able to cause a source-binary in- consistency as explained in detail in the next section. V. ATTACK DESCRIPTION As in any typical injection attack, we patch our malicious code, Time-of-Day interrupt block OB10, in the original con- trol logic of the target PLC. The CPU checks whether the condition of the interrupt is met in each single execution cycle. Meaning that, the attacker s interrupt block will be always checked but only executed if the date and time of the CPU s clock match the date and time set by the attacker. Hence, we have two cases: 1) The date of CPU s clock matches the date set in the OB10 (the date of the attack). The CPU immediately halts executing OB1, stores the breaking point s location in a dedicated register, and jumps to execute the content of the corresponding interrupt block OB10. 2) The date of the CPU s clock does not match the date set in OB10. The CPU resumes to execute OB1 af- ter checking the interrupt condition without activating the interrupt and without executing the instructions in OB10. Our attack approach presented in this paper is comprised of two main phases: the patching phase (online phase), and the attack phase (of ine phase). Please note that, getting the IP address, MAC address, and model of the victim PLC is an easy task by running our PN-DCP protocol based scanner presented in [5] or other network scanners that can obtain all the information that the attacker needs to communicate with the target device. 154 VOLUME 3, 2022 FIG. 10. High-level overview of the patching phase. A. PATCHING PHASE Fig. 10 shows a high-level overview of this phase. We aim at injecting the PLC with our malicious instructions pro- grammed in the interrupt block OB10. This phase consists of four steps: a) Uploading and downloading the user s program. b) Modifying and updating the control logic program. c) Crafting the S7CommPlus download message. d) Pushing the attacker s message to the victim PLC. To patch the target PLC, we utilize our MITM station which has two main components: 1)AT I AP o r t a l : to retrieve and modify the current control logic program that the PLC runs. 2)A PLCinjector: to download the attacker s code to the PLC. In this work, we developed a python script based on the Scapy5library for this purpose. For a realistic scenario, there are two possible cases that an attacker might encounter after accessing the network. 1) CASE_1: INACTIVE S7 SESSION In this scenario, the legitimate TIA Portal is of ine, and only communicates with the PLC if an upload process is required. Step 1. Uploading & Downloading the User s Program: In this step, we aim at obtaining the decompiled control logic program that the PLC runs, and the S7CommPlus message that the TIA Portal sends to download the original user pro- gram into the PLC. For achieving these goals, we open rst the attacker s TIA Portal and establish a connection with the victim PLC directly. This is possible due to a security gap in 5https://scapy.net/the S7-1500 PLC design. In fact, the PLC does not introduce any security check to ensure that the currently communicating TIA Portal is the same TIA Portal that it communicated with in an earlier session. For this, any external adversary provided with a TIA Portal on his machine can easily communicate with an S7 PLC without any effort. After successfully establishing the communication, we up- load the control logic program on the attacker s TIA Portal. Then we re-download it once again to the PLC and sniff the entire S7CommPlus messages ow exchanged between the attacker s TIA Portal and the victim PLC using the Wireshark software. At the end of this step, the attacker has the program on his TIA Portal, and all the captured download messages saved in a Pcap le for a future use (explained in step 3). Step 2. Modifying & Updating the PLC s Program: After retrieving the user program that the target PLC runs, the at- tacker s TIA Portal displays it in one of the high-level pro- gramming languages that it was programmed with (e.g., SCL). Based on our understanding to the physical process controlled by the PLC, we con gure and program our Time-of-Day interrupt block OB10 to force certain outputs of the system to switch off once the interrupt is being activated (shown later in Fig. 13). Although our malicious code differs from the original code with only an extra small size block (OB10), it is suf cient to confuse the physical process of our experimental set-up. The easiest way to update the program running in the PLC is to use the attacker s TIA Portal. When we downloaded the modi ed control logic, the PLC updated its program success- fully. But, the ICS operator could easily reveal the modi ca- tion by uploading the program from the infected PLC, and VOLUME 3, 2022 155 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE FIG. 11. Closing the online session using MITM Approach. FIG. 12. Experimental Set-up. comparing the of ine and online programs running on his legitimate TIA Portal and the remote PLC respectively. Step 3. Crafting the S7CommPlus Download Message: To hide our infection from the legitimate user, we rst recorded the S7CommPlus messages exchanged between the attacker s TIA Portal and the PLC while downloading the modi ed pro- gram. As mentioned earlier in Section IV.B, each download message has objects and attributes see Fig. 9. The Program- CycleOB object is dedicated to create a program cycle block in the PLC s memory and has three different attributes: a)Object MAC: donated with the item value ID: Block.AdditionalMac . b)Object Code: donated with the item value ID: Function- alObject.code . c)Source Code: donated with the item value ID: Block.BodyDescription . The Object Code is the code that the PLC reads and pro- cesses, whilst the Source Code is the code that the TIA Portal FIG. 13. The malicious instructions in OB10. decompiles, reads, and displays for the user. Therefore, all what is required to show the user the original code is to modify the S7CommPlus message that the attacker sends; by replacing the Source Code attribute of the ProgramCycleOB object of the attacker s program with the Source Code attribute of the ProgramCycleOB object of the original program. Our investigation showed that the newest model of the SIMATIC PLCs has a serious design vulnerability. The PLC checks the session freshness by running a precaution measure. Hence, it can detect any manipulation and refuses to update its program in case the attributes do not belong to the same session. But surprisingly, this holds true only for the Object MAC and the Object Code attributes. Meaning that, to make the PLC ac- cept the crafted message, our crafted S7CommPlus download message must always have the Object MAC and the Object Code attributes from the same session, whilst the Source Code attribute could be substituted with another attribute from a different session i.e., from a pre-recorded session. All the captured packets containing the attributes of the ProgramCy- cleOB for both the user and attacker programs are presented in the Appendix. Step 4. Pushing the crafted message to the PLC: The crafted S7CommPlus download message contains the following at- tributes: the Object MAC and Object Code attributes of the attacker s program, and the Source Code attribute of the user program. As S7CommPlusV3 exchanges a shared session key between the TIA Portal and the PLC to prevent performing replay attacks, we rst need to bundle the packet with a correct key before we push the crafted message to the PLC. However, exploiting the shared key is out of the scoop of this paper, but it is explained in details in [30]. Once the malicious key exchange is completed, we can easily bundle the key byte- codes with our crafted message. Taking into consideration the appropriate modi cation to the session ID and the integrity elds, we store the nal S7 message (the attacker s message) in a pcap le for pushing it back to the PLC as a replay attack. Algorithm 1 describes the main core of our PLCinjector tool that we use to patch the PLC with the attacker s download message. 156 VOLUME 3, 2022 The PLCinjector tool has two functions. The rst one is utilized to exploit the integrity protection session key that S7CommPLusV3 uses. The session key exchanged in each session between the TIA Portal and S7-1500 PLCs originates from combining 16 bytes of the PLC s ServerSessionChal- lange , precisely the ones located between the bytes 2 and 18, with a random 24-byte KDK that the TIA Portal chooses. Afterwards, a ngerprinting function f( )is used within the sessionKey calculation. Line 5 generates a 24 bytes random quantity ( M), and maps it to the elliptic curve s domain do- nated as PreKey . From the random point PreKey ,w eu s ea Key Derivation Function (KDF) to derive 3-16 bytes quantities identi ed as follows: Key Encryption Key (KEK), Checksum Seed (CS) and Checksum Encryption Key (CEK) . In line 7, theCSgenerates 4096 pseudo-random bytes organized as four 256-word, namely LUT.T h i s LUT is used to calculate a checksum over the KDK andPLC_Challenge . Lines from 8 to 13 depict the elliptic curve key exchange method similar to the one that the TIA Portal uses to encrypt the random generated PreKey . After that, we mask the elliptic curve cal- culations with 20 bytes chosen randomly (donated to xin the algorithm). Line 19 provides an authenticated encryption for the encrypted KDK . Here a non-cryptographic checksum is computed, then encrypted by AES-ECP function. Finally, we add 2 header elds including key ngerprints i.e., 8-byte trun- cated SHA256 hashes of the relevant key with some additional ags see line 20. After establishing a successful session with the victim, the PLC exchanges the malicious generated Session_Key with the attacker machine along the current communicating session. In the next step, our tool executes function 2 to send the attacker s crafted S7 message that contains both the malicious code combined with the generated Session_Key . Our attacking tool can be also used against all the S7-1500 PLCs sharing the same rmware. This is due to the fact that Siemens has designed its new S7 key exchange mechanism assuming that all devices running the same rmware version use also the same public-private key pair mechanism [30]. After a successful injection, the PLC updates its program, processing the Object Code of the attacker s program while it saves the Source Code of the user s program in its mem- ory. Therefore, whenever the user uploads the program from the infected PLC, the TIA Portal will recall, decompile, and display the original program. This kept our injection hidden inside the PLC and the user could not detect any difference between the online and of ine programs. 2) CASE_2: ACTIVE S7 SESSION In this scenario, there is an ongoing active S7 session between the legitimate TIA Portal and the PLC during the patch. As the S7 PLC, by default, allows only one active online session, an attacker is not able to communicate with the PLC. It will immediately refuse any attempt to establish a connection as it is already communicating with the user. For such a scenario, the attacker needs rst to close the current online sessionAlgorithm 1: PLCinjector Tool. Function 1 Get_Session_Key (( ServerSessionChallenge )) 1: Checksum =0 2: PLC_Challenge =ServerSessionChallenge [2:18] 3: KDK=prng (24) 4: Session_Key =HMAC-SHA256 ( f(Challenge ,8)) [:24] 5: PreKey =M(prng(24)) 6: KEK,CEK,CS =KDF (PreKey) 7: LUT[4][256] =hash-init (CS) 8: while point== do 9: x=prng(20) 10: point=fx(G, y, Nonce) 11: EG2=y(point) 12: end while 13: EG1=add(s,PreKey ) 14: forblock in E( KDK )do 15: Checksum =hash (checksum) block, LUT[4][256] 16: end for 17: Checksum[12] =Checksum[12] 40 18: nal_Checksum =hash (Checksum, LUT[4][256] ) 19: key =AES-ECB ( nal_Checksum) 20: KEY =SHA256(key[:24] || DERIVE [:8]) 21: Return KEY END Function 1 Function 2 Replay (pcap le, Ethernet_interface, SrcIP, SrcPort) 22: RecvSeqNum =0 23: SYN =TRUE 24: forpkt in rdpcap (Pcap le) do 25: IP =packet [IP] 26: TCP =packet[TCP] 27: delete IP.checksum 28: IP.src =SrcIP 29: IP.Port =SrcPort 30: ifTCP. ags ==Ack or TCP. ags == RSTACK then 31: TCP.ack =RecvSeqNum+1 32: ifsendp(packet, iface=Ethernet_interface) then 33: SYN =False 34: Continue 35: end if 36: end if 37: Recv =Srp1(packet, iface =Ethernet_interface) 38: RecvSeqNum =rcv[TCP].seq 39: end for END Function 2 between the legitimate user and the PLC, before patching his malicious code. A user can establish an online session with an S7 PLC by enabling the go online feature in the TIA Portal software. Then he can control, monitor, diagnose, download, upload, VOLUME 3, 2022 157 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE start, and stop the CPU remotely. Once the user has estab- lished an online connection with the PLC, the two parties (the TIA Portal and PLC) start exchanging a speci c mes- sage along the session regularly. This message is known as S7-ACK , and in charge of keeping the session alive. The TIA Portal must always respond to any S7-ACK request sent by the PLC with a S7-ACK replay message. Therefore, for closing the current online session we run our MITM station (presented in [3]) that allows us to intercept and drop all packets sent from the TIA Portal, by performing the well-known ARP poisoning approach. If the PLC does not receive a response from the TIA Portal right after sending an acknowledgment request, it will close the connection with the connected TIA Portal and both go of ine. Fig. 11 describes this scenario. It is worth mentioning that, an attacker can also use dif- ferent ways to close the connection e.g., port stealing, replay attack with go of ine packets, etc. After both the legitimate TIA Portal and the victim PLC turned of ine, the attacker can easily establish a new session with the PLC, using his own TIA Portal. Then he patches the victim device following the same four steps explained in the previous case. For this scenario, our patching approach has limitations. The legitimate TIA Portal was forced to close the session with the PLC. Meaning that, the user can see obviously that he lost the connection with the remote device. In case he attempts to re-connect to the PLC while it is connected to the attacker s TIA Portal, the PLC will refuse his connection request. Our investigations showed that there is no way to re-connect the legitimate TIA Portal to the victim PLC after patching the PLC, unless the ICS operator himself enables go online on his TIA Portal. This abnormal disconnection between the two parties is the only effect of our patch in this scenario. B. ATTACK PHASE After a successful injection, the attacker goes of ine and closes the current communication session with the target PLC. With the next execution cycle, the attacker s program will be executed in the PLC. Meaning that, the interrupt condition of the malicious interrupt block OB10 will be checked in each execution cycle. This block remains in idle mode, and hidden in the PLC s memory as long as the interrupt condition is not met. Once the con gured date and time of the attack matches the date and time of the CPU, the interrupt code will be acti- vated i.e., the execution process of the main program (OB1) is suspended, and the CPU jumps to execute all the instructions that the attacker programmed OB10 with. In our application example, we programmed the OB10 to force certain motors to turn off at a certain time and date when we are completely disconnected from the target s network. VI. EVALUATION, DISCUSSION, AND MITIGATION In this section, we present the implementation of our attack approach, and assess the service disruption of the physical process due to our patch. Afterwards, we discuss our results and suggest possible mitigation methods to protect systems from such a threat.A. LAB SETUP For evaluating our attack approach, we used the Fischertech- nik training factory shown in Fig. 12. It consists of industrial modules such as storage and retrieval stations, vacuum suction grippers, high-bay warehouse, multi-processing station with kiln, a sorting section with color detection, an environment sensor and a pivoting camera. The entire factory is controlled by a SIMATIC S7-1512SP with a rmware V2.9.2, and pro- grammed by TIA Portal V16. The PLC connects to a TXT controller via an IoT gateway. The TXT controller serves as a Message Queuing Telemetry Transport (MQTT) broker and an interface to the schertechnik cloud. The factory we used in our experiment provides two in- dustrial processes. Storing and ordering materials. The default process cycle begins with storing and identifying the material i.e., workpiece. The factory has an integrated NFC tag sensor storing production data that can be read out via an RFID NFC module. This allows the user to trace the workpieces digitally. The cloud displays the part s colour and its ID-number. Af- terwards, the vacuum gripper places suction on the material and transports it to the high bay warehouse which applies a rst-in rst-out principle for the outsourcing. All goods that were stored could be ordered again online using a dashboard. The desired product and the corresponding color are selected by the user, and then placed in the shopping cart. The suction gripper passes the workpiece from one step to the next, and then moves back to the sorting system once the production is complete. The sorting system receives the allocation com- mand as soon as the color sorter detects the proper color. The material is sorted using pneumatic cylinders. Finally the production data is written on the material at the end of the production process, and the nished product will be provided for collection. B. IMPLEMENTATION In our experiment, we found that the vacuum suction gripper (VGR) is involved in all the industrial processes that the Fis- chertechnik system operates. Therefore, if we could disrupt its functionality, then the entire system would be impacted. The VGR module moves with the help of 8 mini motors: vertical motor up (%Q2.0), vertical motor down (%Q2.1), hor- izontal motor backwards (%Q2.2), horizontal motor forwards (%Q2.3), turn motor clockwise (%Q2.4), turn motor anti- clockwise (%Q2.5), compressor (%Q2.6), and valve vacuum (%Q2.7). Therefore, for exploiting the VGR, we programmed our OB10 to force all the 8 motors to switch off at the point zero for the attack as shown in Fig. 13. After patching the PLC with our malicious block, and be- fore the Time-of-Date interrupt being activated, we did not record any physical impact and the Fischertechnik system keeps operating normally. Once the CPU clock matches the attack time that we set, we noticed that the VGR module stopped moving. Furthermore, the workpiece that is being transported by the gripper has fallen down, as the compressor, which provides the appropriate air ow to carry the good, 158 VOLUME 3, 2022 FIG. 14. Boxplot presenting the measured execution cycle times of OB1. was turned off. This led to an incorrect operation, and the movement sequence of the workpieces was disrupted. For a real-world heavy factory e.g. automobile manufacturing in- dustry, such an attack scenario might be seriously dangerous and even cost human lives. C. EVALUATION To assess the impact of our patch on the physical process controlled by the infected device accurately, we measured and analyzed the differences of the execution cycle times for the control logic program that the PLC runs in three different scenarios:rNormal Operation: before patching the PLC as a base- line.rIdle Attack: after patching the PLC and before the in- terrupt is being activated i.e., the PLC is running the attacker s program.rActivated Attack: after the interrupt is being executed. Siemens PLCs, by default, store the time of the last execution cycle in local variable of OB1 called OB1_PREV_CYCLE . Therefore, we added a small SCL code snippet to our control program which stores the last cycle time in a separate data block. Then we recorded 4096 execution cy- cle times for each scenario, calculated the arithmetic median value, and used the Kruskal-Wallis and the Dunn s Multiple Comparison test for statistical analysis. All the results are presented as boxplots in Fig. 14. In order to make our resulting boxplots clearer and easier to read, we de ne the following parameters: 1) First quartile (Q1): represents the middle value (cycle time) between the smallest value and the median of the total recorded values (4096 execution cycle times). 2) Median (Q2): represents the middle value of the total recorded values. 3) Third quartile (Q3): represents the middle value be- tween the highest value and the median of the total values recorded. 4) Interquartile Range (IQR): represents all the values be- tween 25% to 75% of the total recorded values. 5) Maximum: represents Q3 + 1.5*IQR 6) Minimum: represents Q1 - 1.5*IQR7) Outliers: represents all the values that they are higher and lower than the maximum and minimum values re- spectively. Our measurements show that the calculated median value (Q2) of executing the OB1 for the infected program is approx. 38 ms, and differs slightly from the median value of executing the OB1 for the original program which is almost 36 ms. The Q1, and Q3 values for the infected program are as high as 36 ms and 40 ms respectively. They are a bit higher compared to the recorded ones for the original program i.e., 35 ms and 37 ms for Q1 and Q3 respectively. Meaning that, checking the interrupt condition of our malicious block in each execu- tion cycle does not disrupt executing the control logic, and the Fischertechnik system keeps operating normally. Please note that, executing the attacker s program should not exceed the overall maximum execution time of 150 ms. Our mea- surements clearly show that our injection did not trigger this timeout as we recorded a maximum value as high as 47 ms which is still quite small compared to 150 ms. Once the CPU s date and time match the date and time that we set to trigger our attack, the CPU jumps to execute the malicious instruction existing in OB10, and the attack is activated. Our measurements, for this scenario, did not record any higher median values in the execution cycles compared to the prior scenario i.e., when the attack is idle. This is because we set the OB10 to occur only once, so the PLC processes the instructions existing in OB10, and resumes executing OB1 from the last point before the interrupt. But it keeps checking the condition of the interrupt in each cycle as long as OB10 is existing in the control logic program. However, our approach allows attackers to adjust the repeating of the interrupt (see Section III), as well as to program the interrupt block on their will causing different impacts in the physical process of the target system. D. DISCUSSION Based on our analysis, we can conclude that when our patch is in idle mode, the execution cycle times of the infected program are almost as high as the execution times of the orig- inal program. Therefore, the ICS operator would not record any abnormality in executing the control logic as the TIA Portal software will not report any differences before and after the patch. Furthermore, our attack approach always shows VOLUME 3, 2022 159 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE the original program to the ICS operator, despite the PLC is running a different one. This is due to the fact that the original Source Code attribute is always sent back to the TIA Portal whenever the user requires the program from the infected PLC. Due to all that, our attack is capable of staying in the device in idle mode for a long time without being revealed, and the only way to remove it is to re-program the device once again by the ICS Operator. However, in critical facilities and power plants, re-programming the PLCs is not a common case unless there is a certain reason to do so. The success of our attack approach on S7-1500 PLCs is, indeed, based on serious design vulnerabilities in the newest model of S7 PLCs and security issues in the integrity mecha- nism used in the latest version of the S7CommPlus protocol. We found that the PLC does not authenticate the TIA Portal as we expected, and only con rms the session freshness. This allows an external attacker to perform replay attacks against the PLC, keeping in mind that he has always to provide the correct Session_Key in his crafted S7 messages, otherwise the PLC will detect that the expected S7 message received has been modi ed and will refuse to update its program. Siemens claimed that the newest PLCs are resilient against replay attacks, but unfortunately we could maliciously update the PLC s program by sending a crafted S7 download message. Another vulnerability we detected during our investigations is that there is no security pairing between the TIA Portal and the PLC i.e., the PLC does not ensure that the TIA Portal it is currently-communicating with, is the same TIA Portal than in a previous session. This allows an attacker who has a TIA Portal installed on his machine to easily access the PLC without any efforts. Although this holds true as long as the target PLC is not already connected online to the legitimate TIA Portal. Our results showed that an attacker can still com- municate and inject the victim after closing the current session between the TIA Portal and the PLC. It is also noticed that Siemens provides its 1500 CPUs with a sophisticated integrity checking algorithm which checks the validity of any S7 mes- sage received. But unfortunately, this does not hold true for the entire ProgramCycleOB Object. Meaning that, the CPU checks only the integrity of the Object MAC and the Object Code , and has no integrity check for the Source Code . So, if an attacker replaces the Source Code from another session with a new one, the PLC will authenticate the download message and run the attacker s program. This is a signi cant security gap in the design of the integrity mechanism for S7-1500 PLCs, as it keeps the injection hidden inside the memory. E. MITIGATION The fundamental solution would be completely redesigning the integrity check mechanism that the newest S7 PLCs use. The new mechanism should include a security pairing and mutual authentication between the PLC and TIA Portal. But we are aware of the fact that such a solution would also incur an extremely high cost and may have backward compatibility issues. Furthermore, ICS devices are usually not software updated on time, and have a very long life-cycle comparedto common IT devices. For all that, we should expect that insecure devices will keep employed in real-world ICS envi- ronments for a long time. In this term, network detection can be seamlessly integrated into the existing ICS setting. In par- ticular, control logic detection [36], and veri cation [41], [42] can be utilized to alleviate current situation. As our injection was hidden in the PLC memory, so partitioning the memory space and enforcing memory access control [37] could also be a reasonable solution. Other suggestions include employ- ing standard cryptography methods such as digital signatures (for messages like control logic manipulation), but also us- ing network monitoring tools like snort [38], ArpAlert [39], and ArpWatchNG [40] for revealing any attack involving MITM attacks. Furthermore, a mechanism to check the pro- tocol header which contains information about the type of the payload is also recommended as a solution to detect and block any potential unauthorized transfer of the control logic. However, from our perspective the best solution to prevent injection attacks is to separate the information technology (IT) domain from operational technology networks by using a Demilitarized Zone (DMZ). VII. CONCLUSION This paper presented a new threat on the newest SIMATIC PLCs. Our attack approach is based on injecting the attacker s malicious code once he gains access to the target s network, but activating his patch later without a need to be connected at the time of the attack. Our investigation identi ed a few design vulnerabilities in the new integrity method that the S7-1500 PLCs use. Based on our ndings, we managed successfully to conduct an injection attack, by patching the tested PLC with a Time-of-Day interrupt block (OB10). This block allows us to activate our patch, and to confuse the physical process without being connected to the victim at the point zero for the attack. We analyzed and evaluated the possibility of revealing our in- jection by the ICS operator. Our experimental results showed that the original control logic program is always shown to the user, whilst the PLC runs the attacker s program. In addition, our injection does not increase the execution times of the control logic. Hence, the physical process is not impacted when our patch is in idle mode. To summarize, our attack is a very serious threat targeting ICSs, as attackers need to be only online during the patch and can close all the connections to the target s network afterwards. Therefore, they will not be detected even if the ICS operators re-activate the security mea- sure. Finally, we provided some recommendations to secure ICSs from such a severe threat. Our attack approach is feasible for all S7-1500 PLCs with a rmware 2.9.2 or lower. However, Siemens updated the rmware for all S7-1500 CPUs in December, 2021 to the newer version 2.9.4. Therefore, a further investigation is re- quired to test the security of the latest rmware version. Fur- thermore, a deeper analyzes of the advanced S7CommPlus protocol aiming at understanding the private key mechanism that PLCs implement can be also be a part of future works. We believe that, if attackers manage successfully to extract the 160 VOLUME 3, 2022 private key from an S7-1500 PLC, then stronger attacks e.g., fully man in the middle, session-hijacking, and impersonation PLC attacks might become possible for the entire products line. VII. APPENDIX. PACKETS CAPTURE FIG. 15. Object MAC Attribute - User Program. FIG. 16. Object Code Attribute - User Program. FIG. 17. Source Code Attribute - User Program. FIG. 18. Object MAC Attribute - Attacker Program. FIG. 19. Object Code Attribute - Attacker Program. FIG. 20. Source Code Attribute - Attacker Program. REFERENCES [1] W. Alsabbagh and P. Langend rfer, A fully-blind false data injection on PROFINET i/o systems, in Proc. IEEE 30th Int. Symp. Ind. Elec- tron., 2021, pp. 1 8. [2] H. Wardak, S. Zhioua, and A. Almulhem, PLC access control: A security analysis, in Proc. World Congr. Ind. Control Syst. Secur. , 2016, pp. 1 6. [3] W. Alsabbagh and P. Langend rfer, A stealth program injection attack against S7-300 PLCs, in Proc. 22nd IEEE Int. Conf. Ind. Technol. , 2021, pp. 986 993. [4] D. Beresford, Exploiting siemens simatic S7 PLCs, in Black Hat USA , 2011, pp. 723 733. [5] W. Alsabbagh and P. Langend rfer, A remote attack tool against siemens S7-300 controllers: A practical report, in 11. Jahreskollo- quium Kommunikation in der Automat. , 2020. [6] J. Klick, S. Lau, D. Marzin, J. Malchow, and V. Roth, Internet-facing PLCs-a new back ori ce, in Black Hat USA , 2015, pp. 22 26. [7] A. Spenneberg, M. Br ggemann, and H. Schwartke, PLC-blaster: A. worm living solely in the PLC, in Black Hat Asia Marina Bay Sands , 2016, pp. 1 16. [8] N. Govil, A. Agrawal, and N. O. Tippenhauer, On ladder logic bombs in industrial control systems, in Proc. Int. Workshop Secur. Ind. Control Syst. Cyber-Physical Syst. , 2018, pp. 110 126. [9] K. Sushma, A. Nehal, Y. Hyunguk, and A. Irfan, CLIK on PLCs! Attacking control logic with decompilation and virtual PLC, in Proc. Netw. Distrib. Syst. Secur. Symp. , 2019, [Online]. Available: https: //ruoyuwang.me/bar2019/pdfs/bar2019- nal74.pdf. [10] W. Alsabbagh and P. Langend rfer, Patch now and attack later exploiting S7 PLCs by time-of-day block, in Proc. 4th IEEE Int. Conf. Ind. Cyber-Phys. Syst. , 2021, pp. 144 151. [11] W. Alsabbagh and P. Langend rfer, A control injection attack against S7 PLCs manipulating the decompiled code, IECON 2021 Proc. 47th Annu. Conf. IEEE Ind. Electron. Soc., Toronto, ON, Canada, Oct., 2021, pp. 1 8. [12] N. Falliere, Exploring Stuxnet s PLC infection process, in Virus Bul- letin Covering Global Threat Landscape Conf. , Sep. 2010, [Online]. Available: http://www.symantec.com/connect/blogs/exploringstuxnet- s-plc-infection-process. [13] Y. Hyunguk and A. Irfan, Control Logic Injection Attacks on Industrial Control Systems . Berlin, Germany: Springer, 2019. VOLUME 3, 2022 161 ALSABBAGH AND LANGEND ERFER: NEW INJECTION THREAT ON S7-1500 PLCS - DISRUPTING THE PHYSICAL PROCESS OFFLINE [14] L. Garcia et al. , Hey my malware knows physics! Attacking PLCs with physical model aware rootkit, Proc. 24th Ann. Netw. Distrib. Syst. Secur. Symp ., 2017, pp. 1 15, doi: 10.14722/ndss.2017.23313 . [15] Z. Basnight et al. , Firmware modi cation attacks on programmable logic controllers, Int. J. Crit. Infrastructure Protection ,v o l .6 , pp. 76 84, 2013. [16] Attackers Deploy New ICS Attack Framework TRITON, and Cause Operational Disruption to Critical Infrastructure . Accessed: Apr. 12, 2021. [Online]. Available: https://www. reeye.com/blog/threat- research/2017/12/attackers-deploy-new-ics-attack-framework- triton.html [17] R. M. Lee, M. J. Assante, and T. Conway, Analysis of the cyber- attack on the ukrainian power grid, Tech. Rep., SANS E-ISAC, Mar. 18, 2016. [Online]. Available at: https://ics.sans.org/media/ESAC_ SANS_Ukraine_DUC_5.pdf [18] S. Senthivel et al. , Denial of engineering operations attacks in in- dustrial control systems, in Proc. 18th ACM Conf. Data Appl. Secur. Privacy , 2018 pp. 319 329. [19] G. liang, S. R. Weller, J. Zhao, F. Luo, and Z. Y. Dong, The 2015 Ukraine blackout: Implications for false data injection attacks, IEEE Trans. Power Syst. , vol. 32, no. 4, pp. 3317 3318, Jul. 2017. [20] N. Falliere, L. O. Murchu, and E. Chien, W32. Stuxnet Dossier, Symantec Corp., Security Response, Tempe, AZ, USA, White Paper, 2011. [21] R. Langner, Stuxnet: Dissecting a cyberwarfare weapon, IEEE Secur. Privacy , vol. 9, no. 3, pp. 49 51, May/Jun. 2011. [22] T. De Maizi re, Die Lage Der IT-Sicherheit in Deutschland 2014, The German Federal Of ce for Information Security, German Federal Of ce Inf. Secur. , 2014. [Online]. Avail- able: https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/ Publikationen/Lageberichte/Lagebericht2014.pdf [23] Siemens ProductCERT and Siemens CERT, Security advisory, Pers. commun. , 2019. [Online]. Available: https://new.siemens.com/global/ en/products/services/cert.html [24] IPCS Automation, Market share of different PLCs, 2018, [On- line]. Available: https://ipcsautomation.com/blog-post/market-share- of-different-plcs/ [25] S. Frances, Top 20 programmable logic controller manufacturers, Robotics Automation News , 2020. [Online]. Available: https: //roboticsandautomationnews.com/2020/07/15/top-20-programmable- logic-controller-manufacturers/33153/ [26] Statista Research Department, Programmable logic controllers: Global manufacturer market share 2017, 2021, [Online]. Available: https://www.statista.com/statistics/897201/global-plc-market-share- by-manufacturer/ [27] G. Benmocha, E. Biham, and S. Perle, Unintended features of APIs: Cryptanalysis of incremental HMAC, in Selected Areas in Cryptogra- phy.(Lecture Notes in Computer Science 12804) O. Dunkelman, M. J. Jacobson, Jr, and C. O Flynn, Eds. Berlin, Germany: Springer, 2021. [28] National Institute of Standards and Technology, CVE-2019-10929, National Vulnerability Database, 2019, [Online]. Available: https://nvd. nist.gov/vuln/detail/CVE-2019-10929 [29] T. Wiens, S7comm wireshark dissector plugin, SourceForge , 2011. [Online]. Available: http://sourceforge.net/projects/ s7commwireshark [30] E. Biham, S. Bitan, A. Carmel, A. Dankner, U. Malin, and A. Wool, Rogue7: Rogue engineering-station attacks on S7 simatic PLCs, in Black Hat USA , 2019, [Online]. Available: https://i.blackhat.com/USA19/Thursday/us-19-Bitan-Rogue7-Rogue- Engineering-Station-AttacksOn-S7-Simatic-PLCs-wp.pdf. [31] C. Lei, L. Donghong, and M. Liang, The spear to break the secu- rity wall of S7CommPlus, in Black Hat USA , 2017, [Online]. Avail- able: https://www.blackhat.com/docs/eu-17/materials/eu-17-Lei-The- Spear-ToBreak%20-The-Security-Wall-Of-S7CommPlus-wp.pdf. [32] H. Hui and K. McLaughlin, Investigating current PLC security issues regarding siemens S7 communications and TIA poral, in Proc. Ind. Control Syst. Cyber Secur. Res. , 2018, pp. 67 73. [33] A. Menezes and S. Vanstone, Elliptic curve cryptosystems and their implementation, J. Cryptol. , vol. 6, pp. 209 224, 1993. [34] F. Wei erg, Analysis of the S7CommPlus protocol in terms of cryp- tography used, (in German), Mar. 26, 2018. [Online]. Available: https: //www.os-s.net/publications/thesis/Bachelor_Thesis_Weissberg.pdf [35] A. Ayub, H. Yoo, and I. Ahmed, Empirical study of PLC authentication protocols in industrial control systems, in Proc. IEEE Secur. Privacy Workshops , 2021, pp. 383 397.[36] H. Yoo, S. Kalle, J. Smith, and I. Ahmed, Overshadow PLC to detect remote control-logic injection attacks, in Proc. Int. Conf. Detection Intrusions Malware, Vulnerability Assessment , 2019, pp. 109 132. [37] C. H. Kim et al. , Securing real-time microcontroller Systems through customized memory view switching, in Proc. Netw. Distrib. Syst. Se- cur. Symp. , 2018, doi: 10.14722/ndss.2018.23117 . [38] M. Roesch et al. , Snort: Lightweight intrusion detection for networks, Lisa, vol. 99, no. 1, pp. 229 238, 1999. [39] C. H. Kim et al. , Securing real-time microcontroller systems through customized memory view switching, Network Distributed Syst. Secu- rity (NDSS) Symp. , 2018, doi: 10.14722/ndss.2018.23117 . [40] C. Leres et al. , arpwatch Description, KaliTools, 2021, [Online]. Available: https://en.kali.tools/?p=1411. [41] S. Zonouz, J. Rrushi, and S. McLaughlin, Detecting industrial control malware using automated PLC code analytics, IEEE Secur. Privacy , vol. 12, no. 6, pp. 40 47, Nov./Dec. 2014. [42] M. Zhang et al. , Towards automated safety vetting of PLC code in real- world plants, in Proc. IEEE Symp. Secur. Privacy , 2019, pp. 522 538. [43] Siemens, S7-300 CPU 31xC and CPU 31x: Technical speci cations, 2011. [Online]. Available: https://cache.industry.siemens.com/dl/ les/ 906/12996906/att_70325/v1/s7300_cpu_31xc_and_cpu_31x_manual_ en-US_en-US.pdf [44] H. Hui, K. McLaughlin, and S. Sezer, Vulnerability analysis of S7 PLCs: Manipulating the security mechanism, Int. J. Crit. Infrastructure Protection , vol. 35, 2021, Art. no. 100470. [45] S. Mclaughlin, On dynamic malware payloads aimed at programmable logic controllers, in HotSec , 2011, [Online]. Available: http://www. stephenmclaughlin.org/hotsec-2011.pdf. [46] S. McLaughlin and P. McDaniel, SABOT: Speci cation-based payload generation for programmable logic controllers, in Proc. ACM Conf. Comput. Commun. Secur. , 2012, pp. 439 449. [47] A. Serhane, M. Raad, R. Raad, and W. Susilo, PLC code-level vulner- abilities, in Proc. Int. Conf. Comput. Appl. , 2018, pp. 348 352. [48] S. E. Valentine, PLC code vulnerabilities through scada systems, Ph.D. dissertation, Univ. South Carolina, 2013. [Online]. Available: https://scholarcommons.sc.edu/etd/803 [49] Siemens, SIMATIC STEP 7 Basic/Professional V16 and SIMATIC WinCC V16, 2019, [Online]. Available: https: //support.industry.siemens.com/cs/document/109773506/simatic-step- 7-basic-professional-v16-and-simatic-wincc-v16?dti=0&lcn-WW WAEL ALSABBAGH (Member, IEEE) received the B.S. and M.S. degrees in automatic control and computer engineering from Al-baath University, Homs, Syria, in 2012 and 2015, respectively. He is currently working toward the Ph.D. degree in com- puter science with the Technical University of Cot- tbus, Cottbus, Germany. Since 2018, he has been a Scientist with the IHP-Leibniz-Institut f r Innova- tive Mikroelektronik, Frankfurt (Oder), Germany. His research interests include the cyber-attacks and security, mitigation methods of the attacks target- ing industrial control systems, and supervisory control and data acquisition. PETER LANGEND ERFER received the Diploma and Ph.D. degrees in computer science. Since 2000, he has been with the IHP-Leibniz-Institut f r Innovative Mikroelektronik, Frankfurt (Oder), Germany. In the IHP-Leibniz-Institut f r Innova- tive Mikroelektronik, he is leading the Wireless Systems Department. From 2012 to 2020, he was leading the Chair for security in pervasive sys- tems with the Technical University of Cottbus- Senftenberg, Cottbus, Germany. Since 2020, he owns the chair wireless systems with the Technical University of Cottbus-Senftenberg. He has authored or coauthored more than 150 refereed technical articles, led 17 patents of which ten have been granted already. His research interests include security for resource constraint devices, low power protocols, and ef cient implementations of AI means and re- silience. He was a Guest Editor of many renowned journals, such as Wireless Communications and Mobile Computing (Wiley) and ACM Transactions on Internet Technology . 162 VOLUME 3, 2022 |
SCADA_honeypots_An_in-depth_analysis_of_Conpot.txt | Supervisory Control and Data Acquisition (SCADA) honeypots are key tools not only for determining threats which pertain to SCADA devi ces in the wild, but also for early detection of potential mali cious tampering within a SCADA device network. An analysis of one such SCADA honeypot, Conpot, is conducted to determine its viability as an effective SCADA emulating device. A long-term analysis is conducted and a simple scoring mechanism lev eraged to evaluate the Conpot honeypot. | SCADA Honeypots An In-depth Analysis of Conpot Arthur Jicha, Mark Patton, and Hsinchun Chen University of Arizona Department of Management Information Systems Tucson, AZ 85721, USA ajicha@email.arizona.edu, mpatton@ema il.arizona.edu, hchen@eller.arizona.edu Keywords Supervisory Control and Data Acquisition systems, honeypots, Conpot, network security I. INTRODUCTION In a world where the value of information is ever increasing, hackers are consiste ntly targeting governments, corporations, and individuals to obtain valuable secrets, proprietary data, and personally identifiable information (PII). Honeypots can be used to better understand the landscape of where these attacks are orig inating. Honeypots can be leveraged not only to conduct research on threats in the wild, but also to notify an organization if a potential threat is within one s network. Supervisory Control and Data Acquisition (SCADA) systems are a critical ta rget, and with the advent of SCADA honeypots, attempts to access or tamper with SCADA devices can be preemptively identified and analyzed. A. Background SCADA Honeypots attempt to mimic an active SCADA system. A typical SCAD A system is composed of four parts: a central computer (host), a number of field-based remote measurement and control units known as Remote Terminal Units (RTUs), a wide area telecommunications system to connect them, and an operator interface to allow the operator to access the system [1]. Conpot is a low-interactive SCADA honeypot and serves the purpose of being extremely easy to implement. Serbanescu et al., for example, found th at Conpot would support the simulation of hypertext transfer protocol (HTTP), Modbus (a serial communication protocol), and Simple Network Management Protocol (SNMP; used for network management), and the integration of programmable logic controllers (PLC) [2]. The Co npot project by The Honeynet Project was released in May 2013. Conpot utilizes a logging system to monitor any changes th at are made by intruders. The honeypot logs events of HTTP, SNMP and Modbus services with millisecond accuracy an d offers basic tracking information such as source address, request type, and resource requested in the case of HTTP [3]. B. Research Gap In a literature review of SCADA honeypots, a gap was identified regarding the analysis of the effectiveness of the various honeypots. Studies were found that detailed the interactions occurring with a given honeypot, i.e., Digital Bond Honeynet and Conpot; however, studies of the actual effectiveness of any given honeypot have not been conducted. The closest approach to this fi eld of study was carried out by Fronimos, et. al., whose study focused on evaluating the usability and performance of Low Interaction Honypots, but did not examine the specifics of SCADA honeypot efficacy [4]. A more detailed look at the efficacy of SCADA honeypots that takes into account their uniq ue requirements has not been conducted prior to this res earch. This paper performs a detailed evaluation of the Conpot SCADA Honeypot. II.E XPERIMENT APPROACH To conduct a full analysis of the SCADA honeypot Conpot, a virtualized image was created and used in multiple Amazon Web Services (AWS) zones. The SCADA honeypots ran from March 25 th to April 11th and the logs were subsequently analyzed. An additional log set was pulled April 27 th for further analysis. The following section outlines the steps for setup and process for creating instances of Conpot. Installation of Conpot is quite simple; however, certain dependencies are necessary for it to fully function. Due to the age of some of the required p ackages, repositories must be manually added. Ubuntu 12.04, an open source software platform used for various mobile and other devices, was used as the base operating system for a micro-instance within AWS, after configuring basic se ttings and conducting updates. A. Experiment Setup After successfully obtaining th e Conpot start screen, the AWS micro-instance was shut down so that an image could be created. Utilizing the Create Image function within AWS, the image was then added to the Images AMI folder for deployment. This image was then propagated to additional AWS deployment zones. After deploying the image twice in each zone (see Table I), the SCADA honeypots were booted and accessed via SSH to finalize their deployment. This material is based upon work sup ported by the U.S. National Science Foundation under Grant No. DUE-1303362 and SES-1314631. 978-1-5090-3865-7/16/$31.00 2016 IEEE 196 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:41:48 UTC from IEEE Xplore. Restrictions apply. An advantage to leveraging AWS is its key management and port security options. Each instance of the Conpot was set up to allow all ports to be accessible and to provide an accurate review of port inform ation when running any given honeypot template. Furthermore, the key pair options facilitated maintaining secure access to each instance. After obtaining the private key necessary to create a connection, each instance was generated using the same public key which allowed access using one private certificate combined with the instance password. After accessing each honeypot, the following command was utilized to start the Conpot with the designated template: sudo conpot --template [template name] If a template name is not selected, the default option of default is used. For the purpo ses of the honeypot analysis, an in-depth review of both the Guardian AST gas pump monitoring system and default Siemens S7-200 ICS was performed together with a brief analysis of the IPMI - 371 and Kamstrup 382 smart meter SCADA devices. B. AWS Deployment The following table summarizes the deployed Conpot honeypots by their location, IP address, and template details. The honeypots were deployed globally across AWS for future analysis into regional variations on attack frequency and type: TABLE I. AWS CONPOT DEPLOYMENT ZONE INFORMATION AWS Location Name IP Details us-east-1a Conpot1 52.23.225.126 Default template us-east-1a Conpot2 54.86.249.160 Emulation of gas tank level us-west-2b Conpot3 52.36.62.44 Default template us-west-2b Conpot4 52.32.45.32 Em ulation of gas tank level eu-west-1b Conpot5 52.30.167.154 Default template eu-west-1b Conpot6 52.19.95.69 Emulation of gas tank level ap-northeast-1c Conpot7 52.192.20.179 Default template ap-northeast-1c Conpot8 52.196.47.205 Emulation of gas tank level ap-southeast-1b Conpot9 54.254.141.38 Default template ap-southeast-1b Conpot10 54.254.140. 52 Emulation of gas tank level sa-east-1a Conpot11 54.207.96.59 Default template sa-east-1a Conpot12 54.232.248.38 Emulation of gas tank level III. DATA AND RESULTS A. Nmap Scan Data The security scanner Nmap was utilized to check the open ports after starting Conpot. Nmap was chosen as it is a mature, robust connection-oriented canning tool that is widely used and has broad support for many protocols. For initial comparison, a vanilla installation of Ubuntu was also deployed and scanned to show what ports are open by default. The following Nmap scanni ng commands were used: nmap -A -v [IP Address] nmap -A -v -Pn [IP Address] nmap -A -v -Pn -p- [IP Address] Nmap was used in a staged approach to show what different scanning techniques showed as the open port results (Tables II and III). The flag -A results in Nmap turning on version detection and other Advanced and Aggressive features (nmap.org). This scanning technique is intrusive and readily detected due to its aggr essive scanning and operation systems (OS) detection, but it provides a good representation of what to expect for identification. Using the -Pn resulted in Nmap suppressing pings when conducting scans to determine if a host is up. For the purposes of the analysis, the virtual machines were already known to be operational and in some cases their configurations reject ed pings. The -p- flag was also used to conduct a scan over the entire port range (ports 1-65535). Lastly, the flag -v (version detection) was used also, although it was later deemed not necessary, as the A flag already included version detection. TABLE II. N MAP SCANNING (UTILIZING FLAGS V AND A) Honeypot Type Result Ports Opened by Conpot Siemens S7-200 22, 80 80,102, 161, 502, 623, 47808 Guardian AST N/A 10001 IPMI N/A 623 Kampstrup Smart Meter N/A 1025, 50100 Scanning with the -v and -A flags resulted in no results from the Guardian AST, IPMI , and Kampstrup smart meter, due to pings being rejected by these SCADA configurations. The revelation of port 22 through a ping scan should allow an attacker to question whether the Siemens S7-200 emulator is a honeypot or an actual SCADA device. TABLE III. NMAP SCANNING (UTILIZING V, -A, AND -PN FLAGS ) Honeypot Type Result Ports Opened by Conpot Siemens S7-200 22, 25, 80, 514, 6009, 8443 80,102, 161, 502, 623, 47808 Guardian AST 22, 25, 514, 6004, 10001 10001 IPMI 22 623 Kampstrup Smart Meter 22, 25, 514, 1025, 1068 1025, 50100 After utilizing the -Pn flag to stop the ping option during scans, many more ports were identified across the various usable templates within Conpot. However most of these additional ports were not SCADA ports; for example, port 514 was for system logging, while many of the opened SCADA ports remained undetected. This indicates that Conpot installations running on Ubuntu appear to be very susceptible to having Ubuntu default services enabled and running across a multitude of ports that would not be available on a standard SCADA installation. As a final scan to compare against, all ports were scanned to determine what a full Nmap sc an would show as open port results (Table IV). On average the scans took around three to four hours to fully process due to the intensity of the scans. The wide range of additional open ports, including ports in the dynamic/private range of 49152-65536 (note: The Kampstrup Smart Meter statically assigns a port in this range) again calls into question the ability of a default Conpot installation that 197 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:41:48 UTC from IEEE Xplore. Restrictions apply. does not actively close all other port-opening Ubuntu services to masquerade as an actual SCADA device, if comprehensive port scanning is utilized, or even if repositories such as Shodan are. TABLE IV. N MAP SCANNING (UTILIZING V, A, PN, AND -P- FLAGS ) Honeypot Type Result Ports Opened by Conpot Siemens S7-200 22, 80, 102, 502, 514, 2000, 5060, 8008, 8020, 18556 80,102, 161, 502, 623, 47808 Guardian AST 22, 514, 2000, 3826, 5060, 8008, 8020, 10001, 11190, 19116, 36123, 43787, 48191, 63790 10001 IPMI 22, 2000, 5060, 8008, 8020 623 Kampstrup Smart Meter 22, 514, 1025, 2000, 4368, 5060, 8008, 32469, 50100, 52245, 57565 1025, 50100 Vanilla Ubuntu Install 22, 514, 2000, 5060, 8008, 8020, 38051, 38093, 47785 B. SHODAN Scan Data SHODAN data was also anal yzed to determine which ports it detected as open within the various Conpot templates. Shodan regularly scans the entire IPV4 internet address space and as such is a reliable indicator of what can be seen by third parties conducting reconnaissance scanning. Unfortunately, the IPMI and Kampstrup templates were never identified by SHODAN due to time constraints. TABLE V. SHODAN SCAN DATA RESULTS Honeypot Type SHODAN Port Scan Results Conpot Ports Siemens S7-200 22, 80, 102, 161 80,102, 161, 502, 623, 47808 Guardian AST 10001 10001 IPMI N/A 623 Kampstrup Smart Meter N/A 1025, 50100 C. Scan Data Discussion A very interesting finding in the Nmap scan data is that while the Guardian AST, Kampstrup, and IPMI devices all denied pings, the Siemens SIAMATIC S7-200 did not. When removing the ping option for the result set in Table III, the results were more comprehensive and revealing. In every scan result, port 22 was shown as open, which would be the case due to utilizing SSH to gain access to each honeypot via a terminal in Putty. When comparing what should have been seen as open ports for each respective template within Conpot to the results from Table III, Nmap failed to identify the following ports as open on their respective devices: Siemens S7-200: 102, 161, 502, 623, 47808 IPMI: 623 Kampstrup Smart Meter: 50100 However, these ports may not have been found due to not being part of the top 1,000 which Nmap commonly scans without being directed to scan each and every port. To that point, Nmap was eventually set to scan each and every port (Table IV). After scanning all ports, some ports that should have been open were still not found. The results are as follows for ports which were not found: Siemens S7-200: 161, 623, 47808 IPMI: 623 This requires further research. In the case of the Siemens device, SHODAN found port 161 and captured a banner from it, while Nmap did not detect it. What was more surprising during the full comprehensive scan was the large number of open ports that were not expected to be open at all within Table V. Due to the large variety of ports that were discovered to be open, the vanilla install of the Ubuntu image was deployed without running any Conpot template. Based on a scan of the vanilla Ubuntu, it appears that more ports were being opened than would be originally anticipated when running any given Conpot template. Further analysis will need to be conducted to determine which extra ports being opened might be indicative of a honeypot instead of an effective emulation. The results from the SHODAN scan were also very insightful in that they more accurately showed the Conpot instances as being SCADA devices . This is primarily because SHODAN focuses its scan results on a much smaller port set, which resulted in the results not showing the large number of open ports that were shown in the all-port scan of Nmap. The most intriguing finding here, as previously mentioned, is that SHODAN found port 161 open on the Siemens device, while Nmap did not. The banner grabbed by SHODAN also showed that the device was a Siemen s SIAMATIC S7-200 device. These findings may show that Nmap is indeed not fully effective in determining ports that are actually open. Unfortunately, at the time of this writing, SHODAN had not discovered the IPMI and Kampstrup devices, so a comparison of the SHODAN results of these devices with the Nmap port scans was not available. Additional future work includes evaluating the SCADA Honeynet Honeypot, analyzing SCADA honeypot attacks, and evaluating log analysis tools. Another future task, cloaking Honeypot signatures that could differentiate them from real SCADA devices then evaluating attack differentials, could help determine if honeypots are being identified. In conclusion, the devices accurately depicted SCADA ports, but appeared to have additional ports open that could reveal their identity as honeypots to sophisticated attackers. R EFERENCES [1] S. Wade. SCADA Honeynets: Th e attractiveness of honeypots as critical infrastructure security tools for the detection and analysis of advanced threats. Graduate Theses and Dissertations, Iowa State University, USA, 2011. [2] A. Serbanescu, S. Obermeir, and De r-Yeuan Yu. ICS Threat Analysis Using a Large-Scale Honeynet, in Proceedings of the 3rd International Symposium for ICS & SCADA Cyber Security Research 2015, 2015, 1-30. [3] D. Buza, F. Juhasz, and G. Miru. D esign and implementation of critical infrastructure protection system, Budapest University of Technology and Economics, Department of Netw orked Systems and Services, 2013. [4] D. Fronimos, E. Magkos, and V. Chrissikopoulos. Evaluating Low Interaction Honeypots and On their Use against Advanced Persistent Threats, in PCI '14, Proceedings of the 18th Panhellenic Conference on Informatics, Athens, Gr eece, October 2-4, 2014. 198 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:41:48 UTC from IEEE Xplore. Restrictions apply. |
Modeling_of_Cyber_Attacks_and_a_Time_Guard_Detection_for_ICS_based_on_Discrete_Event_Systems.txt | Due to the rapid increase in digitalization and networking of systems, especially in industrial environments, the number of cyber-physical systems is increasing and thus the danger of possible attacks on such systems. As demonstrated in several recent examples, a cyber attack on an industrial control system (ICS) can have catastrophic consequences for humans and machines. This is due to the communication networks between programmable logic controllers (PLC), actuators and sensors, which are usually vulnerable to attacks, as well as various processes or devices that are not suf ciently protected. In this paper, two possible attacks on a discrete event system (DES) are introduced, in which a running process, controlled by a PLC, is manipulated without being detected. Furthermore, a detection method for such attacks is presented. | Modeling of Cyber Attacks and a Time Guard Detection for ICS based on Discrete Event Systems Raphael Fritz, Patrick Schwarz, Ping Zhang I. INTRODUCTION The expansion and networking of systems in the context of Industry 4.0 and the Internet of Things is a top priority for many companies. This makes the security of IT systems more important than ever. Cyber attacks on an industrial control system (ICS) represent a real risk as ICS become more integrated into other systems. The communication between controllers and plants is increasingly being done over a network. These are potentially vulnerable to cyber attacks. The focus of this paper is the security of ICS. In particular, PLC level and process level are considered here. Many approaches consider supervisory control and data acquisition (SCADA) systems. In the context of supervisory control of discrete event systems and the detection of cyber attacks only a few approaches can be found in the literature ([1] [8]). [1] proposed a robust supervisor for attacks, in which an attacker can control the actuators to perform undesirable behavior. The supervisor ful lls its tasks in nominal operation mode and under attack. [2] proposes a method based on fault- tolerant control for a system with partially vulnerable sensors and actuators. After the detection all controllable actuators are disabled so that the system never enters an unsafe state. A similar approach is proposed in [3], where a security module determines the attacked communication channels but only the necessary actuators are deactivated. In [4], different from other approaches, no attack detection is used. Based on prior knowledge about the attack models, a robust supervisor is designed. In [5] an attack capability is presented in which an attacker can manipulate the sensor signals. In addition, a robust supervisor is designed against these attacks. [6] and [7] investigate the design of stealthy attack strategies. The authors are with Institute of Automatic Control, University of Kaiserslautern, Erwin-Schroedinger Str. 12, 67653 Kaiserslautern, Germany fritzr@eit.uni-kl.de; patrick-schwarz@gmx.de; pzhang@eit.uni-kl.deA major problem of many existing detection algorithms for discrete event systems is the fact that only the supervisory control layer is considered and the assumption that a potential attacker can only manipulate part of the sensor and actuator signals. In a realistic scenario, once an attacker has intruded in a network, it can be assumed that they have full access to all information transmitted over the network. Accurate and error-free production processes are of great importance in the industry. Even a slight change in the process can lead to considerable damage. Through targeted manipulation of the ICS, the execution of individual work steps can be performed incorrectly or not performed at all. As will be shown later in the two attack scenarios, it is possible to inject false information or perform additional malicious actions. Such manipulations usually result in a logical and temporal change of the production process. In a previous study, the authors presented the modeling of two deception attacks, the replay attack and the covert attack, on Cyber-Physical Systems with controllers based on signal interpreted Petri nets (SIPN) [8]. Furthermore, an attack detection scheme based on permutation of the transmitted signals was proposed. In comparison to [8], the approach proposed in this paper does not require an active component in the control loop, since the time guard detection scheme only passively monitors the communication. Also only an identi cation of the time guards is required here and the Petri net structure of the detection unit can be directly adopted from the SIPN controller, while [8] required an identi cation of the closed-loop behavior of the system for the detection. This paper introduces the detection method called time guard detection. The considered attacks can hide manipula- tions on the logical level of the PLC, but are visible and detectable on the temporal level. The main contributions are: Attack models for two deception attacks on ICS modeled as SIPN are proposed. The cyber attacks are false data injection and malicious action injection. A detection method called time guard detection is proposed. The method allows detection of targeted manipulations on the ICS, which results in a temporal change of the production process. The application of the time guard detection is possible for systems where all sensors and actuator channels or only part of them are vulnerable to attacks, i.e. can be observed and changed. II. PRELIMINARIES This section provides the necessary notations and de ni- tions that will be used later based [9] and [10].2019 18th European Control Conference (ECC) Napoli, Italy, June 25-28, 2019 978-3-907144-00-8 2019 EUCA 4368 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. A Petri net can be represented by the four-tuple PN= (P;T;N+;N ), with a set of mplaces P=fp1;p2;:::; pmg and a set of ntransition T=ft1;t2;:::;tng. The post-incidence matrix N+(pre-incidence matrix N ) specify the arcs and their weights from transitions to places (from places to transitions). The (mn)matrix N=N+ N is the incidence matrix describing the system behavior and N(;t)is the column corresponding to a t2T. The set of pre places of a transition t2Tist=fp2PjN (p;t)>0gand the set of post places is t=fp2PjN+(p;t)>0gwithjtjandjtjas the number of pre places and post places. A transition t2Tcan re at marking M(k), only if the enabling condition N q(k)M(k)is ful lled. Transition tis represented by the n-dimensional ring vector q(k) =q1(k)q2(k) qjTj(k)T, whose j-th entry qj(k)is1, while all other entries are 0. The new marking M(k+1), resulting from ring t2Tat time instant kis determined by the Petri net state equation M(k+1) =M(k)+Nq(k). A Signal interpreted Petri Net (SIPN) is described by SIPN = (PN;M0;I;O;j;w;W)with PNas an ordinary Petri net, I=Oas a set of binary input/output signals, jas a mapping associating every transition t2Twith a ring condition j(t) =boolean function in I,was a mapping associating every place p2Pwith an output w(p)2f0;1; g, where (-) denotes don t care and Was the output matrix. The extended ring rules for SIPNs are [9]: 1)At2Tis enabled, if all its pre places are marked and all its post places are unmarked. 2)At2T res immediately, if it is enabled and j(t) =1. 3) All reable transitions re simultaneously. 4) The ring process is iterated until a stable marking is reached, i.e. until no transition can re anymore. 5)After a stable marking is reached, the output signals are recalculated by applying Wto the marking. The output matrix Wis ajOjmmatrix wherejOjis the number of output signals and Y(k)as the resulting output signal combination. The SIPN behavior can be described by M(k+1) =M(k)+Nq(k) Y(k) =WM(k)(1) with q(k)determined by the ring rules shown above. In order to allow a time delay of the ring condition j(t) for every transition t2T, the SIPN must be extended and can be described by the time-based SIPN = (SIPN ; )with as a set of individual time values for each transition t2T, which describes the minimum time one of the pre placest must be marked ( 9p2t>0) before transition t can re. This results in the change of ring rule 1): 1)A transition t2Tis enabled, if all its pre places are marked after the corresponding time value of and all its post places are unmarked. The time of this transition is started if at least one of its pre places is marked. Through the use of input and output signals, SIPNs have a strong relationship to industrial languages according to the IEC 61131-3 standard and can thus be used in ICS. For further information on SIPN see [9]. NetworkPlant Attacker PLCIc OcI O Ia Oa Fig. 1: Structure of the attack model III. ATTACK MODEL We consider an ICS consisting of a plant and a PLC connected via network. All inputs and outputs are transmitted over this network. The sensor signals of the system are described by the input vector I= (I1:::Ir)Tand the actuator signals are described by the output vector O= (O1:::Os)T. The PLC controls the actuators of the plant based on the sensor data and is represented by SIPN c. The attacker pursues an attack goal and is represented by SIPN a. Subscript c denotes the controller and subscript adenotes the attacker. We assume that the network connection is unsafe and the attacker has read and write access to the data transmitted over the network. Furthermore, it is assumed that the attacker has extensive knowledge about the PLC and the process ow. By reading access of the input and output signals, the controller may be identi ed and with a state estimation, the current marking of the SIPN cmay be obtained by the attacker. The general model of the attacked system is shown in Fig. 1. The attack vectors are denoted by IaandOa. The input and output vectors of the system without attack are O=OcandIc=I. The manipulation of the attacker can be described by two binary diagonal matrices GIandGO, where the entries on the diagonal are 1 if the corresponding signal is vulnerable and 0 if it is not vulnerable. In general, during an attack the input vector Icof the PLC and the output vector Othat is transferred to the actuators can be described by Ic=GIIa+(Fr GI)I;O=GOOa+(Fs GO)Oc(2) withFr=Fsas identify matrices with dimension (rr)=(ss). If all sensors and actuator channels are vulnerable to attacks, GI=Fr,GO=Fsand (2) can be simpli ed to Ic=Ia;O=Oa. Due to the complexity of large production systems, it is more dif cult for the attacker to hide the manipulation. In this case, the attacker can choose to only manipulate part of I/Os at the same time to guarantee his invisibility, even if he has access to all I/Os. This means that very often only a speci c subsystem is attacked. In the following, the two attack scenarios, false data injection and malicious action injection, are presented. A. False Data Injection In false data injection attacks, the goal of an attacker is to manipulate the sensor measurements to induce a change in the state variables without being detected. In [11], two attack types are considered, called random false data injection and4369 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. PLC Attacker Network 1 2 3 4 4 3 2 1 1 2 3 4 4 3 2 1 1 3 2 1 2 3 3 2 1 2 1 3 Fig. 2: SIPN model of False Data Injection targeted false data injection . Inrandom false data injection , the attacker tries to nd an attack vector (i.e. input vector) that injects arbitrary errors into the state variables. In targeted false data injection , the attacker has an attack goal and tries to nd a vector that injects speci c error behavior into the speci c state variables chosen by him, without being detected. In this section a targeted false data injection attack for DES modeled by SIPN is considered. With read access to the network, the attacker can track the behavior of the controller SIPN c. Now, in speci c markings chosen by the attacker, false data is injected into the input vector Ic. This is illustrated by an example in Fig. 2. The attacker starts observing the I/Os. As soon as the attacker has tracked the vector combination j1andw2, the transition ta1 res and the attack starts. With wa2the attacker injects false data in the input vector Icof the controller. The ring condition of transition t2is satis ed e.g. too early. The attacker could also maintain a certain signal combination for a longer time to achieve a delayed ring of this transition. The individual transitions of the attacker may have a time delay as an additional ring condition. After reaching the attack goal, the attacker returns to his idle state pa1with ta3 and waits again for the speci c I/O vector combination. In summary, by injecting false data in the input vector Ic, individual processes are executed longer or shorter. In addition, the attacker can also create unstable cycles, which completely skip some markings. In order to preserve the invisibility, the attack can only be used in certain parts of a process in which a targeted injection of false data does not affect the program execution on the logical level. Thus, the controller must be able to continue running normally after reaching the attack goal. From the PLC s point of view, this attack has no in uence on the process ow and thus can not be detected directly via the I/Os. The weak point of this attack is by injection of false data in the input vector Ic, the temporal behavior of the process ow changes and on the time level the attacker loses the invisibility and can be detected. B. Malicious Action Injection The malicious action injection attack uses the basic idea of a covert attack, described in [12] and [13], to change the PLC Attacker 1 2 3 4 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 Network 1 1 2 3 2 3 Plant Fig. 3: SIPN model of Malicious Action Injection actuator signals to achieve an attack goal and to hide the in uence of the attack on the sensor signals. In general, it is the goal of the attacker to perform additional or malicious actions during the runtime of the process without changing the program logic and preserving the invisibility on the logical level. This attack requires full access to the input and output signals and extensive knowledge about the program logic of the PLC, which is assumed as a normal SIPN. This attack is modeled as a normal (non time-based) SIPN and is represented by SIPN awith the behavior described by Ma(k+1) =Ma(k)+Naqa(k) Ya(k) =WaMa(k)(3) The attack consists of two separate phases: Phase 1 Synchronization: In this phase, the attacker synchronizes with the PLC by determining the ac- tive marking of SIPN cbased on the I/Os. Before the attack, i.e. k<k0with k0as the start time of the attack, the vectors can be assumed to Ic(k)=I(k), O(k)=Oc(k),Ia(k)=0andOa(k)=0. As soon as SIPN a has synchronized with SIPN cand the PLC has reached M(k)=Ma(k0), the attack is started. Phase 2 Attack: In this phase, the planned attack goal is executed for the period k0kka, where kade nes the end time of the attack. During the attack the I/O vectors can be assumed to Ic(k)=Ia(k)andO(k)=Oa(k). In speci c markings the attacker suppresses certain input signals and thus prevents the following transitions from becoming active. Therefore the vector Iacan be assumed to Ia(k)=I(k0 1)during the attack. Now some malicious actions will be executed. Once the attack goal is reached ( k=ka), the previously blocked transitions will be released and the process continues to run normally. Malicious action injection attacks are highly sophisticated and pose a serious threat to ICS. The attacks are particularly dangerous because they are not active all the time. They wait until the controller has reached a certain point in the program and then they become active. Some malicious actions are performed and then the attacker is inactive again. This is illustrated in an example in Figure 3.4370 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. After synchronization, the attacker waits for the controller to reach the place p2. Subsequently, the attack is started. The attack phase is represented by the places pa1,pa2andpa3and the transitions ta1,ta2andta3. During the entire duration of the attack, the input vector of the controller is Ic(k) =I(k0 1) fork0kka. Thus, the attacker prevents the transition t2from becoming active. For the ring condition ja1,ja2 andja3, the input vector I(k)of the physical plant is used. With the outputs of the markings pa1,pa2andpa3, the output vector Oais set. This is transmitted to the plant and can be assumed to O(k) =Oa(k). After the attacker has reached the place pa3, the transition t2is released again and Ic(k) =I(k). As soon as the ring condition j2is ful lled, the attack is terminated and the normal process continues. Similar to the false data injection, the malicious action injection attack is completely stealthy on the logical level and can not be detected there. Although the plant executes additional actions during this attack, the de ned process ow in the PLC is not affected. Only on the time level the attacker loses the invisibility and can be detected. C. Loss of invisibility of attack on time level The attacker considered in this paper attacks the local network of the plant from outside, i.e. over the internet or from the cloud. That means the attacker has the problem of network delay and latency variation [14] depending on the distance to the attacked plant. This delay inhibits the correct identi cation of the time information of the system, while still allowing the correct identi cation on the logical level. During the attack phase, the attacker again has the problem of network delay. It is reasonable to assume that the attacker can not perfectly hide his attack on the time level. In a former study [15], an experimental setup with a Soft- PLC in the cloud (software PLC running on Amazon Elastic Compute Cloud) that communicates with an I/O interface at a laboratory system (in our case the S7-300 PLC from Siemens, see Section V) was examined. The resulting network delays ranged from 5ms to 4.59s. Thus the attack detection based on the time level is a realistic approach. IV. ATTACK DETECTION With the two attack scenario described above, a detection method called time guard detection can now be designed to exploit the weak point of these attacks. For the basic idea for this attack detection, we have been inspired by the approach of the fault detection and isolation based on timed automata described in [16]. There, an identi cation algorithm was used to determine a timed automaton model of the closed-loop system for fault diagnosis. Especially the timed model of a DES, which is de ned as a timed automaton with guards described in [17], can be used for the detection of cyber attacks instead of faults. This basic idea is adapted and used for the attack detection in DES based on SIPN. For the purpose of time guard detection, a new SIPN is de ned, i.e. SIPN d= (PN;M0;I;j;C; ;TG)with PN,M0,Iandjas de ned in Section II Cas a set of clocks. as a mapping associating every transition t2Twith timing information (t)2f min; max; timeoutg TGas a set of time guards. Symbols with subscript dare associated with the time guard detection. Since this detection method is related to the events and actions of SIPN cand to the timing information of the real plant, the basic structure of SIPN dis inherited from SIPN c, i.e.PN,M0,Iandjof SIPN dare identical to SIPN c. The set Cwith cardinalityjCj=jTjcontains as many clocks as transitions. The function g:T!Cassigns a clock c2Cto a transition t2T, where g(t)addresses the clock cof the transition t. A clock interpretation fis de ned as f:C!R+, where f(c)represents the time value of the clock c. The starting condition of a clock c2Cis de ned as 9p2t>0 (4) which means that the clock cis started as soon as at least one pre place of tis marked. The set TG contains boolean conditions expressed as function of clocks. A time guard y2TGis denoted as y(t) = ( f(g(t)) (t)min)^(f(g(t)) (t)max)(5) where y(t) =True means that the thas red within the time interval and y(t) =False means that thas red too early or too late. The evaluation of the timing information by yis started by the condition (8p2t=1)^(8p2t=0)^(j(t) =True) (6) which means that the clock cis stopped and the timing information is evaluated by (5)as soon as all pre places are marked, all post places are unmarked and the ring condition j(t)of transition tis ful lled. The condition of whether an attack has occurred can be formulated as y(t) =True)nominal y(t) =False)attacked(7) Algorithm 1 represents the time guard detection algorithm that can be used for attack detection in ICS. This algorithm is event triggered and is called with every change in the input vector Ic. To switch the detection on during runtime of the PLC, SIPN cand SIPN dmust be synchronized. For this, SIPN c must reach a certain marking, e.g. the inital marking M0. As soon as the synchronization is completed, the clock g(t)is started once for all transitions Tinit=ft2Tj9p2t0>0g. A boolean variable stable is de ned, which is set to True before processing the transitions and checking condition (6). For each transition t2Twhich ful lls condition (6), the following steps are performed: The clock g(t)is stopped. The time guard y(t)is evaluated by (5). Considering (7), an alarm counter is incremented by 1. All pre places and post places of tare updated. The clock g(t)is reset. The boolean variable stable is set to False . Afterwards, the clocks g(t)of all following transitions Tnext=ft2Tj9p2t0>0gare started. This process is4371 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. Algorithm 1: Time Guard Detection (event triggered) Input: New observed input vector Ic stable :=False ,AlarmCounter :=0 while stable =False do stable :=True Tactive :=ft2Tj((8p2t=1)^(8p2t=0) ^(j(t) =True)) = Trueg foreach t2Tactive do stop g(t) evaluate y(t)with (5) ify(t) =False then AlarmCounter :=AlarmCounter +1 8p2t:=0 ,8p2t:=1 reset g(t),stable :=False Tnext:=ft2Tj9p2t>0g foreach t2Tnextdostart g(t) ifAlarmCounter >0then DetectionAlarm :=True return DetectionAlarm Algorithm 2: Timeout alarm function (time triggered) TGtimeout :=ft2Tjf(g(t)) (t)timeoutg ifjTGtimeoutj>0then TOalarm :=True elseTOalarm :=False return Timeout alarm TOalarm repeated until a stable marking has been reached, i.e. stable = True .(6)ensures that the time of each red transition is evaluated, even if it is contained in an unstable cycle. At the end, DetectionAlarm is set to True ifAlarmCounter >0. Here, a detection alarm is activated if one time deviation occurs. This can result in a high false alarm rate. Thus, several of these time deviations are required to activate a detection alarm, then the last condition of Algorithm 1 must be adapted and extended by a residuum, i.e. (AlarmCounter >s)with sas the number of allowed time deviations. Algorithm 1 detects attacks based on the ring timing of the transitions. If an attacker blocks the ring of the transitions as shown in Section III for a longer time, Algorithm 1 will not detect the attack. In order to preserve the functionality of the attack detection, a third time timeout is introduced. Time timeout represents the maximum upper limit of the time value f(g(t)). Iftdoes not re within the given time, the following condition is true q(t) = ( f(g(t)) (t)timeout ) (8) Based on (8), Algorithm 2 checks if a t2Thas exceeded its time limit and returns a corresponding timeout alarm. Algorithm 2 is time triggered and thus independent from the ring of transitions. Remark 1: The times min, maxand timeout can be deter- mined from expert knowledge, from the records of a fault-free process ow or with identi cation methods [16]. V. EXPERIMENTAL SET-UP To analyze the effectiveness of both attacks and the time guard detection under real conditions, a lab system is used. Feeder Drilling station Horizontal milling stationStorage Vertical milling stationFig. 4: Lab system TABLE I: I/O of feeder, drill and vertical mill Input Description Output Description I0:6 feeder ready O0:5 feeder signal I0:7 feeder empty O0:6 feeder motor I1:2 top position O1:2 motor up I1:3 bottom position O1:3 motor down I1:4 workpiece at entrance O1:4 drilling motor I1:5 workpiece in position O1:5 conveyor on I2:2 top position O2:2 motor up I2:3 bottom position O2:3 motor down I2:4 workpiece at entrance O2:4 milling motor I2:5 workpiece in position O2:5 conveyor on I2:6 tool in position O2:6 tool change motor The system is shown in Figure 4, which was also used in [8] and [18]. The Plant is connected via 17 inputs and 17 outputs with the PLC, which are shown in Table I (I/Os of horizontal milling station are omitted due to space constraints). A production cycle includes the treatment of one or more workpieces. Each workpiece is drilled two times, processed with each of the three tools of the vertical mill (VMill), milled by the horizontal mill and nally transported to the storage. The controller has a total of 63 places and 85 transitions. A. False Data Injection We now assume the system is being attacked by a false data injection attack with the goal to terminate the drilling process early. For this scenario, Figure 2 can be considered. In this attack, only the I/Os of the drilling station are considered. The input vector can thus be described by I=Ic=Ia= [I0:6I0:7I1:2I1:3I1:4I1:5]Tand the output vector by O=Oc=Oa= [O0:5O0:6O1:2O1:3O1:4O1:5]T. The attacker looks for the input vector I= [1 0 1 0 0 1 ]T and the output vector Oc= [0 0 0 1 1 0 ]T, i.e. the workpiece is in position and the processing begins. As soon as this vector combination is tracked, the ring condition ja1is ful lled and the attack is started. The normal drilling process is completed as soon as the bottom position has been reached, i.e I1:3=1. This normally takes about 2.7s and the drill is moved up again afterwards. After 1.5s, the attacker injects vector Ic= [1 0 0 1 0 1 ]Twith wa2, which satis es this condition. At this time the drilling is not completed and the workpiece was processed incorrectly. In this example, the complete input vector Icwas manipulated. However, only the two inputs I1:2andI1:3were required for the attack. All other signals were not manipulated. As soon the attacker tracked the output vector Oc= [0 0 1 0 1 0 ]T,ta2 res and pa3becomes active. Now, the attacker has reached the attack goal and after a time- delayed ring of transition ta3the attacker returns to the initial marking pa1. The attacker waits again for the speci c I/O vector combination to start the next attack.4372 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. 2={2.2 ;3 ;6 } ( ( 2))=1.5 ( ( 3))=2.1 3={1.8 ;2.5 ;5.5 } ( ( 1))=2.37 1={1.9 ;2.8 ;5.5 } 2 3 3 2 1 Fig. 5: Attack Detection B. Malicious Action Injection Next, we consider a malicious action injection attack on the tool change of the the VMill so that the workpiece is processed with the wrong tool. For this scenario, Figure 3 can be consid- ered. The I/O vectors are I=Ic=Ia=[I2:2I2:3I2:4I2:5I2:6]T andO=Oc=Oa=[O2:2O2:3O2:4O2:5O2:6]T. At rst we consider the tool change process without attack. It is started in p2. Here Oc= [0 0 0 0 1 ]Tis active. At this point there is still a tool in position ( I2:6=1). After the tool is no longer in position ( I2:6=0), the condition j2has been ful lled and p3is marked with Oc= [0 0 0 0 1 ]T. As soon as a new tool is in position ( I2:6=1), the condition j3is ful lled and p4is marked with Oc= [0 0 0 0 0 ]T. The tool change of the VMill is now completed. Now we assume an attack on the tool change process. The attacker will be active as soon as p2is marked. He will prevent the ring of transition t2during the complete attack with Ia= [1 0 0 1 1 ]T. The malicious actions of the attacker contain a modi ed tool change process. If these are additionally performed, then the wrong tool is used for processing the workpiece. In this example, the output vector of all three places of the attacker are identical ( Oa= [0 0 0 0 1 ]T). The ring conditions for the attacker SIPN are: ja1:I2:6=0, ja2:I2:6=1 and ja3:I2:6=0. As soon as pa3is marked and the condition of j2is ful lled, the attacker releases transition t2again and the process of VMill continues normally. In the end, the tool change process has been executed twice. C. Time Guard Detection Due to space constraints, we only present the time guard detection for the false data injection attack, which was described in Section V-A. The attacker injects a wrong input vector in transition t2to terminate the drilling process earlier. As a result, the condition f(g(t2)) (t2)minis not ful lled and the attacker can be detected. This is shown in Figure 5. The time value of the clock of transition t1has a value of 2:37seconds. This lies within 1:9sand2:8sand thus satis es condition (5)(y(t1) =1). For transition t2, however, a value of 1:5seconds was determined, which is below (t2)min=2:2s and can be detected by Algorithm 1. In the I/Os the attacks can hide their manipulation and therefore they are invisible. Only on the time level they lose their invisibility due to the nature of the attacks.VI. CONCLUSIONS In this paper the detection method called time guard detection has been presented. This is used to detect false data injection and malicious action injection attacks, which are modeled for ICS based on SIPN. Both are completely stealthy on the logical level of the PLC and cannot be detected. Only on the time level they can not hide their manipulations due to their nature and can be detected. For future research, we want to develop algorithms to differentiate between plant faults and cyber attacks. Another eld of research is the prevention and handling of cyber attacks, which is also of interest for legacy systems. REFERENCES [1]D. Thorsley and D. Teneketzis, Intrusion detection in controlled discrete event systems, in Proc. of the 45th IEEE Conference on Decision and Control , 2006, pp. 6047 6054. [2]L. Carvalho, Y .-C. Wu, R. Kwong, and S. Lafortune, Detection and mitigation of classes of attacks in supervisory control systems, Automatica , vol. 97, pp. 121 133, 2018. [3]P. Lima, L. Carvalho, and M. Moreira, Detectable and undetectable network attack security of cyber-physical systems, in Proc. of the 14th Workshop on Discrete Event Systems , vol. 51, no. 7, 2018, pp. 179 185. [4]R. Su, Supervisor synthesis to thwart cyber attack with bounded sensor reading alterations, Automatica , vol. 94, pp. 35 44, 2018. [5]M. Wakaiki, P. Tabuada, and J. P. Hespanha, Supervisory control of discrete-event systems under attacks, arXiv preprint arXiv:1701.00881 , 2017. [6]R. M. G oes, E. Kang, R. Kwong, and S. Lafortune, Stealthy deception attacks for cyber-physical systems, in Proc. of the 56th Annual Conference on Decision and Control , 2017, pp. 4224 4230. [7]Q. Zhang, Z. Li, C. Seatzu, and A. Giua, Stealthy attacks for partially- observed discrete event systems, in In Proc. of the 23rd International Conference on Emerging Technologies and Factory Automation , pp. 1161 1164. [8]R. Fritz and P. Zhang, Modeling and detection of cyber attacks on discrete event systems, in Proc. of the 14th Workshop on Discrete Event Systems , 2018, pp. 285 290. [9]G. Frey, Design and formal analysis of Petri net based logic control algorithms . Shaker, 2002. [10] T. Murata, Petri nets: Properties, analysis and applications, Proceed- ings of the IEEE , vol. 77, no. 4, pp. 541 580, 1989. [11] R. B. Bobba, K. M. Rogers, Q. Wang, H. Khurana, K. Nahrstedt, and T. J. Overbye, Detecting false data injection attacks on dc state estimation, in Preprints of the First Workshop on Secure Control Systems, CPSWEEK , vol. 2010, 2010. [12] A. Teixeira, I. Shames, H. Sandberg, and K. H. Johansson, A secure control framework for resource-limited adversaries, Automatica , vol. 51, pp. 135 148, 2015. [13] R. S. Smith, A decoupled feedback structure for covertly appropriating networked control systems, IFAC Proceedings Volumes , vol. 44, no. 1, pp. 90 95, 2011. [14] T. Hoiland-Jorgensen, B. Ahlgren, P. Hurtig, and P. Hurtig, Measuring latency variation in the internet, in Proc. of the 12th International on conference on emerging networking experiments and technologies , 2016, pp. 473 480. [15] T. Laubscher, Entwurf und Analyse einer Cloud-basierten Steuerung einer Fertigungslinie (Design and analysis of a cloud based control for a production plant), Diploma thesis, University of Kaiserslautern, Institute of Automatic Control, 2016. [16] S. Schneider, L. Litz, and M. Danancher, Timed residuals for fault detection and isolation in discrete event systems, in In Proc. of the 3rd International Workshop on Dependable Control of Discrete Systems (DCDS) , 2011, pp. 35 40. [17] C. G. Cassandras and S. Lafortune, Introduction to discrete event systems . Springer Science & Business Media, 2009. [18] M. Roth, J.-J. Lesage, and L. Litz, The concept of residuals for fault localization in discrete event systems, Control Engineering Practice , vol. 19, no. 9, pp. 978 988, 2011.4373 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:52 UTC from IEEE Xplore. Restrictions apply. |
You_Are_What_You_Attack_Breaking_the_Cryptographically_Protected_S7_Protocol.txt | S7 protocol de nes an appropriate format for ex- changing messages between SIMATIC S7 PLCs and their corre- sponding engineering software i.e., TIA Portal. Recently, Siemens has provided its newer PLC models and their proprietary S7 protocols with a very developed and sophisticated integrity check mechanism to protect them from various exploits e.g., replay attacks. This paper addresses exactly this point, and investigates the security of the most developed integrity check mechanism that the newest S7CommPlus protocol version implements. Our results showed that the latest S7 PLC models as well as their related protocols are still vulnerable. We found that adversaries can manipulate two hashes that play a signi cant role in gener- ating keys and bytes for the encryption processes implemented in the S7CommPlus protocol. This allows to reproduce S7 packets and conduct several attacks that eventually impact the operation of the target PLC and the entire physical process it controls. To validate our ndings, we test all the attack scenarios presented in this work on a cryptographically protected S7 PLC from the 1500 family which uses the S7CommPlusV3 protocol. | You Are What You Attack: Breaking the Cryptographically Protected S7 Protocol Wael Alsabbagh1,2and Peter Langend rfer1,2 1IHP Leibniz-Institut f r innovative Mikroelektronik, Frankfurt (Oder), Germany 2Brandenburg University of Technology Cottbus-Senftenberg, Cottbus, Germany E-mail: (Alsabbagh, Langendoerfer)@ihp-microelectronics.com Index Terms S7 Protocol, SIMATIC PLCs, Cyber Security, Industrial Control Systems; Replay Attacks; I.INTRODUCTION The S7 Protocol serves the exchange of critical information between Programmable Logic Controllers (PLCs) and their Total Integrated Automation (TIA) Portal engineering soft- ware. The exchanged messages include network con guration, critical data e.g., the control logic program, diagnostic infor- mation, set-point values, etc. between the connected parties. Its core communication follows a "client-server" pattern. Meaning that, the TIA Portal device (client) initiates transactions, and the connected PLC (server) responds by either supplying the requested data or executing certain actions. The newer generations of S7 PLCs i.e., S7-1200 and S7-1500 are pro- vided with a cryptographically protected S7 protocol, called S7CommPlus. This protocol is identi ed by a unique protocol ID (0x72 ) and has three sub-versions [1] as follows: - S7CommPlusV1: it is used by the older versions of TIA Portal and only in S7-1200 PLCs. This protocol does not include any integrity protection. - S7CommPlusV2: it is used in the TIA Portal up to V12 and its PLCs S7-1500 rmware up to 1.5. This protocol is integrity protected and has security features against replay attacks (e.g., Hashed-based Message Authentication Code- Secure Hash Algorithm-256 (HMAC-SHA-256)).- S7CommPlusV3: it is used in the newer versions of TIA Portal i.e., from V13 on, and in the newer S7-1500 PLC rmwares e.g., V1.8, 2.0, etc. This protocol requires that both the TIA Portal and the PLCs to support the features of this protocol. Here, Siemens has improved the integrity mechanism by providing their S7CommPlus protocol with very complex encryption processes. Therefore, it is considered the most secure protocol among the other versions i.e., S7CommPlusV1 and S7CommPlusV2, and it is the focus of our work. The integrity mechanism implemented in the newest PLC models and the S7CommPlusV3 protocol consists of three main parts : 1) a Challenge packet sent from the PLC to the TIA Portal, 2) a Response packet sent from the TIA Portal to the PLC, and nally 3) an Integrity Part in each S7 function packet sent from the TIA Portal to the PLC and vice versa [1] [4]. In this work, we show how an attacker could get suf cient information of the integrity mechanism, and disclose vulnerabilities that he can exploit to maliciously craft S7 Function packets that could be potentially used in replay attacks. To validate our ndings, we perform several attack scenarios on a real hardware SIMATIC S7-1512SP PLC with a rmware V2.9.2, and a TIA Portal software with a rmware V16. The attacks presented in this work include a simple start/stop, unauthorized software and hardware changes to the PLC program, removing the PLC program and Denial of Service (DoS) attacks. All our attack scenarios are network- based and designed with the help of pre-recorded packets that can be used after calculating speci c encryption bytes correctly as shown later. The rest of the paper is organized as follows. We compare our work with related ones in section II. Section III gives an overview of the S7CommPlusV3 protocol while its commu- nication process is illustrated in IV. Section V presents our attack approach, and we conclude this paper in Section VI. II.RELATED WORK There are only a few researches that discussed vulnera- bilities and security gaps in the S7CommPlus protocol. The rst ever work was published in 2016 when Spenneberg et al. [5] introduced a worm that found new vulnerabilities in the S7CommPlus protocol, precisely the S7CommPlusV2. The authors demonstrated a malicious code designed with the help of TIA Portal. The code was rst injected into an S7-1200 PLC. After patching the PLC, the worm automatically scanned 978-1-7281-9023-5/21/$31.00 2021 IEEE2023 IEEE 19th International Conference on Factory Communication Systems (WFCS) | 978-1-6654-6432-1/23/$31.00 2023 IEEE | DOI: 10.1109/WFCS57264.2023.10144251 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. the network and connected to other PLCs trying to download the binary code into them. The downside of Spenneberg ap- proach was that the infected PLC is always rebooted during the patch which could eventually pay the legitimate user attention. In 2017, Cheng et al. [4] investigated the new encryption method used in the S7CommPlus protocol. The authors used a reverse engineering technique to analyze the communication process between the PLC and TIA Portal. Afterwards, they presented a spear that can break the security wall of the S7CommPlus protocol that Siemens S7-1200 PLCs utilize. The authors performed two attacks. First they pushed crafted packets into the network to start and stop the PLC remotely. In the second attack scenario, the authors manipulated the input and output values of the victim causing a serious damage for the physical process. However, the work of Cheng lacks detailed information of how the integrity check mechanism works, how the encryption processes are calculated and which bytes can be manipulated by adversaries to conduct successful replay attacks. A research group in 2018, showed that a network based attack e.g., Address Resolution Protocol (ARP) poisoning is feasible in S7-1200 PLCs and their S7CommPlus protocol [6]. The authors found speci c 7 bytes, known as " S7- ACK ", can be exploited for a session stealing and DoS attacks. Biham et al. [1] investigated the security features of both S7CommPlusV2 and S7CommPlusV3 protocols used in both S7-1200 and S7-1500 PLCs. The authors disclosed serious security gaps in the S7CommPlus protocol and performed different exploits against cryptographically protected PLCs. In 2022, Alsabbagh et al. in [2], [3] investigated also the security of S7CommPlusV3 protocol and revealed a few security gaps in the design of this protocol e.g., one-way authentication method between the PLC and TIA Portal software allows attackers to connect to the victim PLC using a TIA Portal software without any efforts. Furthermore, the authors found that the PLC did not check the integrity of all packet attributes. Based on their ndings, the authors designed an injection tool, namely PLCinjector that allows attackers to establish a connection with a remote PLC and alter the program running in the device. All the aforementioned works [1] [4], [6] required from adversaries to have already a TIA Portal software installed on the attacker machines. In opposite, we in this work overcome this point by introducing typical replay attack scenarios based on pre-captured packets from old S7 sessions without the need to have a TIA Portal installed on the attacker s machine. Furthermore, our attacks are valid for all S7-1500 PLCs from the same rmware i.e., V2.9.2. III. S7C OMM PLUSV3 P ROTOCOL BACKGROUND The S7CommPlusV3 protocol supports various operations that are performed by the TIA Portal software such as start/stop the PLC, download/upload a control program to/from the PLC, read/write values of a control variable, etc [2]. All these operations are translated rst by the TIA Portal software to S7CommPlus packets, precisely S7 Function packets before they are transmitted to the PLC. Then, the PLC acts upon the messages it receives, executes the control operations, andresponds back to the TIA Portal accordingly. The messages are transmitted in context of a session, each has a session ID (chosen by the PLC) [2]. Since the S7CommPlus is a cryptographically-protected protocol, each new S7 session established using this protocol begins with a four-message handshake to select the cryptographic attributes of the session, including the protocol version and encryption keys [2]. After the handshake, all messages are integrity protected using a very complex integrity mechanism. A.Protocol Structure S7CommPlusV3 is a "request-response" protocol. Each message consists of a protocol Header ,Data and a Trailer as shown in gure 1. Fig. 1: The Structure of S7CommPlus Protocol The Header andTrailer have always the same structure including the following components: 1-byte Protocol version , 1-byte Protocol ID , and 2-byte DATA Length as shown in gure 2. Fig. 2: S7CommPlus Protocol: Header andTrailer have the same Structure The Protocol Data Unit (PDU) type determines the S7CommPlus protocol version i.e., V1, V2 or V3 for the value 0x01, 0x02, or 0x03 respectively. In case the PDU type has the value 0x01 or 0x02, this means there is no Integrity Part in the Data eld. In the opposite, an additional Integrity Part (see the red block in gure 3) is padded with the Data eld in case the PDU type is donated with 0x03 as shown in gure 3. In this work, we are only interested in studying the latest S7CommPlus version. Therefore from this point on, all the information provided throughout this paper is related to the S7CommPlusV3 protocol. The Data block is comprised of 14 bytes (see the green block in gure 3). Starting from the top, we see a 1-byte Opcode which identi es the purpose of the S7CommPlus packet e.g., 0x31 if the packet is a request, 0x32 if the packet is response or 0x33 if the packet is a noti cation. After the Opcode , we see a 2-byte eld that has a xed value of 0x0000 . Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. Fig. 3: S7CommPlusV3 protocol - Data eld Components Then, there is a 2-byte eld, called Function , which determines the functionality of the packet e.g., 0x04ca forCreateObject , 0x0542 forSetMultiVariable ,0x04f2 forSetVariable , etc. In the next eld we nd again a xed value of 0x0000 followed by a 2-byte eld representing the sequence number of the packet. The Session ID length is 4-byte and has always the format of0x000003xx . The xxin the Session ID is a combination of ObjectID and0x80 . Finally, we have the transport ag that is a 1-byte eld generated randomly without any use neither in the encryption nor in the authentication methods. The structure and content of the Setblock (see the blue block in gure 3) are related to the PDU type and Opcode . This block has many diverse types and is quite complex. For more details please see the S7comm Wireshark dissector plugin project1. B.Communication Process The TIA Portal and PLCs exchange four kinds of packets: S7Request ,Challenge ,Response , and Function packets, see gure 4. Fig. 4: S7CommPlus Communication Process 1https://sourceforge.net/projects/s7commwireshark/As can be seen, at the beginning of each new communica- tion session, the TIA Portal sends an S7 Request to establish a connection with the PLC. After the PLC receives the S7 Request , it sends a 20-byte array, namely Challenge , that signi cantly differs from a session to another. Those 20 bytes are generated by a hash or pseudo random function. After the TIA Portal receives the Challenge , it generates a Response that contains among many bytes three interesting blocks: "block 1" is 9-byte array, "block 2" is 8-byte array and "block 3" is 132-byte array, see gure 7. The PLC examines the integrity of those blocks and sends a Transmission Control Protocol (TCP) message as well as a reset ag if the content of the blocks are different to what the PLC expects to receive, in other respects, establishing the S7 session keeps on by sending an " OK" packet to the TIA Portal. Those bytes are generated by speci c algorithms illustrated in Section IV. Once the communication session is approved by the PLC, all the following packets exchanged between the TIA Portal and PLC are protected with anIntegrity Part related to the functions provided by the TIA Portal. In the next section, we investigate this communication process in more detail. IV.INVESTIGATING THE COMMUNICATION PROCESS In order to understand the encryption algorithms used in the S7CommPlusV3 protocol and explore possible exploits, we need rst to analyze the communication process between the TIA Portal and PLC. To this end, a manual analysis was conducted using helpful tools such as Scapy2and WinDbg3, and a number of different communication sessions. First, we open the TIA Portal and press on the " go online " button then capture all the packets and save them in a pcap le for a further analysis. To support our study, we use the WinDbg software that allows us to make several breakpoints during the communication session that is comprised of four packets 2https://scapy.net/ 3https://windbg.org/ Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. (see gure 4). In the following we present our analysis results for each packet in detail. A.S7 Request Packet The TIA Portal initializes a new session by sending a Request packet to the PLC. This packet has no encryption bytes, therefore an attacker can re-use this packet "as-is" without any appropriate adjustments. B.S7 Challenge Packet After the PLC receives the S7 Request from the TIA Portal, it responds by sending an S7 packet (we call it S7 Challenge ). Our investigation showed that this packet has a 20-byte array that varies signi cantly every time the TIA Portal sends a new Request i.e., every time the user presses on the "go online" button. This 20-byte array is called ServerSessionChallenge and located always in the 26th byte position of any S7 Challenge (as shown in gure 5). Fig. 5: S7 Challenge Packet - ServerSessionChallenge Array By further investigation and inserting several breakpoints at the memory address where this array is located, we found that only 16 bytes, precisely from byte 3 to byte 18 in the ServerSessionChallenge were copied and stored in another address. This nal 16 bytes block or as called challenge in [1] plays an important role in generating certain encryption bytes for the following S7 Response and the Function packets as illustrated later in the next Subsections (IV-C and IV-D). C.S7 Response Packet TheResponse packet is sent from the TIA Portal to the PLC as a response to the Challenge packet. It is quite complex and can be divided into several parts as shown in gure 7. 1)Encryption Bytes can be manipulated :Our investiga- tions to this packet showed that the Secure Hash Algorithm 256 (SHA-256) is utilized two times to generate two hashes. The inputs of the SHA-256 algorithm are generated randomly using the Application Programming Interface (API) cryptogra- phy functions, precisely the " CryptGenRandom " function, see gure 6. The two resulting hashes are then used as a part in generating speci c encryption bytes in the S7 Response packet. Figure 7 shows these bytes which are as follows: Block 1, 9-byte: located between the byte 91 and 99. Block 2, 8-byte: located between the byte 136 and 143. Block 3, 132-byte: located between the byte 168 and 299. This block is also divided into sub-blocks as follows: the rst 76-byte block of the 132-byte block (located between the byte 168 and 243), the "First Encryption" (16-byte located between the byte 244 and 259) and the "Second Encryption" (16-byte located between the byte 284 and 299). Since the three encryption blocks are generated based on the two hashes the SHA-256 introduces as outputs [1], adversaries can maliciously manipulate those blocks by manipulating the generation process of the two hashes. To this end, an attacker can use the WinDbg software to feed constant inputs to the hash function of the SHA-256 algorithm that will eventually result xed hashes rather than random ones when the "CryptGenRandom " function was used. For instance, when we feed the hash function with "0" values as inputs, the bytes representing the hashes generated by the SHA-256 algorithms remained constant in every session. This is a very serious vulnerability as an attacker can subsequently generate the three encryption blocks, craft the entire S7 Response packet and send it nally to the PLC without the need to have a TIA Portal software installed on his machine as [1] [3] assumed. Fig. 6: Generating Keys and Bytes for the First and Second Encryption One of the two hashes, precisely the " Hash 1 ", is used in a computation to generate two keys, each has 16 bytes length (we call them " Key 1 &Key 2 " for the rest of this paper). The resulting keys are then utilized in two symmetric-key encryption processes, precisely the Advanced Encryption Stan- dard (AES)-128 algorithm (called "First Encryption & Second Encryption" in [4]) as depicted in gure 8 and 9 respectively. Since the inputs of the two hashes can be manipulated, the two keys can be also manipulated by attackers. Consequently, both encryption processes in the S7 Response packet could be manipulated. In the following we explain in detail how an attacker can manipulate the "First" and "Second Encryption" processes. Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. Fig. 7: S7CommPlus Response Packet from TIA Portal to the PLC Fig. 8: First Encryption in the S7CommPlus Response Packet 2)First Encryption Process :Figure 8 depicts the "First Encryption" algorithm that the Response packet implements. As can be seen, the output of this encryption is placed between the byte 77 and byte 93 of the "block 3" (the 132-byte block in the S7 Response packet) and has a 16-byte length, see gure 7. Our analysis showed that the "First Encryption" process uses two inputs: 1) the bytes located between byte 61 and 76 (in the "block 3") as a plaintext, 2) an encryption key, precisely " Key 1". Afterwards, the output of the encryption process, which is a 16-byte block, will be XOR-ed with the 16-byte challenge array. The resulting output of the XOR operation is nally stored in a certain address before it is sent to the PLC. For all that, we can conclude that the "First Encryption" process is an XOR process of a xed 16-byte with the challenge array. Therefore, to manipulate this encryption, an attackeronly needs to manipulate the hashes used to generate the " Key 1" as mentioned earlier in IV-C1. 3)Second Encryption Process :The algorithm here is similar to the one used in the former encryption process ("First Encryption") i.e., AES-128, but it differs in that the plaintext in the "Second Encryption" is produced by a sophisticated algorithm that utilizes the 16-byte output of the "First En- cryption" as a part of the inputs in the "Second Encryption". Figure 9 depicts the complete algorithm used in this encryption process. As can be seen, the "Second Encryption" contains a four-stage "Plaintext Generation" fed with ve inputs which are as follows: 1) a value with 16 bytes length, 2) the "First En- cryption" output, 3) a 16-byte ciphertext, 4) a 8-byte ciphertext value diminished from another ciphertext and 5) a 4-byte value generated by counter and padded with "0". Our investigations showed that the two hashes, we already identi ed in IV-C1, are Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. Fig. 9: Second Encryption in the S7CommPlus Response Packet involved in the inputs of the "Second Encryption", except the 16-byte output of the "First Encryption". Furthermore, each stage of generating plaintexts is an XOR operation of two inputs and the result of each is fed as input to the next plaintext generation as depicted in gure 9. Once the last plaintext is produced, its value is then encrypted with the help of the " Key 2 " using a similar algorithm to the "First Encryption" algorithm. The output of the encryption algorithm is nally placed in the last 16 bytes of the "block 3" in the S7 Response packet, see gure 7. D.S7 Function Packet Once the encryption processes (in the Response packet) are calculated, the PLC approves the connection with the TIA Portal when everything is correct. Afterwards, S7 Function packets containing required data/operations will be sent from the TIA Portal (see Section III). Figure 10 shows one of these packets which contains control information. Fig. 10: S7 Function Packet from the TIA Portal Each Function packet contains a 32-byte encryption block called Integrity Part (as named in [4]) before the payload. Ouranalysis to the Integrity Part shows that this block is a Hash- based Message Authentication Code (HMAC) to examine the integrity of the Function packet. This examination aims at ensuring that the payload has not been maliciously modi ed, and authenticating the TIA Portal as the encryption keys used in the HMACs are only known by the connected parties in an ongoing S7 session. To calculate the Integrity Part block, two HMAC algorithms are called. The "First HMAC" is called to create an encryption key that is used in all further HMACs, while the "Second HMAC" is called to digitally ngerprint all the following Function packets. These two HMACs are designed based on the same hashing algorithm as follows. 1)First HMAC :The rst HMAC is called prior to sending the S7 Response packet from the TIA Portal to the PLC. The plaintext here consists of an 8-byte value (generated by a very speci c algorithm that is critical to the S7 integrity check [1]) and the 16-byte challenge array, see gure 11. The collective value is 24 bytes and digitally signed using an encryption key (also 24 bytes) produced with the help of the two hashes identi ed earlier in IV-C1. The output of the rst HMAC is a 32-byte value but it is diminished to only a 24-byte value that is eventually saved and utilized as an essential key in the "Second HMAC" computation. 2)Second HMAC :It is the actual algorithm that calculates the 32-byte Integrity Part . Please note that the length of the S7Function packet varies signi cantly based on the purpose of the packet. However, the HMAC output (32 bytes) starts always at byte 5 of any Function packet, see gure 11. The "Second HMAC" takes all the bytes after the 32-byte Integrity Part as an input i.e., starting from the byte 38, eliminating the packet s footer which is usually the last six bytes e.g., in the packet shown in gure 11 these six bytes are " 00 00 72 03 00 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. Fig. 11: Integrity Part Encryption Process 00" at the end of the packet). Since the length of each Function packet and its payload can vary, the footer also varies from aFunction packet to another. However, since attackers are familiar with the key generation process, a simple trail-error method could easily determine which bytes are used as input in the second HMAC computation. V.ATTACK SCENARIOS In Section IV, we analyzed the packets exchanged over the S7CommPlusV3 protocol and found that manipulating the inputs of the SHA-256 will result constant hashes which eventually allows attackers to generate the three encryption blocks in the Response packet, as well as the Integrity Part in the Function packet. This vulnerability is quite severe and exploiting cryptographically-protected PLCs is feasible. In the following, we present potential attacks can be conducted based on crafting S7 Function packets. All the crafted packets used to conduct our attacks were built and sent from the attacker machine to the PLC using the Scapy library. Please note that establishing an S7 session with the PLC is out of the scope of this paper and already illustrated in our former paper [2]. A.Unauthorized Start/Stop Attack To start/stop a PLC, The TIA Portal sends an S7 Function packet that implements a " SetVariable " attribute on the " Na- tiveObject.theCPUexeUnit_Rid " object, see gure 12. This packet contains a 32-byte Integrity Part ("Packet Di- gest" in gure 12) that is checked by the PLC, and only if this block is computed correctly, the PLC veri es the packet and then executes the Start/Stop command. For all this, the attacker needs to craft this S7 Function packet by maliciously generating the "Key 1 & Key 2", and computing the HMACs implemented in this block (as explained in Section IV-C and IV-D). Please note that the Integrity Part bytes can be correctly calculated. This holds true for any crafted packet due to thefact that the encryption keys and required bytes (see gure 6) will be always xed, since the attacker manipulates the two hashes by introducing "0" inputs to the SHA-256 algorithm. Fig. 12: Start/Stop S7CommPlus Function Packet B.Unauthorized Software Changes to the PLC Program The user chooses the "Software Changes" option in the TIA Portal to update (download) the PLC program into the PLC. Our experiments showed that it is possible to craft the S7Function packet containing the control logic program sent to the PLC. To this end, we open the TIA Portal software and create a completely new project. Then we program the main Organization Block (OB1) with a malicious program on our will. Afterwards we download this program to the PLC and capture the S7 Function packets that are in charge of the download process. By extracting the payload parts of the captured S7 Function packets i.e., the bytes after the Integrity Part until the last six bytes of the packet " 00 00 72 03 00 00", and using this payload in our crafted S7 Function packet, we can successfully update the program running in the PLC that will only check the Integrity Part block not the malicious payload. C.Removing the PLC Program This attack scenario is quite similar to the former one (V-B), but here the attacker aims at deleting the program (OB1 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. block) from the PLC s memory. An interesting fact is that the TIA Portal does not provide a "Delete" operation to the user. Therefore, the only way to delete the current program running in the target PLC is to replace the OB1 with an empty one. To do so, we create a new project in the TIA Portal, and leave the OB1 empty without any instructions. Then, we download the empty OB1 (using "Software Changes" operation) to the remote PLC. Meanwhile, we open the Wireshark and capture all the network packets exchanged between the parties which eventually contain the certain S7 Function packets the TIA Portal sends to download the empty OB1. Similar to the former attack scenario (V-B), by extracting the payload from the captured Function packets, and using this payload in our crafted S7 Function packet (after calculating a new Integrity Part and adjusting the sequence number as well as the response bytes appropriately), we can send the malicious S7 packets to the PLC which will replace the OB1 with an empty one, and the infected PLC will have no more instructions to execute. D.Unauthorized Hardware Changes to the PLC Program Attackers can maliciously alter the hardware con guration causing a non-con gured PLC state (unidenti ed station), and the TIA Portal software will not be able to establish a connection with the infected PLC. To conduct such an attack scenario, we rst create a new project on the TIA Portal, inserting a new device (PLC) to the project, and con gure the settings of this device different than the settings of the target PLC e.g., a different PLC rmware or IP address. After that, we save the project and download the new con guration to the connected CPU by utilizing the option "Hardware and Software (only changes)". Meanwhile, we capture the packets transferred between the stations and extract the S7 Function packets sent from the TIA Portal to make the required changes on the remote PLC. By using the payload of the captured pack- ets in new crafted packets, an attacker can make unauthorized hardware con guration to the PLC that will change its settings causing abnormal behaviors e.g., the PLC will not turn into run mode since it has a false con guration, or it has a new IP address so it will close all the connections with other devices and shows a synchronizing program message before the user attempts to download his own program. E.Denial of Service Knowing the encryption algorithms (i.e., "First Encryption", "Second Encryption" and HMACs) allows attackers to not only manipulate the operations provided via TIA Portal software but also to perform a DoS attack and to deprive the user of accessing the PLC. To this end, attackers can send crafted packets aiming at only establishing a new S7 session with the PLC, keeping this session alive "forever" by sending " S7- ACK " packets regularly as introduced in [2], [6]. This attack scenario is feasible due to two facts. First, S7 PLCs cannot initiate a new S7 session while there is already an ongoing session. Secondly, the " S7-ACK " packet lacks the 32-byte Integrity Part and can be reproduced "as-is" to keep an S7 session alive. Assuming that the TIA Portal is not connected tothe PLC, an attacker placed on the same network can establish a connection with the PLC [1] [3] and exchange Connection Oriented Transport Protocol (COTP) packets. After the PLC sends the Challenge packet, an attacker can respond with a crafted Response packet containing the appropriate encryption bytes, and right after that he follows his Response packet with endless-loop of S7-ACK packets. This will prevent any connection from the legitimate TIA Portal, and the attacker session will remain alive without the need of doing any further actions. Please note that the PLC will keep running the currently existing program, and it is not possible to make any software or hardware changes in the PLC. Therefore, a manual reboot is required to close the attacker session. VI. CONCLUSION AND FUTURE WORK This paper shows that the encryption processes used by the S7CommPlus protocol to protect the communication pro- cess are vulnerable. Motivated adversaries can maliciously introduce constant inputs e.g., "0" values to the SHA-256 algorithm that generates randomly the keys and bytes needed to calculate the three encryption blocks in S7 Response packets, and HMAC computations in S7 Function packets. Our experiments proved that attackers can craft their own S7Function packets and use them in replay attacks to cause several impacts on target PLCs. Based on our ndings, we managed successfully to perform a series of attacks against a real hardware cryptograpgically-protected PLC from 1500 family to validate our results. This work is done on an assumption that the target PLC is not password protected. In the future, we will try to solve this assumption by investigating the S7 authentication protocol that cryptographically protected PLCs use. We believe that such a protocol has also anti-replay mechanism and the password itself is also somehow encrypted. Thus, a further investigation is needed to cover this topic. REFERENCES [1] E. Biham, S. Bitan, A. Carmel, A. Dankner, U. Malin, and A. Wool, "Rogue7: Rogue engineering-station attacks on S7 simatic PLCs," in Black Hat USA, 2019, [Online]. Available: https://i.blackhat.com/USA- 19/Thursday/us-19-Bitan-Rogue7-Rogue-Engineering-Station-Attacks- On-S7-Simatic-PLCs-wp.pdf. [2] W. Alsabbagh and P. Langend erfer, "A New Injection Threat on S7- 1500 PLCs - Disrupting the Physical Process Of ine," in IEEE Open Journal of the Industrial Electronics Society, vol. 3, pp. 146-162, 2022, doi: 10.1109/OJIES.2022.3151528. [3] W. Alsabbagh and P. Langend rfer, "No Need to be Online to Attack - Exploiting S7-1500 PLCs by Time-Of-Day Block," 2022 XXVIII International Conference on Information, Communication and Automation Technologies (ICAT), 2022, pp. 1-8, doi: 10.1109/I- CAT54566.2022.9811147. [4] C. Lei, L. Donghong, and M. Liang, "The spear to break the security wall of S7CommPlus," in Black Hat USA, 2017, [Online], available: https://www.blackhat.com/docs/eu-17/materials/eu-17-Lei-The-Spear- To-Break%20-The-Security-Wall-Of-S7CommPlus-wp.pdf [5] A. Spenneberg, M. Br ggemann, and H. Schwartke, "PLC-blaster: A worm living solely in the PLC," in Black Hat Asia Marina Bay Sands, 2016, pp. 1 16. [6] H. Hui, K. McLaughlin, "Investigating current plc security issues regard- ing siemens s7 communications and TIA portal," in: 5th International Symposium for ICS & SCADA Cyber Security Research, 2018, pp. 67 73. Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:40:05 UTC from IEEE Xplore. Restrictions apply. |
Cyber_security_in_industrial_control_systems_Analysis_of_DoS_attacks_against_PLCs_and_the_insider_effect.txt | Industrial Control Systems (ICS) are vital for countries smart grids and critical infrastructures. In addition to the advantages such as controlling and monitoring geographically distributed structures, increasing productivity and efficiency, ICS have brought some security problems. Specific solutions are needed to be produced for these security issues. The most important information security component for ICS is availability and the most devastating threat to this component is Denial of Service (DoS) attack. For this reason, DoS attacks carried out on Programmable Logic Controllers (PLC), an important component of ICS, have been analyzed in the paper. In the test environment where attack scenarios were implemented, real PLC devices were used in order to get the most accurate results. The destructive effects of insiders, particularly in the case of cyber attacks against ICS, in bypassing the system security measure and discovery phase also emphasized in the paper. | 978-1-5386-4478-2/18/$31.00 2018 IEEE Cyber Security in Industrial Control Systems: Analysis of DoS Attacks against PLCs and the Insider Effect Ercan Nurcan Ylmaz, B nyamin Ciylan Gazi University, Faculty of Technology, Ankara, Turkey Serkan G nen Gazi University, Institute of Natural and Applied Sciences, Ankara Turkey Erhan Sindiren, G k e Karacay lmaz Gazi University, Institute of Informatics, Ankara, Turkey Index Terms -- Denial of service, indu strial control systems, insider attacks, PLC security, vulnerability analysis. I. INTRODUCTION Industrial Control Systems (ICS); are used in the management and maintenance of critical infrastructures, which are usually geographically distributed, such as gas, water, production, transportation and power distribution systems. Most of the ICS consist of several sub-components, such as Programmable Logic Controller (PLC), Human Machine Interface (HMI), Master Terminal Unit (MTU) and Remote Terminal Unit (RTU) [1]. However, in old generation ICS, private internal networks which were independent from the external networks were used for communication of these components. In order to control and monitor geographically distributed structure and to increase productivity and efficiency, Internet or intranet connection was required in ICS [2-4]. Along with this process, new vulnerabilities that could not be identified beforehand have emerged. These vulnerabilities are; Generally using open system source codes, Permitting remote access (VPN, etc.), Beyond security, ICS have a design that primarily focuses on the effectiveness of the system, such as critical timing needs, tight performance definitions, and task priorities, Not using security systems that should be used to protect ICS from other networks or from threats that may arise from the network because of commercial concerns, Not controlling privileged accounts of authorized IT staff, Not changing default usernames and passwords and therefore leaving backdoors, Using communication protocols developed for commercial purposes that security is not considered at all or rarely handled [5]. ICS are responsible for controlling and monitoring many critical infrastructures. For this reason, security vulnerabilities in systems under control, the entire infrastructure can become ICS cause these systems to become potential targets for attackers. If the attackers deactivate these systems, this may result not only in economic harm but also in the fact that citizens cannot receive important services in their lives [6]. Thus, it is crucial to analyze in depth to reveal existing vulnerabilities of components (PLC, HMI, RTU, MTU, etc.) and the protocols (ModBUS, Profinet, DNP3, etc.) used in ICS [7]. It will only be possible to take precautions against these vulnerabilities and prevent them from being exploited again by the attackers [8-10]. Vulnerabilities in ICS can cause intruders to infiltrate the network, gain access to control software, and lead to undesired major damages with changing the operating conditions of the system. DoS attacks are the types of attacks that can eventually be noticed by the vi ctims. However, it is important to detect these attacks as soon as possible, without hampering the use of services or creating a flood impact [11]. While DoS attacks seem often less dangerous than other attacks, they can become more dangerous in some cases for ICS and for critical infrastructures these systems manage. For example, in the event of preventing to close the gate of a dam in an urgent occasion or disabling the systems that control the temperature, such as in nuclear power plants, the denial of service attack can lead to major disasters. ICS are an integral component of the production and control process. The management of the majority of modern infrastructures is based on these systems. However, when they are evaluated in terms of cyber security, it is seen that the PLCs, which are important components of ICS, are in an open architecture to external networks and especially internet based constructions. Despite the security breaches in ICS, until recently, there has not been enough interest and study in the scientific area of the securi ty of PLC-managed automation systems. Only after the detection of Stuxnet malware in 2010, researches to identif y security vulnerabilities in PLC-based systems have begun to attract interest of PLC suppliers and users. Subsequent virus findings such as DuQu, Flame / sKyWIper, Night Dragon, Shamoon, Havex and Sandworm / Black Energy 2 also indicate the presence of an increasing tendency in critical infrastruc ture attacks. Despite these 2018 6th International Istanbul Smart Grids and Cities Congress and Fair (ICSG) 81 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:37 UTC from IEEE Xplore. Restrictions apply. events, security awareness of ICS environments is still not a top priority in many institutions [12]. Because the security objectives for ICS are based on accessibility, integrity and confidentiality, respectively [13,14]. In this context, the test environment (Testbed) was established to determine how to bypass the security precautions of the PLC, which is a significant component of ICS, by exploiting the security vulnerabilities of hybrid ICS protocols (Profinet-TCP/IP, etc.). In the test environment, the vulnerabilities of PLCs were evaluated through Denial of Service (DoS) attacks. Subsequently attacked packets were captured and analyzed in order to obtain the patterns of the attacks. Furthermore, the importance of managing privileged accounts for cyber attacks against ICS and the effects of insiders with these accounts were discussed. In this respect, it is aimed to rescue ICS from attacks with minimal damage and to prevent from similar attacks. Some of the studies on the security of ICS have focused on analysis based on simulation systems [14-17]. The weakest points of studies based on simulation systems are the difficulty of accurately projecting the real system and the possibility that the analyzes may not give the same results in the real system. Another part of the studies carri ed out within the scope of the security of ICS focus on confidentiality [18,19]. Solutions proposed above are usually based on cryptographic techniques. However, given the fact that today's ICS networks cover hundreds of installations with millions of equipment, the difficulty of implementing these solutions in practice can be better understood. II. T ESTBED In the majority of researches on the security of ICS, no implementation has been done to a real system. Thus, this study focuses on the detection of the vulnerabilities of the PLC device and TIA Portal app lication and the identification of the solution proposals by carrying out security analysis on a testbed where a real control system is involved. Figure 1. DoS attack reconnaissance, attack and detection steps for PLCs As shown in Fig. 1, the analysis of the DoS attack carried out on PLC and TIA Portal applications consist of three phases. At first phase, attacks were carried out and the effects on the system were evaluated. The second phase is the observation phase, which is based on the analysis of captured packets as a result of attacks. In the last stage, it was aimed to create patterns related to attack via intrusion detection systems for detecting similar attacks. The testbed consisted of one S-7 1200 (2.2 firmware) PLC hardware, one management computer on which remote command and control of the PLC was performed with TIA Portal management software, and a personal computer with Kali Linux operating system for implementing attacks. A separate computer with SmoothSec installed was used to detect the attacks. DoS attacks were carried out on PLCs and TIA Portal application in the network topology shown in Fig. 2 by using Hping, SmootSec IDS and Wireshark tools. Figure 2. Testbed network topology III. DENIAL OF SERVICE ATTACK (DOS) One of the important threat to ICS is Denial of Service attack. The aim of Denial of Service attack is to block the system to access to authorized resources or preventing to use these resources in its intended manner [20,21]. Figure 3. DoS attack reconnaissance, attack and detection phases 2018 6th International Istanbul Smart Grids and Cities Congress and Fair (ICSG) 82 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:37 UTC from IEEE Xplore. Restrictions apply. In the analysis of the attack, Service Denial attack was carried out first, and the changes in the system were examined. Subsequently the rule sets crea ted by analyzing the captured attack packets according to the ph ases indicated in Fig. 3 were entered into the Snort based library. Detecting attacks, the ultimate goal, was achieved through these rules. PLC protocols responds to all query packets from any IP / MAC address or node points and this situation is also another important vulnerability in PLCs. It is determined that DoS attack can be carried out su ccessfully even if it is in a different network as long as the IP address of the target is detected, because DoS attack is a kind of directly IP-oriented attack. Any port scan tool like Nmap tool can be used for detecting the IP address of a PLC. In this respect, DoS attack was carried out to the PROFINET port (102) which is used mostly by PLC devices for network communication. Hping program was used for DoS attack and as long as the attack continued, the ping response time of the PLC device increased considerably. When the DoS attack was stopped, the ping response time measured as 1212 ms as shown in Fig. 4. Figure 4. DoS attack effects on PLC The DoS attack was also carried out to the TIA Portal, the control computer. As long as the attack continued, ping response time increased from about 2ms to 5280 ms. Additionally, all of the control buttons of the TIA Portal became inactive and the PLC could not be controlled via the TIA Portal as shown in Fig. 5. Figure 5. TIA Portal management screen after DoS attack DoS attack packets carried out on PLC were detected as medium severity spam as shown in Fig. 6. Figure 6. Event packets detected after DoS attack Despite the attack was carried out with a few attacker computers, it was detected that network became ineffective. According to the delay standard of the IEEE 1646-2004 The Automation Communication of Substations, high-speed messages must be transmitted between 2 ms and 10 ms [22]. In this context, when the needs of instant reaction of PLC is considered, latency occurs in the network traffic of the control systems due to DoS attack may lead to significant problems. It is easy to detect IP address of attacker when DoS attack is carried out from a single source. However, it is more difficult to detect DoS attacks from different IP addresses by performing IP spoofing. Thus, attackers use IP spoofing method to hide the IP addresses and uses bogon IP adresses such as the attack scenario handled in this paper (Fig. 7). Figure 7. Source IP addresses of DDoS attack packets When the rule information of a listed event shown in Fig. 6 is examined, it can be understood that event packets are the distributed denial of service (DDoS) attack packets described in Fig. 8. Figure 8. The signature acquired after DoS attack 2018 6th International Istanbul Smart Grids and Cities Congress and Fair (ICSG) 83 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:37 UTC from IEEE Xplore. Restrictions apply. IV. ANALYSIS RESULT In the vulnerability analysis DoS attacks were carried out on PLC, one of the most important component of ICS, and results of attacks indicated that PLCs were vulnerable to these attacks. The detection phase of attack analysis results have shown that needed precautions for possible attacks can be taken by monitoring the PLC communication traffic continuously. Although, signature based prevention systems (antivirus, IPS, etc.) are believed to have a great success against the known cyber attack, they are not effective enough against new malicious payloads emerging in every second, especially the zero day vulnerabilities. For this reason, adjusting network traffic norms and thresholds with continuous monitoring provides constituting attack patterns for alerting network administrators / security experts. Thus, it will be possible to prevent malicious packets from infiltrating and harming the system, while ensuring that the legal packets are not delayed and prevented in the context of the continuity dimension of ICS. When the phases of the attacks in the testbed are examined, it is understood that the network topology and the determination of the target are vital factors for implementing successful attacks. However, in the event that the attacker is an insider within the organization and has privileged authorization over ICS systems, the success rate and destructive effects of the attack will increase. For this reason, it is very important to monitor the operations performed by employees with privileged authorization on ICS and to regulate their authority. V. I NSIDERS EFFECTS AND SOLUTION SUGGESTIONS Some studies investigating the causes of information security threats suggest that careless or malicious personnel with Access authorization are more hazardous and destructive than hackers, malicious software and troubled hardware [23,24]. In other studies, it is estimated that the abuse of privileged accounts is at high risk during insider attacks and this kind of attacks will increase in the coming period [25, 26]. Such risks are also prevalent for ICS and if the necessary security measures are not taken for insider threat, the effects for ICS will be much more devastating. Because, the detection and prevention of an at tack will be so difficu lt in the event that an insider has the knowledge of the network topology and components of the ICS. Protection from insider attacks requires specific solutions. However, when organizations' cyber security solutions are examined, it appears that most of them focus on external threats [27]. Security solutions to be used for internal and external threats should not be considered separately on the contrary they should be carried out in an integrated manner [28]. In order to prevent internal threats, not only technological solutions but also human factors should be evaluated. In addition to ordinary user accounts, ICS also has administrator accounts that are owned by IT staff with privileged authorization within the system. These accounts are mostly used for management, maintenance and repair of systems. One of the goals of the attackers to achieve their ultimate goal is the privileged accounts and their passwords used in the system. The seizure of one of these account's password by the attackers can cause the whole system to be seized. The Maroochy Water Service Breach incident, one of the attacks on ICS implemented by the insiders, was derived from the fact that the user account of a discarded employee was not removed from authorized accounts [29]. Ukrainian Power Grid Attack also was stemmed from careless and untrained users. Attackers gained privileged accounts from these users and causing about 225,000 people to be affected. Stuxnet is one of the most well-known target driven attack carried out on ICS. Although it is not known ex actly how this attack was carried out, majority of the rese archers think that the attackers got help from an insider for carrying out such a complicated attack. The main reason of this opinion is that ICS, the target of the attack, have an air gap structure isolated from the outside [30]. The control and management of privileged accounts, one of the most important causes of ICS attacks, is an important information security issue that needs to be assessed. Many measures and procedures have been proposed by researchers to solve this problem. Although the objectives of the solutions proposed by the researchers are the same, they involve different approaches [31-34]. A control mechanism should be developed on the basis of the issues discussed above to prevent exploitation of privileged accounts during insider attacks. The developed control mechanism should involve; Prevention unauthorized access to components of the ICS Increasing ICS resistance to password attacks Training and expanding awareness of staff on cyber security Regulation of access control to ICS components Keeping logs to follow up transactions performed by authorized personnel Clearly defining the limits of re sponsibility within the ICS Ensuring to include organizational managers in the IT security process. Figure 9. The position of control mechanism within ICS 2018 6th International Istanbul Smart Grids and Cities Congress and Fair (ICSG) 84 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:37 UTC from IEEE Xplore. Restrictions apply. The control mechanism to be established in accordance with the specified points should run integrated with ICS. The control mechanism must be located between the ICS and the authorized personnel as an additional layer of security in accessing the components of the ICS infrastructure (Fig. 9). VI. C ONCLUSION Many critical infrastructures managed by ICS do not have adequate security assessment against cyber attacks. These critical systems can face many threats, unless the security vulnerabilities of the ICS are determined and the necessary measures are taken to overcome them. In this context, critical ICS components need to be monitored in real time so that ICS, which significantly affect our social lives, can survive with minimal damage from potential cyber threats and can be activated as soon as possible. As a result of analysis, it has been seen that detection based solutions including continuous quality monitoring and behavior based testing are more effective than security measures based on preventing due to new malware emerging every second. Furthermore, organizations with critical infrastructure to prevent Insider attacks should develop and implement a control mechanis m for staff with privileged authority over ICS and other employees. The operations on ICS of all employees who are likely to become an insider should be monitored and recorded. It should not be forgotten that attacks aimed ICS may carry out not only from outside but also from a trusted staff with privileged account. R EFERENCES [1] H. Farhangi, "The path of the smart grid," IEEE Power and Energy Magazine, vol. 8, no. 1, pp. 18-28, Dec. 2010. [2] P. Motta Pires and L. H.g. Oliveira, "Security Aspects of SCADA and Corporate Network Interconnection: An Overview," in Proc. 2006 Int. Conf. on Dependability of Computer Systems , pp. 127-134. [3] V. M. Igure, S. A. Laughter, and R. D. Williams, "Security issues in SCADA networks," Computers & Security, vol. 25, no. 7, pp. 498-506, Oct. 2006. [4] M. Hentea, "Improving Security for SCADA Control Systems," Interdisciplinary Journal of Information, Knowledge, and Management, vol. 3, pp. 073-086, 2008. [5] S. Rautmare, "SCADA system security: Challenges and recommendations," in Proc. 2011 Annual IEEE India Conf. , pp. 1-4. [6] S. Clements and H. Kirkham, "Cyber-security considerations for the smart grid," in Proc. 2010 IEEE PES General Meeting , pp. 1-5. [7] R. E. Johnson, "Survey of SCADA security challenges and potential attack vectors," in Proc. 2010 Int. Conf. for Internet Technology and Secured Transactions , pp. 1-5. [8] A. Nicholson, S. Webber, S. Dyer, T. Patel, and H. Janicke, "SCADA security in the light of Cyber-Warfare," Comput. Secur., vol. 31, no. 4, pp. 418-436, June 2012. [9] G. P. H. Sandaruwan, P. S. Ranaweera, and V. A. Oleshchuk, "PLC security and critical infrastructure protection," in Proc. 2013 IEEE 8th Int. Conf. on Industrial and Information Systems , pp. 81-85. [10] M. Jensen, C. Sel, U. Franke, H. Holm, and L. Nordstr m, "Availability of a SCADA/OMS/DMS system - A case study," in Proc. 2010 IEEE PES Innovative Smart Grid Technologies Conf. Europe , pp. 1-8. [11] T. Peng, C. Leckie, and K. Ramamohanarao, "Survey of network-based defense mechanisms countering the DoS and DDoS problems," ACM Comput. Surv., vol. 39, no. 1, pp. 1-42, Apr. 2007 2007, Art. no. 3. [12] E. Byres, "Defense-In-Depth: Reliable Security To Thwart Cyber- Attacks," Pipeline & Gas Journal, vol. 241, no. 2, Feb. 2014. [13] D. Kushner, "The real story of stuxnet," IEEE Spectrum, vol. 50, no. 3, pp. 48-53, Mar. 2013. [14] E. Byres, D. Hoffman, and N. Kube, "On Shaky Ground A Study of Security Vulnerabilities in Control Protocols," in Proc. 2006 5th Int. Topical Meeting on Nuclear Plant Instrumentation, Controls, and Human Machine Interface Technology vol. 1, pp. 782-788. [15] A. Giani, G. Karsai, T. Roosta, A. Shah, B. Sinopoli, and J. Wiley, "A testbed for secure and robust SCADA systems," SIGBED Rev., vol. 5, no. 2, pp. 1-4, July 2008. [16] B. Genge, F. Graur, and P. Haller, "Experimental assessment of network design approaches for protecting industrial control systems," Int. Journal of Critical Infrastructure Protection, vol. 11, pp. 24-38, Dec. 2015. [17] N. Sayegh, A. Chehab, I. H. Elhajj, and A. Kayssi, "Internal security attacks on SCADA systems," in Proc. 2013 3rd Int. Conf. on Communications and Information Technology , pp. 22-27. [18] H. Li, R. Mao, L. Lai, and R. C. Qiu, "Compressed Meter Reading for Delay-Sensitive and Secure Load Report in Smart Grid," in Proc. 2010 First IEEE Int. Conf. on Smart Grid Communications , pp. 114-119. [19] E. Shi, A. Perrig, and L. V. Doorn, "BIND: a fine-grained attestation service for secure distributed systems," in Proc. 2005 IEEE S y mposium on Security and Privacy , pp. 154-168. [20] A. Silberschatz, P. B. Galvin, and G. Gagne, "Security," in Operating System Concepts , 9th ed., Hoboken, NJ: John Wiley & Sons, 2013, pp. 673-674. [21] P. Varalakshmi and S. T. Selvi, "Thwarting DDoS attacks in grid using information divergence," Future Generation Computer Systems, vol. 29, no. 1, pp. 429-441, Jan. 2013. [22] K. C. Budka, J. G. Deshpande, T. L. Doumi, M. Madden, and T. Mew, "Communication network architecture and design principles for smart grids," Bell Lab. Tech. J., vol. 15, no. 2, pp. 205-227, Sep. 2010. [23] J. Shropshire, M. Warkentin, and S. Sharma, "Personality, attitudes, and intentions: Predicting initial adoption of information security behavior," Computers & Security, vol. 49, pp. 177-191, Mar. 2015. [24] M. Leitner and S. Rinderle-Ma, "A systematic review on security in Process-Aware Information Systems-Constitution,challenges, and future directions," Inf. Softw. Technol., vol. 56, no. 3, pp. 273-293, Mar. 2014. [25] R. Pilling, "Global threats, cyber-security nightmares and how to protect against them," Computer Fraud & Security, vol. 2013, no. 9, pp. 14-18, Sep. 2013. [ 2 6 ] W . R . C l a y c o m b , C . L . H u t h , L . F l y n n , D . M . M c I n t i r e , a n d T . B . Lewellen, "Chronological Examination of Insider Threat Sabotage: Preliminary Observations," Journal of Wireless Mobile Networks, Ubiquitous Computing, and Dependable Applications (JoWUA), vol. 3, no. 4, pp. 4-20, Dec. 2012. [27] T. El Maliki and J.-M. Seigneur, "A Survey of User-centric Identity Management Technologies," in Proc. 2007 Int. Conf. Emerging Security Information, Systems, and Technologies , pp. 12-17. [28] S. De Capitani di Vimercati, S. Paraboschi, and P. Samarati, "Access control: principles and solutions," Software: Practice and Experience, vol. 33, no. 5, pp. 397-421, Apr. 2003. [29] J. Slay and M. Miller, "Lessons Learned from the Maroochy Water Breach," in Critical Infrastructure Protection , Boston,MA: Springer, 2008, pp. 73-82. [30] R. M. Lee and M. J. Assante. (2015, Oct. 15). The Industrial Control System Cyber Kill. SANS Institute . [Online]. Available: https://www.sans.org/reading-room/whitepapers/ICS/industrial-control-system-cyber-kill-chain-36297 [31] K. Padayachee, "An assessment of opportunity-reducing techniques in information security: An insider threat perspective," Decision Support Systems, vol. 92, pp. 47-56, Dec. 2016. [32] N. Baracaldo and J. Joshi, "An adaptive risk management and access control framework to mitigate insider threats," Computers & Security, vol. 39, pp. 237-254, Nov. 2013. [33] I. Agrafiotis, J. R. C. Nurse, O. Buckley, P. Legg, S. Creese, and M. Goldsmith, "Identifying attack patterns for insider threat detection," Computer Fraud & Security, vol. 2015, no. 7, pp. 9-17, July 2015. [34] Y. L. Wang and S. C. Yang, "A Method of Evaluation for Insider Threat," in Proc. 2014 Int. Symposium on Computer, Consumer and Control, pp. 438-441. 2018 6th International Istanbul Smart Grids and Cities Congress and Fair (ICSG) 85 Authorized licensed use limited to: Air Force Institute of Technology. Downloaded on February 11,2025 at 16:38:37 UTC from IEEE Xplore. Restrictions apply. |
Formal_Modeling_of_Function_Block_Applications_Running_in_IEC_61499_Execution_Runtime.txt | "The execution model in a new standard for dis- tributed control systems, IEC 61499, is analyzed. It(...TRUNCATED) | "Formal Modeling of Function Block Applications Running in IEC 61499 Execution Runtime Goran Cengi (...TRUNCATED) |
IIoT_Cybersecurity_Risk_Modeling_for_SCADA_Systems.txt | "Urban critical infrastructure such as electric grids, water networks, and transportation systems ar(...TRUNCATED) | "4486 IEEE INTERNET OF THINGS JOURNAL, VOL. 5, NO. 6, DECEMBER 2018 IIoT Cybersecurity Risk Modeling(...TRUNCATED) |
"Fool_Your_Enemies_Enable_Cyber_Deception_and_Moving_Target_Defense_for_Intrusion_Detection_in_SDN.t(...TRUNCATED) | "The adoption of deception technology constructed to throw off stealthy attackers from real assets a(...TRUNCATED) | "Fool Your Enemies: Enable Cyber Deception and Moving Target Defense for Intrusion Detection in SDN (...TRUNCATED) |
Anomaly_Detection_in_Real-Time_Multi-Threaded_Processes_Using_Hardware_Performance_Counters.txt | "We propose a novel methodology for real-time monitoring of software running on embedded processors (...TRUNCATED) | "666 IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY, VOL. 15, 2020 Anomaly Detection in Rea(...TRUNCATED) |
OpenPLC_An_open_source_alternative_to_automation.txt | "Companies are always looking for ways to increase production. The elevated consumerism pushes facto(...TRUNCATED) | "OpenPLC: An Open Source Alternative to Automation Thiago Rodrigues Alves, Mario Buratto, Flavio Mau(...TRUNCATED) |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12