Anatomy of an Attack: Ransomware Theory and Practice