antivirus. Binary code, technology background

The threat posed by ransomware such as Locky and other malware has been a hot topic on and off in the media for months now. In a number of cases, including some rather more prominent ones, hackers have managed and continue to manage to infect their victims’ files with malware, which encrypts them to the point where they can no longer be used – the files are only made available again once a “ransom” has been paid. The more accesses the user in question has, the higher the damage: if possible, files on servers in the network are also “captured”.

A great deal has already been written on the topic. At this point, I would like – albeit very subjectively – to introduce a couple of approaches for how to protect yourself against such attacks.

It All Starts With Basic Security: Updates – Access Protection – Virus Scanners

The first logical step in any technical security system is not to offer blackmailers any targets. This is achieved by running updates for operating systems and applications in good time so as to avoid any security vulnerabilities. Where possible, this should be done automatically. (This is also possible on UCS systems by the way.)

In the case of server services, it is practical to consider well in advance who requires access and to restrict the user groups accordingly as well as to install a firewall for restrictions to individual networks. After all, malware acting in a user’s name can only change files to which the user has write access. Being frugal can also help: desktop applications and server services which are not installed also do not require protection.

Virus scanners complement this protection and can intervene at different points: on the mail server (for UCS there are also expansions available in the App Center in addition to the preinstalled ClamAV), on the file server (in Samba via “VFS” module), and, of course, on the client. Working without any virus scanners seems particular negligent in environments with Windows clients, while excessive protection soon results in the users’ frustration at false alarms and poor performance. In addition, the very principle of virus scanners also means that they are always one step behind the viruses: the virus signatures can only be updated once the first victims have succumbed. My personal impression from practical experience is that the combination of one virus engine on the mail server, which remains the primary attack route, and a second one on the desktop systems is an established approach.

Raising Awareness: Informed Users

Visualisierung Computer VirusIn many attack situations it is the end user who opens the door for the malware: It can be enough simply to open an e-mail attachment or download a file from the Internet. In some IT departments, the tendency is to suppress the most common attack patterns. As a result, Office documents and zip files attached to mails are rejected or quarantined. However, this approach is not practical in some fields and results in users’ becoming frustrated by the IT department and finding their own, often far riskier ways of exchanging information.

In order to avoid this kind of shadow IT systems, it is important to inform the users of the possible risks from the start. Attachments to mails from unknown sources are suspicious and should make users wary, but a forged e-mail can even find its way into communication with existing contacts. In this respect, effective dialog between the IT department and user is paramount: The IT department should report new threats at eye level and take all questions and requests received from users seriously. Only in this way can users be expected not to perceive the necessary restrictions as nannying.

Damage Limitation

However, even when full attention is paid, you should still be ready for an incident. Once a system becomes infected, files begin to be encrypted and attempt to infect other systems. There are mechanisms available for blocking individual workstations so as not to lose a Samba file server completely (see guide at end). However, these are not triggered until the first files have been “lost”.

Today, probably the most important component of damage limitation is a working, up-to-date backup – on a data carrier which is inaccessible to the infected client. Various apps in the Univention App Center provide the technology for this solution. The IT department in the company needs to discuss what needs to be backed up with the users in advance. It is also essential that this discussion be held at eye level: It is always easier for the IT department to back up the data on the server systems, whereas there are scenarios for the user where he wants to be able to save certain files locally on his end device.

If an incident occurs, the backup can only restore to the point where it was last saved. If in the worst case scenario that was the previous night, a whole day of work may be lost. As such, it is also worth thinking about setting up sensible time cycles for backups. Some cases can be cushioned through the use of automated synchronization and versioning. One of the most popular tools for this is OwnCloud, which can be used for both versioning and the availability of files on user devices. On the classic Samba file server, VFS modules allow comprehensive but also very time-consuming configuration possibilities. In the simplest case, the “recycle” module backs up deleted files for a number of days.

Example Configuration: Blocking of Infected Systems

A client infected with ransomware also attacks network services in order to try to encrypt files there. At this point, a significant action develops: many different files are changed. The files are also often furnished with a new suffix specific to the malware. These actions are detected by the combination of the Samba VFS module “full_audit” and the intrusion detection software “fail2ban” with the result that the accessing client is blocked.
Based on [1], the following steps are necessary on a UCS file server:

  1. Installation of fail2ban
    This is done by enabling the “unmaintained” repository [2] and installing the packages:

    ucr set repository/online/unmaintained='yes'
    univention-install fail2ban
  2. Global configuration of the “full_audit” Samba module
    The primary parameters of the module are stored in the Samba configuration. This can be done using UCR variables:

    ucr set 'samba/global/options/full_audit:failure=none' \
     'samba/global/options/full_audit:success=pwrite write rename' \
     'samba/global/options/full_audit:prefix=IP=%I|USER=%u|MACHINE=%m|VOLUME=%S' \
     'samba/global/options/full_audit:facility=local7' \
  3. Configuration of fail2ban
    As described in [1], the filter settings and the reaction to them (blocking of client and sending of notification) are configured in the configuration files /etc/fail2ban/filter.d/samba.conf und /etc/fail2ban/jail.conf . The service is then restarted via “service fail2ban restart” for the configuration to be adopted.
  4. Configuration of the network shares
    In the Univention Management Console, the “full_audit”module is entered under “VFS objects” on the “samba” tab for every file share to be monitored. The audit is then enabled for this share.

It is important to remember that this protection can always only be as good or bad as the description of the “patterns” in /etc/fail2ban/filter.d/samba.conf. If the list is too restrictive, unaffected users may be blocked; if is it outdated, it may not intervene in new scenarios. As an introduction, here is an example for this file based on file suffixes for current ransomware documented in [3][4].

failregex = (?i)smbd.*IP=<HOST>.*\.locky$

ignoreregex =

Summary: The Vital Compromise

As is the case in most security matters, the key to fending off ransomware lies in finding a compromise between efforts, restrictions, and risks which suits your individual environment. Those who implement the “communication with the users”, “functioning backup”, and “up-to-date virus protection” components, which are fundamental requirements irrespective of this particular threat, are largely protected from the worst threats.

[1] Heise article about the configuration of „fail2ban” (German)
[2] Information on „unmaintained“ repository (UCS manual)
[3] The Week In Ransomware at
[4] List of ransomware extensions and known ransom files created by Crypto malware at

Use UCS Core Edition for Free!
Download now


  1. Devin Currie

    June 11, 2016 at 01:56

    Is there a solution that will monitor the overall system and to effectively block/pause any attempt to encrypt in the background? Unless the user explicitly specified that software/operating system to encrypt the partition or file.

    1. Ingo Steuwer

      Ingo Steuwer

      June 13, 2016 at 08:22

      Nearly all of the known ransomware is designed to run under Windows, so the encryption is not done one the server but on the client. Such a monitoring would need to be done on the windows client. As each ransomware uses it’s own mechanisms to encrypt, there is no generic approach to detect an ongoing encryption; at least none that I heard of.

  2. Munzie

    June 16, 2016 at 17:08

    Hi Ingo

    A brief, but useful and informative article.. Better than news articles trying to explain ransomware.

  3. Ingo Steuwer

    July 1, 2016 at 15:30

    A sligtly updated version of /etc/fail2ban/filter.d/samba.conf that includes the new “Cerber” ransomware:

    failregex = smbd_audit\:\ IP=\|.*\.crypz$
    smbd_audit\:\ IP=\|.*\.enc*$
    smbd_audit\:\ IP=\|.decrypt-instruct*\.*$
    smbd_audit\:\ IP=\|.*files_are_encrypted\.*$
    smbd_audit\:\ IP=\|.*decryptmyfiles*\.*$
    smbd_audit\:\ IP=\|.help_instructions\.*$
    smbd_audit\:\ IP=\|.*-recover-*\.*$
    smbd_audit\:\ IP=\|.de_crypt_readme\.*$
    smbd_audit\:\ IP=\|.*!recover!*\.*$
    smbd_audit\:\ IP=\|.*recover\}-*\.*$
    smbd_audit\:\ IP=\|.*rec0ver*\.*$
    smbd_audit\:\ IP=\|._help_instruct*\.*$
    smbd_audit\:\ IP=\|.*_recover_*\.*$
    smbd_audit\:\ IP=\|.*\+recover\+*\.*$
    smbd_audit\:\ IP=\|.*warning-!!*\.*$
    smbd_audit\:\ IP=\|.*decrypt my file*\.*$
    smbd_audit\:\ IP=\|.help_file_*\.*$
    smbd_audit\:\ IP=\|.recovery\+*\.*$
    smbd_audit\:\ IP=\|.readme_for_decrypt*\.*$
    smbd_audit\:\ IP=\|.install_tor*\.*$
    smbd_audit\:\ IP=\|.readme_decrypt*\.*$
    smbd_audit\:\ IP=\|.howtodecrypt*\.*$
    smbd_audit\:\ IP=\|.howto_restore*\.*$
    smbd_audit\:\ IP=\|.how_to_recover*\.*$
    smbd_audit\:\ IP=\|.how_recover*\.*$
    smbd_audit\:\ IP=\|.how_to_decrypt*\.*$
    smbd_audit\:\ IP=\|.how to decrypt*\.*$
    smbd_audit\:\ IP=\|.help_restore*\.*$
    smbd_audit\:\ IP=\|.help_your_file*\.*$
    smbd_audit\:\ IP=\|.help_recover*\.*$
    smbd_audit\:\ IP=\|.help_decrypt*\.*$
    smbd_audit\:\ IP=\|.decrypt_instruct*\.*$
    smbd_audit\:\ IP=\|.cryptolocker\.*$
    smbd_audit\:\ IP=\|.*recover_instruction*\.*$
    smbd_audit\:\ IP=\|.*\.hydracrypt_ID*$
    smbd_audit\:\ IP=\|.*gmail*\.crypt$
    smbd_audit\:\ IP=\|.*\.cryptotorlocker*$
    smbd_audit\:\ IP=\|.*\.xxx$
    smbd_audit\:\ IP=\|.*\.xyz$
    smbd_audit\:\ IP=\|.*\.xtbl$
    smbd_audit\:\ IP=\|.*\.xort$
    smbd_audit\:\ IP=\|.*\.xrtn$
    smbd_audit\:\ IP=\|.*\.vvv$
    smbd_audit\:\ IP=\|.*\.vscrypt$
    smbd_audit\:\ IP=\|.*\.trun$
    smbd_audit\:\ IP=\|.*\.ttt$
    smbd_audit\:\ IP=\|.*\.surprise$
    smbd_audit\:\ IP=\|.*\.troyancoder@qq_com$
    smbd_audit\:\ IP=\|.*\.sport$
    smbd_audit\:\ IP=\|.*\.scl$
    smbd_audit\:\ IP=\|.*\.ryp$
    smbd_audit\:\ IP=\|.*\.sanction$
    smbd_audit\:\ IP=\|.*\.RRK$
    smbd_audit\:\ IP=\|.*\.rokku$
    smbd_audit\:\ IP=\|.*\.remind$
    smbd_audit\:\ IP=\|.*\.relock@qq_com$
    smbd_audit\:\ IP=\|.*\.RDM$
    smbd_audit\:\ IP=\|.*\.RADAMANT$
    smbd_audit\:\ IP=\|.*\.R5A$
    smbd_audit\:\ IP=\|.*\.R4A$
    smbd_audit\:\ IP=\|.*\.PoAr2w$
    smbd_audit\:\ IP=\|.*\.pizda@qq_com$
    smbd_audit\:\ IP=\|.*\.p5tkjw$
    smbd_audit\:\ IP=\|.*\.oplata@qq_com$
    smbd_audit\:\ IP=\|.*\.oshit$
    smbd_audit\:\ IP=\|.*\.oor$
    smbd_audit\:\ IP=\|.*\.one-we_can-help_you$
    smbd_audit\:\ IP=\|.*\.OMG!$
    smbd_audit\:\ IP=\|.*\.nochance$
    smbd_audit\:\ IP=\|.*\.nalog@qq_com$
    smbd_audit\:\ IP=\|.*\.micro$
    smbd_audit\:\ IP=\|.*\.LOL!$
    smbd_audit\:\ IP=\|.*\.locky$
    smbd_audit\:\ IP=\|.*\.locked$
    smbd_audit\:\ IP=\|.*\.LeChiffre$
    smbd_audit\:\ IP=\|.*\.kraken$
    smbd_audit\:\ IP=\|.*\.korrektor$
    smbd_audit\:\ IP=\|.*\.kkk$
    smbd_audit\:\ IP=\|.*\.kimcilware$
    smbd_audit\:\ IP=\|.*\.KEYZ$
    smbd_audit\:\ IP=\|.*\.keybtc@inbox_com$
    smbd_audit\:\ IP=\|.*\.KEYHOLES$
    smbd_audit\:\ IP=\|.*\.justbtcwillhelpyou$
    smbd_audit\:\ IP=\|.*\.infected$
    smbd_audit\:\ IP=\|.*\.helpdecrypt@ukr_net$
    smbd_audit\:\ IP=\|.*\.hb15$
    smbd_audit\:\ IP=\|.*\.ha3$
    smbd_audit\:\ IP=\|.*\.gruzin@qq_com$
    smbd_audit\:\ IP=\|.*\.gws$
    smbd_audit\:\ IP=\|.*\.fun$
    smbd_audit\:\ IP=\|.*\.fucked$
    smbd_audit\:\ IP=\|.*\.enigma$
    smbd_audit\:\ IP=\|.*\.encryptedped$
    smbd_audit\:\ IP=\|.*\.encryptedRSA$
    smbd_audit\:\ IP=\|.*\.encryptedAES$
    smbd_audit\:\ IP=\|.*\.Encrypted$
    smbd_audit\:\ IP=\|.*\.encrypt$
    smbd_audit\:\ IP=\|.*\.encedRSA$
    smbd_audit\:\ IP=\|.*\.EnCiPhErEd$
    smbd_audit\:\ IP=\|.*\.enc$
    smbd_audit\:\ IP=\|.*\.dyatel@qq_com$
    smbd_audit\:\ IP=\|.*\.czvxce$
    smbd_audit\:\ IP=\|.*\.darkness$
    smbd_audit\:\ IP=\|.*\.ctbl$
    smbd_audit\:\ IP=\|.*\.CrySiS$
    smbd_audit\:\ IP=\|.*\.CryptoTorLocker2015!$
    smbd_audit\:\ IP=\|.*\.crypted$
    smbd_audit\:\ IP=\|.*\.crypt$
    smbd_audit\:\ IP=\|.*\.cry$
    smbd_audit\:\ IP=\|.*\.crjoker$
    smbd_audit\:\ IP=\|.*\.crinf$
    smbd_audit\:\ IP=\|.*\.crime$
    smbd_audit\:\ IP=\|.*\.coverton$
    smbd_audit\:\ IP=\|.*\.code$
    smbd_audit\:\ IP=\|.*\.clf$
    smbd_audit\:\ IP=\|.*\.chifrator@qq_com$
    smbd_audit\:\ IP=\|.*\.cerber$
    smbd_audit\:\ IP=\|.*\.cbf$
    smbd_audit\:\ IP=\|.*\.btcbtcbtc$
    smbd_audit\:\ IP=\|.*\.btc-help-you$
    smbd_audit\:\ IP=\|.*\.btc$
    smbd_audit\:\ IP=\|.*\.bloc$
    smbd_audit\:\ IP=\|.*\.better_call_saul$
    smbd_audit\:\ IP=\|.*\.AES256$
    smbd_audit\:\ IP=\|.*\.\{CRYPTENDBLACKDC\}$
    smbd_audit\:\ IP=\|.*\.73i87A$
    smbd_audit\:\ IP=\|.*\.zzz$
    smbd_audit\:\ IP=\|.*\.abc$
    smbd_audit\:\ IP=\|.*\.aaa$
    smbd_audit\:\ IP=\|.vault\.txt$
    smbd_audit\:\ IP=\|.vault\.key$
    smbd_audit\:\ IP=\|.recovery_key\.txt$
    smbd_audit\:\ IP=\|.vault\.hta$
    smbd_audit\:\ IP=\|.message\.txt$
    smbd_audit\:\ IP=\|.recovery_file\.txt$
    smbd_audit\:\ IP=\|.confirmation\.key$
    smbd_audit\:\ IP=\|.enc_files\.txt$
    smbd_audit\:\ IP=\|.last_chance\.txt$
    smbd_audit\:\ IP=\|.*\.vault$
    smbd_audit\:\ IP=\|.*want your files back\.*$
    smbd_audit\:\ IP=\|.*\.frtrss$
    smbd_audit\:\ IP=\|.*\.exx$
    smbd_audit\:\ IP=\|.*\.ezz$
    smbd_audit\:\ IP=\|.*\.ecc$
    smbd_audit\:\ IP=\|.*help_restore*\.*$
    smbd_audit\:\ IP=\|.*how_to_recover*\.*$
    smbd_audit\:\ IP=\|.*restore_fi*\.*$
    smbd_audit\:\ IP=\|.*ukr\.net*$
    smbd_audit\:\ IP=\|.*qq_com*$
    smbd_audit\:\ IP=\|.*keemail\.me*$
    smbd_audit\:\ IP=\|.*decipher*$
    smbd_audit\:\ IP=\|.*install_tor*\.*$
    smbd_audit\:\ IP=\|.*crypt*$
    smbd_audit\:\ IP=\|.*cpyt*$
    smbd_audit\:\ IP=\|.*@india\.com*$
    smbd_audit\:\ IP=\|.*@gmail_com_*$
    smbd_audit\:\ IP=\|.*\.*obleep$
    smbd_audit\:\ IP=\|.*\.*exx$
    smbd_audit\:\ IP=\|.*\.*locked$
    smbd_audit\:\ IP=\|.*\.*nochance$
    smbd_audit\:\ IP=\|.*\.*kraken$
    smbd_audit\:\ IP=\|.*\.*kb15$
    smbd_audit\:\ IP=\|.*\.*darkness$
    smbd_audit\:\ IP=\|.*\.*crypto$
    smbd_audit\:\ IP=\|.*\.*cry$
    smbd_audit\:\ IP=\|._Locky_recover_instructions\.txt$
    smbd_audit\:\ IP=\|.help_recover_instructions\+*\.txt$
    smbd_audit\:\ IP=\|.recoverfile*\.txt$
    smbd_audit\:\ IP=\|.Howto_Restore_FILES\.TXT$
    smbd_audit\:\ IP=\|.recoveryfile*\.txt$
    smbd_audit\:\ IP=\|._how_recover\.txt$
    smbd_audit\:\ IP=\|.howrecover\+*\.txt$
    smbd_audit\:\ IP=\|.restorefiles\.txt$
    smbd_audit\:\ IP=\|.howto_recover_file\.txt$
    smbd_audit\:\ IP=\|.HowtoRESTORE_FILES\.txt$
    smbd_audit\:\ IP=\|.RECOVERY_FILE*\.txt$
    smbd_audit\:\ IP=\|.RECOVERY_FILES\.txt$
    smbd_audit\:\ IP=\|.help_decrypt_your_files\.html$
    smbd_audit\:\ IP=\|.HELPDECYPRT_YOUR_FILES\.HTML$
    smbd_audit\:\ IP=\|.IHAVEYOURSECRET\.KEY$
    smbd_audit\:\ IP=\|.SECRET\.KEY$
    smbd_audit\:\ IP=\|.SECRETIDHERE\.KEY$
    smbd_audit\:\ IP=\|.READTHISNOW!!!\.TXT$
    smbd_audit\:\ IP=\|.IAMREADYTOPAY\.TXT$
    smbd_audit\:\ IP=\|.HELLOTHERE\.TXT$
    smbd_audit\:\ IP=\|.FILESAREGONE\.TXT$
    smbd_audit\:\ IP=\|.DECRYPT_ReadMe\.TXT$
    smbd_audit\:\ IP=\|.Read\.txt$
    smbd_audit\:\ IP=\|.About_Files\.txt$
    smbd_audit\:\ IP=\|._secret_code\.txt$
    smbd_audit\:\ IP=\|.ReadDecryptFilesHere\.txt$
    smbd_audit\:\ IP=\|.Coin\.Locker\.txt$
    smbd_audit\:\ IP=\|.HOW_TO_DECRYPT_FILES\.TXT$
    smbd_audit\:\ IP=\|.DECRYPT_INSTRUCTION\.TXT$
    smbd_audit\:\ IP=\|.encryptor_raas_readme_liesmich\.txt$
    smbd_audit\:\ IP=\|.Help_Decrypt\.txt$
    smbd_audit\:\ IP=\|.YOUR_FILES\.url$
    smbd_audit\:\ IP=\|.How_To_Recover_Files\.txt$
    smbd_audit\:\ IP=\|.YOUR_FILES\.HTML$
    smbd_audit\:\ IP=\|.DECRYPT_INSTRUCTIONS\.TXT$
    smbd_audit\:\ IP=\|.HELP_TO_SAVE_FILES\.txt$
    smbd_audit\:\ IP=\|.DecryptAllFiles\.txt$
    smbd_audit\:\ IP=\|.HELP_RECOVER_FILES\.txt$
    smbd_audit\:\ IP=\|.HELP_RESTORE_FILES\.txt$
    smbd_audit\:\ IP=\|.HELP_TO_DECRYPT_YOUR_FILES\.txt$
    smbd_audit\:\ IP=\|.HELP_YOUR_FILES\.TXT$
    smbd_audit\:\ IP=\|.HELPDECRYPT\.TXT$
    smbd_audit\:\ IP=\|.*\.CTB2$
    smbd_audit\:\ IP=\|.*\.SUPERCRYPT$
    smbd_audit\:\ IP=\|.*\.magic$
    smbd_audit\:\ IP=\|.*\.1999$
    smbd_audit\:\ IP=\|.*\.toxcrypt$
    smbd_audit\:\ IP=\|.*\.bleep$
    smbd_audit\:\ IP=\|.*\.0x0$
    smbd_audit\:\ IP=\|.*\.good$
    smbd_audit\:\ IP=\|.*\.R16M01D05$
    smbd_audit\:\ IP=\|.*\.pzdc$
    smbd_audit\:\ IP=\|.*\.XRNT$
    smbd_audit\:\ IP=\|._crypt$
    smbd_audit\:\ IP=\|.*\.crypto$
    smbd_audit\:\ IP=\|.*\.ccc$
    smbd_audit\:\ IP=\|.oor*\.$
    smbd_audit\:\ IP=\|.*\.da_vinci_code$
    smbd_audit\:\ IP=\|.*\.payransom$
    smbd_audit\:\ IP=\|.*\.KEYH0LES$
    smbd_audit\:\ IP=\|.oor\.*$
    smbd_audit\:\ IP=\|.*\.zyklon$
    smbd_audit\:\ IP=\|.*\.zcrypt$
    smbd_audit\:\ IP=\|.*\.Z81928819$
    smbd_audit\:\ IP=\|.*\.Silent$
    smbd_audit\:\ IP=\|.*\.RSNSlocked$
    smbd_audit\:\ IP=\|.*\.RAD$
    smbd_audit\:\ IP=\|.*\.porno$
    smbd_audit\:\ IP=\|.*\.pornoransom$
    smbd_audit\:\ IP=\|.*\.odcodc$
    smbd_audit\:\ IP=\|._ryp$
    smbd_audit\:\ IP=\|.*\.helpdecrypt@ukr*\.net$
    smbd_audit\:\ IP=\|.*\.only-we_can-help_you$
    smbd_audit\:\ IP=\|.*\.cryp1$
    smbd_audit\:\ IP=\|.*\.fileiscryptedhard$
    smbd_audit\:\ IP=\|.*\.blocatto$
    smbd_audit\:\ IP=\|.*\.8lock8$
    smbd_audit\:\ IP=\|.*\.777$
    smbd_audit\:\ IP=\|.*\$

    ignoreregex =

  4. Antonio

    June 15, 2020 at 17:09

    Thanks, perfect.


Leave a Reply

Your email address will not be published. Required fields are marked *