Trustwave's 2024 Financial Services Threat Reports Highlight Alarming Trends in Insider Threats & Phishing-as-a-Service. Learn More

Trustwave's 2024 Financial Services Threat Reports Highlight Alarming Trends in Insider Threats & Phishing-as-a-Service. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

Attacking SCADA Part III: Hardcoded Salt in Schneider Electric EcoStruxure Machine Expert (CVE-2020-28214)

This is part three of our Schneider Electric series. You can read part one here and part two here.

Introduction

When the engineer activates the passwords for application protection, the passwords are hashed and stored in the local project file, which ends with the extension smbp. If we open this file in a notepad, we can find the hashed passwords in this section.

Image001Figure 1: Password hashes in the project file

Analysis

Machine Expert main application is developed with .NET framework. This can be reversed by using dnSpy or any equivalent .NET disassembler.

We were able to find the hard-coded salt in this file:

  • SoMachineBasic.CommonUtility.dll.

In this file, there is a class called EncryptionHelper found in  “SchneiderElectric.Automation.SoMachineBasic.Common.CommonUtility.Cryptography”. This class contains two functions – EncryptSha256 and EncryptSha256Salted.

EncryptSha256 is used to hash the plaintext password. EncryptSha256Salted is used to hash the hashed password again with a hard-coded salt as shown in Figure 2. EncryptSha256Salted appends a hard-coded value to password before hashing it again using EncryptSha256. Since the function uses a hard-coded salt, the same input will always yield the same output. This makes it possible for the attacker to brute force and identify the plaintext password.

Image002Figure 2: These two functions are used to hash the plaintext passwords that are used in the application protections

We wrote a proof-of-concept code in python to demonstrate this vulnerability. This code can be executed using this command: python3 hashThatPassword.py <password to hash>.

Image005

This is the result from running the POC code.

The output from the script is shown in Figure 3. The plaintext password is “password” and it outputs to “0f55c2a5f886d612ad7f919918a49b4af2390f00222600ccdbec10c836c9b2c8”. This output is identical to what we have shown in Figure 2.

Image004Figure 3: Output from the POC code. The hashed password is exactly the same as the one shown in Figure 2 as the plaintext password used in both cases is “password”

Impact

It will be possible for the attacker to build a rainbow table and run brute-force attack to identify the plaintext password used to activate the application protection. This attack does not require the attacker to have any access to network traffic. The attacker can run this POC code offline and do a match to the hashed passwords found in the project files. Once the attacker has the plaintext passwords, he will have sufficient privilege to make changes to the protected application on the controller.

References

Trustwave Advisory TWSL2020-007

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo