Trustwave Unveils New Offerings to Maximize Value of Microsoft Security Investments. Learn More

Trustwave Unveils New Offerings to Maximize Value of Microsoft Security Investments. Learn More

Services
Capture
Managed Detection & Response

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

twi-managed-portal-color
Co-Managed SOC (SIEM)

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

twi-briefcase-color-svg
Advisory & Diagnostics

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

tw-laptop-data
Penetration Testing

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

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

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

tw-officer
Digital Forensics & Incident Response

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

tw-network
Firewall & Technology Management

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

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
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
SpiderLabs Blog

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

Latest SpiderLabs Blogs

Clockwork Blue: Automating Security Defenses with SOAR and AI

It’s impractical to operate security operations alone, using manual human processes. Finding opportunities to automate SecOps is an underlying foundation of Zero Trust and an essential architecture...

Read More

Professional Services Sector Under Attack - Trustwave SpiderLabs Report 2024

Recent research by Trustwave SpiderLabs, detailed in their newly published report "2024 Professional Services Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies,"...

Read More

Atlas Oil: The Consequences of a Ransomware Attack

Overview Atlas Oil, a major player in the oil and fuel distribution industry, fell victim to a ransomware attack orchestrated by the Black Basta group. This attack not only compromised sensitive...

Read More