ICS Testing Guide

From Securea
Jump to: navigation, search

Principles of Testing ICS Security

Testing Techniques

ICS Security Testing Guide Content

This is a work-in-progress structure focused mainly on security within energy sector (power generation and distribution)


Essentials for ICS/SCADA defence[edit]

The challenging and ever-changing landscape of cybersecurity and the IT Sector in general is a prime example of the need for continuing professional development and as an undergraduate, BSC(Hons) IT Security, the desire to gain practical skills to complement the theory led me to a Central European internship during this summer vacation – working for Citadelo; a tightly knit team of IT security professionals dedicated to finding vulnerabilities in corporate IT environments.

The need to test every possible angle for intrusion was clarified for me whilst having an informal chat with Tomáš Zaťko, CEO. Tomáš described how Junior team members would take advice from Senior Pentesters when faced with an IT environment not revealing its vulnerabilities. This combined effort would always prove fruitful.

This, to me, indicates a number of things including the professionalism and camaraderie that is prevalent, the determination to test every possible attack vector and the CEO having a strong connection with staff, their challenges and interactions.

What it also indicates is the requirement for a thorough, determined and methodical approach to penetrate a system and this has been an overriding factor during my internship researching ICS/SCADA network security and the superior nature of some of the malware they are faced with. The ICS Battleground

As a mature student, with a background in programming, testing and application support, I was delighted to be assigned research in this complex and challenging arena – “Arena” may not be descriptive enough as it is becoming something more of a battleground for cyber-espionage and cyber-terrorism.

If you are not familiar with terms such as ‘STUXNET’ and ‘SCADA’ you may be wondering what the fuss is about? Allow me to offer a brief overview…

Industrial Control Systems (ICS) are responsible for most of humanities basic needs; heat, light, food, fuel and medicines are met by systems governed by Industrial Control; those that are part of process and manufacturing environments.

Synchronised Control and Data Access (SCADA) is the internal network for the Control System and a term that is commonly misused to represent ICS. ICS Timeline

From the following timeline it becomes obvious these systems were designed before the internet reached its current level of maturity – when they embraced Ethernet/TCPIP they became connected and this makes them highly vulnerable to attack as security provisions were not in-built.

   18th Century saw the commencement of the Industrial revolution
   1900s and we see remote systems being controlled by electrically operated switches (relays)
   1950s Industrial hardware controlled by ticker and punch paper tape
   1960s Systems become subject to distributed control
   1969 Embedded systems – Programmable Logic Controllers (PLC)
   1979 Modicon invented Modbus – a serial line protocol for communications between electronic devices
   1986 : General purpose computers become control points for PLCs
   1992 : ICS embrace TCP/IP and gain connection to the internet

Challenges and Threats

The threat, for potential cyber-espionage, on these control systems is serious, potentially catastrophic and gaining popularity in the ethical and non-ethical hacking communities. Government agencies are proactively seeking ability for the monitoring and domination of these systems.

It is a recognised fact that critical infrastructure providers can not afford complacency. Systems that were historically built for reliability, control and safety have, since their embrace of Ethernet/TCPIP, become vulnerable to cyber threats.

When you are pitted against heavily financed and military trained groups which may be umbrella’d under cyber-terrorism or cyber-espionage, the threat and potential for significant service disruption, hardware damage, financial costs and worst-case – the loss of life, cannot be overlooked.

If we ask ourselves “What has been solved?” in regard to cyber security, we have to consider the definition of the word. It can be viewed as effectively dealing with a problem. Has cybersecurity been solved? The answer can only be “No”.

Whilst the necessary analysis of known and specific malware can raise awareness and implementations to counter these attacks; focusing on particular malware examples can shrink the mindset of the defenders. There are many tools and techniques available for hardening of your system but malware is continuously evolving.

It is not unreasonable to deduce that security implementations are becoming more and more layered. There is good reason for this, for example, many ICS systems cannot tolerate downtime – they measure performance in milliseconds.

If we consider Black Energy malware, which was recently used in part on the Ukrainian Power Grid attack in 2015, which resulted in over 225,000 Customers’ electricity supply being disrupted for hours, we can find documented evidence that during 2015 at least 12 different versions were in circulation. Yes! Black Energy is still alive and well and these versions indicate that their targets are specific.

The challenge is increasing exponentially. Attacks are more and more frequent, more elaborate, more strategically planned, designed and executed. We have to think like Hackers; very serious and highly experienced Hackers. Next, we have to think ahead – will the next attack be an evolvement of existing malware, a combination or something as yet un-encountered.

“Forewarned is Forearmed” is a relevant adage and some experts recommend ‘Attack Trees ‘as the best defence against future attacks but there are arguments against this type of modelling. An attack tree aims to map out all the possible entry points into a network or system which is far from irrelevant but we need to consider the underpinning methodology.

What is needed is a collaborative effort where the gain is not financial but relevant to all those involved in cyber security and, certainly not least important, the essential involvement of the ICS industry whose knowledge and experience must be taken into careful consideration. Historical consequences

The issue of security of ICS systems became largely significant especially after the huge exploit in particularly sensitive area of nuclear development in 2010. The Stuxnet virus attacked alongside others mainly Iranian research centers and destroyed the whole fifth of their nuclear centrifuges. The whole attack aimed primarily at the so-called Programmable Logic Controller (PLC) which is a set of end controllers that directly communicate and manage the actual process or task. Any committal capable to affect the PLC functioning is an immense risk which effectively means that the attacker – hacker – is able to replace the management of the operation by his own commands. Despite the fact that the antiviral programs and tools for analyzing and detecting threats are quickly improving, cyber mafia is ahead and offers its clients offensive means based on the so-called zero-day vulnerabilities, i.e. yet unknown vulnerabilities and exploits which can be used for a successful penetration. It is more than naive to believe that the ICS area would remain outside the spotlight. On the contrary, at the hacker forums can be noticed further development of the tools similar to Stuxnet and one can only guess how far their development has advanced.

Physical security[edit]

Protection of the server room[edit]

Protection of external objects[edit]

Protection of access to internal networks[edit]

Review of security policies[edit]

Social engineering[edit]

Mass or targeted (spear) phishing campaign via email[edit]

Dropped USB sticks with malware nearby and inside targeted objects (buildings).(baiting)[edit]

Dropped CD with malware nearby and inside targeted objects (buildings) - (baiting)[edit]

Phone inquiries of changing passwords or performing malicious activities[edit]



Network Segmentation, DMZ[edit]



(N/H)Intrusion Prevention System/(N/H)Intrusion Detection System[edit]

Monitoring and SIEM[edit]

Network scanning and analysis of network traffic (IPv4 and IPv6)[edit]

Layer2 attacks[edit]

802.1x (NAP)[edit]

Vulnerability Assessment of Critical Infrastructure[edit]


Mobile/Radio networks[edit]

Workstation security[edit]


Air Gap security[edit]

Types of attacks

Mosquito Attack (2018) https://thehackernews.com/2018/03/air-gap-computer-hacking.html

Inventory and cataloging of IT assets[edit]

== Penetration testing of web applications (web applications hosted in critical infrastructure and accessible from the Internet)==

Backup and recovery tests[edit]


Patch management[edit]

Disaster recovery scenarios and tests[edit]

Incident response[edit]

Revision of assets managed by third parties[edit]


Password policy and rotation[edit]


The authentication mechanism is often as strong as used credentials (particularly passwords). Therefore, the passwords that protect privileged areas of ISC devices must meet a strong password policy. Insufficient or weak passwords increase chances for an attacker to gain an access to the ISC device by leveraging a dictionary attack or a brute-force attack. Notorious passwords such as "admin, root, 0000, 1111, system.." and their other deviation, that can be easily guessable are still present. An attacker may use automated tools to gain a password within few minutes.

Test Objectives

The goal of this test is to verify if the ICS system implements an anti-bruteforce technique and to determine complexity of the password - length; old-password reuse, expiration time.

How to Test

Password complexity:

1. What is the minimal and maximal length of passwords?

2. Do the passwords have to contain uppercases, lowercases and numbers?

3. Do the passwords have to contain special characters? (e.g: %$#!)

Password rules:

1. Is it possible to use a username as the password?

2. How often is a password change enforced?

3. Is it possible to change password to the same value as old passwords had?

Password guessing:

1. What kind of anti-bruteforce technique is implemented? (Is the account blocked temporarily or permanently?, an implementation of CAPTCHA)


Open source tools: • THC Hydra - https://www.thc.org/thc-hydra/

 o	A very fast network logon cracker which support many different services.

• Ncrack - https://github.com/nmap/ncrack

 o	Ncrack is a high-speed network authentication cracking tool. Protocols supported include RDP, SSH, HTTP(s), SMB, POP3(s), VNC, FTP, SIP, Redis, PostgreSQL, MySQL and Telnet.

• Metasploit - https://www.metasploit.com/

 o	Metasploit is a vulnerability scanning and exploit development tool. It contains several modules for brute-force login.

Proprietary tools: • XXX • YYY

Example: Bruteforce attack using THC Hydra for ICS web interface protected by HTTP Basic Auth.

root@kali:~# hydra -l admin -P passwords.txt -t7 -f myics.local http-get / Hydra v8.2 (c) 2016 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.

Hydra (http://www.thc.org/thc-hydra) starting at 2016-10-26 12:30:10 [DATA] max 7 tasks per 1 server, overall 64 tasks, 7 login tries (l:1/p:7), ~0 tries per task [DATA] attacking service http-get on port 80 [80][http-get] host: myics.local login: admin password: 0000 1 of 1 target successfully completed, 1 valid password found Hydra (http://www.thc.org/thc-hydra) finished at 2016-10-26 12:30:11

The abovementioned example proves that the ICS device does not implement any anti-bruteforce techniques. A string password policy is not implemented either, since the revealed password is not a complex one.

Should it be the case that the login to the web interface is performed by a proprietary protocol and a documentation is not publicly available, an attacker has to utilize techniques of reverse engineering. For more detail information about reverse engineering refer to the section “Protocol analysis”. After the process of reverse engineering the attacker must implement his own automated tool for the brute-force attack. This process may be time-consuming, however it does not stop the determined attacker. It is recommended to leverage one of the popular programming languages such as Python or Ruby, which provides many modules and allows even non-proficient programmers to write it within few lines of code.

See also OWASP "Use and misuse case https://www.owasp.org/index.php/File:UseAndMisuseCase.jpg"

References and Resources





Enforce usage of strong passwords policy. A password strength policy should contain the following attributes:

• Minimum length

• Mixture of special, uppercase and lowercase characters and numbers

• Maximum password age

• Must be unique from all previous passwords

• Passwords must not be the same as the username

• Default factory passwords should be changed immediately after first usage

Moreover, implement: • Two-factor authentication (2FA) • Anti brute-force mechanism

Password management[edit]

Password sharing, Multisig[edit]

Password revocation[edit]

Security training for employees[edit]

Industrial Control Systems testing[edit]

Discovering communication interfaces[edit]

RS-232, RS-485, RS-422, Ethernet, USB...[edit]

GSM / GPRS (SMS)[edit]

Identifying the processor architecture and OS[edit]







Via JTAG, UART[edit]
From chip[edit]

Static and dynamic analysis - Disassembling/Debugging[edit]

Protocol analysis[edit]
Finding vulnerabilities (Manual, source code analyzer/scanner)[edit]
Backdoors/default passwords[edit]

Communication protocols identification and analysis (Modbus, DNP3, OPC, S7, custom..)[edit]

Network protocol analysis - data structures[edit]

Network protocol cryptographic analysis[edit]

Authentication, Authorization and Access Control[edit]

Password reset[edit]
User management[edit]

Protocol fuzzing / input validation[edit]

Replay attack + TCP/IP hijacking[edit]

Denial of Service[edit]

Unused services[edit]

Timing attacks[edit]

Validation of the configuration file[edit]

Penetration testing of ICS web interfaces - OWASP Testing guide / OWASP TOP10[edit]

Malicious USB drive[edit]

Password policy[edit]

Logging and auditing[edit]

Documentation reviews[edit]

Review of historical vulnerabilities, security incidents, vendor fix times[edit]


Vulnerability assessment[edit]

Communication protocols identification and analysis[edit]

Network protocol analysis - data structures[edit]

Network protocol cryptographic analysis[edit]

Authentication, Authorization and Access Control[edit]

Password reset[edit]
User management[edit]

Protocol fuzzing / input validation[edit]

Static and dynamic analysis - Disassembling/Debugging SCADA software[edit]

Protocol analysis[edit]

Finding vulnerabilities (Manual, source code analyzer/scanner)[edit]

Backdoors/default passwords[edit]

Unused services[edit]

Penetration testing of SCADA web interfaces - OWASP Testing guide / OWASP TOP10[edit]

SCADA updating (security patch management)[edit]

Password policy and local accounts rights[edit]


Logging and auditing[edit]

Review of historical vulnerabilities, security incidents, vendor fix times[edit]