CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. 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

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More