Ransomware 2.0 'crypts website databases – until victims pay up
File-integrity monitoring of scripts is a key defence
Criminals are holding companies' web databases to ransom by compromising web applications and encrypting all the data until money is handed over.
As detailed by security consultancy High-Tech Bridge, the attacks start with an assault on a website that yields access to a database server. Once in, miscreants install hidden software on the web server that silently encrypts data as it is written and decrypts it as it is read to and from the database.
Over time, the site's records are scrambled using a key known only to the crooks – an operation that apparently escapes some admins' attention until the key is removed, and the site suddenly falls over as it can no longer make sense of its own database.
Not long afterwards, the site owners receive an email demanding cash for access to the decryption key to unscramble all the data.
The perpetrators seem to know exactly when to strike with their demands for money, timing it precisely before full backups are taken for maximum effect. High-Tech Bridge says one website was compromised six months before the key was withdrawn and the ransom demands arrived.
That left the victims, whose incremental backups were useless, contemplating whether to restore to a six-month-old full backup and lose a lot of changes, or pay up.
"The web application was compromised six months ago [and] several server scripts were modified to encrypt data before inserting it into the database and to decrypt after getting data from the database," High-Tech Bridge writes, describing the attack as an "on-the-fly" process.
"During six months, hackers were silently waiting, while backups were being overwritten by the recent versions of the database.
"The hackers then removed the key. The database became unusable, the website went out of service, and the hackers demanded a ransom for the key."
Two "backdoors", undetected by any antivirus platform, were inserted by the crooks into the phpBB software installed on the victims' small business server. One altered the config.php file to decrypt and encrypt data using the PHP mcrypt_encrypt() function and an encryption key stashed away on a remote server.
The attackers broke in and infiltrated the phpBB install using a stolen FTP password, the researchers said. There is no suggestion that phpBB was the attack vector.
Researchers said it was "almost impossible" to recover the enciphered data without paying the ransom and obtaining the key. Sysadmins could lean on file-integrity monitoring to foil the attack on the script files, although this technique is rarely used with web apps. ®
An earlier version of this article may have been read as implying that phpBB was the attack vector. We are happy to state that this is not the case.