Understanding and Preventing a Ransomware Attack