Malware is generally written in C or C++, but so far all the open source ransomware I’ve seen was written in PHP, Python, C#, or other high level language (the kind of languages that professional malware developers would get laughed at for using).