How to Prevent Ransomware Infections

Ransomware is a type of virus that encrypts a users files locally and in files shares. Ransomware encrypts the files using an encryption key only known by the attacker.  Specific file extensions are usually targeted to only encrypt files a user wants/needs.  Files can usually be decrypted by paying ransom in bitcoin to the attacker.  Ransomware is delivered by drive-by-download (visiting a  compromised website no download necessary), mass email campaigns (SPAM), and visiting compromised website and downloading/opening something.

How organizations or IT departments can Prevent Ransomware Infections:

  1. Backup your files with at least one disconnected medium or backup appliance. Ransomware can end up encrypting your backups if your backups are on the same network and are accessible via a file share. Preferably have backups in three different physical locations with one of those locations being on a disconnected medium (tape, backup drive physically disconnected, DVD, etc.) or backup appliance. Keep backups for at least 6 months. If you are using cloud file storage then make sure to setup cloud to cloud backup.
  2. Consider cloud file storage with versioning for important non confidential files. (Cloud storage is not a backup)
  3. Setup volume shadow copies on Windows file shares.  Check the schedule and set the max size limit (Setting the max size will prevent the drive from filling up.  Set a large enough size to have at least 4 months of versions).
  4. Backup your websites and website databases (ransomware is also targeting linux web servers)
  5. Office 365 turn on version history (Versioning only works with Office documents! Cloud backups are very important.)
  6. Setup web filtering appliance for your network. This will prevent old ransomware from being downloaded. If you cannot afford a web filtering appliance then you can use the host file from You can also use Open DNS to help with web filtering
  7. Setup new firewall to geo-block IP addresses from at least Russia and China.  This will prevent some ransomware from being downloaded or the virus uploading the encryption key to the crooks servers stopping the encryption process.
  8. Setup a good SPAM filter and block certain extensions in attachments (exe, zip, rar, vbs, scr, etc.). This will prevent some SPAM messages with ransomware/viruses from your users.
  9. Install Anti-virus program on all client workstations and keep them updated.  This will prevent old viruses. Configure ant-virus to scan compressed files.
  10. Only give write permissions on shares to users/groups that absolutely need those permissions.  Default to read only permissions whenever possible.  Audit your file shares and review the needed permissions for each share. This limits the damage that a ransomware can cause if the infected user has read only permissions. (New ransomware is targeting all shares a user has ever accessed regardless of mapped drives)
  11. Setup Group Policies to restrict applications from running in appdata directories. This prevents some ransomware from being run.
  12. Add Group Policies for Software Restriction Policies to block executables from running within compressed files.
  13. Disable Auto Play via Group Policy to prevent usb auto play viruses
  14. Disable Microsoft Office Macros in Group Policy
  15. Setup Ransomware Detection Service on your Windows File Server.  This will notify you when file shares become compromised by any Ransomware. CommandProgram option is available to stop an infected user. Train users to leave SourcePath files/folders alone to prevent false positives.  This service can also be used to cleanup file shares.  If you have a good backup after an infection, the bad files can be deleted prior to restore using the Find Files tab and File Filter tab.  This program also will aide in the restore of files.  It can compare file signatures and only restore the corrupted/encrypted files.  The Audit Files tab and Find Files tab will also make note of file owners of corrupted/encrypted files.
  16. Setup File Screens on your Windows File Servers to detect files and extensions caused by ransomware This will notify you when you get hit by an older ransomware and the owner of the file is the infected user.  Passive monitoring notifies you when a possible infection occurs and gathers the file owner to get the infected user.  The big caveat being that the ransomware creates files or file extensions that are not random and in the file shares that become encrypted.  Ransomware do not always change files extensions or create text ransom notes. This fact renders File Screens inadequate for detection of current and future ransomware.
  17. Control Panel ->”File Explorer Options” Uncheck “Hide extensions for known file types”.  Users need to know what type of file is about to be opened. Make this setting global by group policy
  18. Keep operating systems (Windows, MAC, Linux) and third party applications (Adobe Reader, Flash, Java, etc.) updated on all clients. This will prevent some virus infections.  Alternatively, uninstall any vulnerable extensions from all web browsers (flash, java, adobe reader)
  19. Consider using source control for important documents  Source control programs store document change history in files without extensions.  (This will only work while source control is not targeted.)
  20. Consider application white listing to prevent malicious software and unapproved programs from running.
  21. Consider disallowing installation of applications by users. (Depends on your IT staff and user base if this is possible. Not enough IT staff or users are very independent then this might not be possible. [No local admin privileges])
  22. Consider application sand boxing.
  23. Block known-malicious Tor IP addresses
  24. Beta Test CryptoPrevent on client workstations
  25. Train users to not trust or open attachments from unknown senders and suspicious emails.
  26. Train users to never enable macros on a Microsoft Office file from an email attachment or downloaded file.
  27. Make note of the user that was infected by noting the file owner of ransomware created files.  Make note of creation times of ransomware files created with user infected to help determine website sites that caused the infection so you can black list the sites on your web content filter or firewall.  Notify the infected user on the cause of the infection if an email or download caused the infection. Train the user on how to avoid the same problem again if necessary.
  28. Audit your file shares and look for encrypted files before backups are deleted.  The sooner you catch an infected share the less data loss and a more recent backup can be restored.  Ransomware Detection Service can find ransomware related file extensions and files (off hours only).  Some ransomware don’t modify file extensions and even can keep the same file size.  The only way to check is to open some files and verify content.  I added Auditing to the Ransomware Detection Service.
  29. Disable or Uninstall browser extensions that are not needed for all users. If you are an advanced user Install browser extensions like Adblock, Noscript onto Chrome and Firefox.
  30. If you are an advanced user then install and setup Microsoft EMET
  31. If you are an advanced user setup and Deploy Microsoft EMET with Group Policy Settings.  This will take research and testing but in the end your environment will be more secure.
  32. Look into newer Anti-virus programs that offer ransomware protection.  Malwarebytes etc.
  33. Don’t pay the ransom.  (Paying the ransom will fund and set precedent for future ransomware attacks.) If you get hit and you don’t have backups then you might not have a choice.  If you followed the previous bullet points you will have options for restoring files.



How to Recover from Ransomware:

Restore Files After a Ransomware Infection



Another prevention article:’t-be-caught-out.html

2 thoughts on “How to Prevent Ransomware Infections

  1. Pingback: Restore Files After a Ransomware Infection | Question Driven

  2. Pingback: Ransomware Detection Service Released | Question Driven

Leave a Reply

%d bloggers like this: