An Out-of-Date CMS is No Match for a Skilled Intruder
Installation
I will offer only a brief description of how to install CMS Made Simple, so I can skip to the more interesting stuff. To get started, I ran through the steps in Listing 1.
Listing 1
Installing CMS Made Simple
$ mkdir cms $ cd cms $ wget http://s3.amazonaws.com/ cmsms/downloads/14076/ cmsms-2.2.5-install.zip $ apt install unzip -y Archive: cmsms-2.2.9-install.zip inflating: cmsms-2.2.9-install.php inflating: README-PHAR.TXT $ chown www-data:www-data *
Figure 5 shows the introductory notes for CMS Made Simple, which are in the README-PHAR.TXT file. The help file goes on to explain that you'll need a "minimum version of PHP 5.4.0 with the Phar library enabled" to get the CMS running. To check whether the Phar library is present and available, run the command in Listing 2.
Listing 2
Checking for Phar
$ php -i | grep "phar" Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip Phar-based phar archives => enabled Tar-based phar archives => enabled ZIP-based phar archives => enabled phar.cache_list => no value => no value phar.readonly => On => On phar.require_hash => On => On
After a tip I found online [7], I ran the following commands to open up the permissions for the Apache user (which is called www-data):
$ cd /var/www $ chown www-data:www-data html/ $ chown -R www-data:www-data html/ $ chmod -R 0775 html/ $ apt install php-gd $ apt install php-xml $ apt install -y php-mbstring
After I entered the commands and clicked the following link, I saw the display shown in Figure 6:
http://127.0.0.1:8888/cmsms-2.2.9-install.php/index.php
The next step is creating a database called cms. You can log into MySQL with the password you created during the set up:
$ mysql -h localhost -u <username>
Once logged in, create your database with this command:
mysql> CREATE database cms; Query OK, 1 row affected (0.00 sec)
After you run through the steps in the wizard, you should be all set. Note that just visiting the root of the URL without the index.php part will not present the CMS page.
Figure 7 shows what success looks like. The CMS is ready to attack!
Exploit
The exploit (which appeared in 2019) affected the versions mentioned of the CMS, and knowledge about the attack rapidly went global. Users were scrambling to upgrade at the earliest opportunity. As a result, there are code snippets that will run the exploit all over the web [8].
To ensure that the version of the CMS that you just installed is indeed vulnerable, check the bottom-left corner of the CMS splash page. In my case, I can see that version 2.2.6 is installed as expected.
Install SearchSploit
SearchSploit [9] (Figure 8) is a searchable command-line version of the MetaSploit pen-testing framework. In order to get SearchSploit running on the command line, start by cloning the GitHub repository using the following command:
$ git clone https://gitlab.com/exploit-database/exploitdb.git
To run SearchSploit from anywhere in the system, I usually create a Bash alias. Inside my aliases file, I add this line:
alias se='/path/exploitdb/searchsploit'
Alternatively, you could add the searchsploit file to your path or indeed create a symlink into a directory that is already in your user's PATH variable.
Every now and then, I will enter the exploitdb directory and run the following command to update Exploit Database content:
$ git pull
I should really add this to a cron job so that the update is done automatically. I'm sure you could find a more graceful way of keeping it up to date, but I haven't stumbled across it yet.
To prove that SearchSploit is working, I will search for CMS Made Simple without specific versions:
$ se CMS Made Simple
The results of the search appear in Figure 9.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Alpine Linux 3.24 Features Fresh Desktops and a Newer Kernel
If you're a fan of Alpine Linux, it's time to upgrade because the latest version has been released with KDE Plasma 6.6, Gnome 50, and Linux kernel 6.18 LTS.
-
EU Open Source Strategy Plays Key Role in Tech Sovereignty Package
Comprehensive measures adopted by the European Commission aim to reduce dependency on non-EU countries.
-
Linux Foundation Report Indicates AI Driving Tech Hiring
Within growing security and skills gaps, AI has been found to be a positive driving force behind tech hiring trends in Europe.
-
United Nations Open Source Portal Goes Live
A new open source portal seeks to coordinate and scale open source efforts across the United Nations system.
-
KDE Linux Drops AUR
KDE Linux developers have dropped the Arch User Repository from the build pipeline due to security concerns; other distributions should consider doing the same.
-
California May Exempt Linux from Its Age-Verification Law
After backlash from the Linux community, California may be backing off on its promise to force all operating systems to verify age, but one platform may still have to comply.
-
Another Logic Bug Found in Linux Kernel
Qualys has discovered a vulnerability in the Linux kernel that can be used to elevate standard user privileges.
-
Ubuntu Core 26 Offers Game-Changing Enterprise Features
Ubuntu Core 26 could be a game-changer for organizations looking for increased security and reliability.
-
AI Flooding the Linux Kernel Security Mailing List
AI is giving Linus Torvalds a headache, but not in the way you might think.
-
Top Priorities for Open Source Pros Seeking a New Job
Professional fulfillment tops the list, according to LPI report.
