Got a tip? Let us know


Ransomware analysis-into the roots of WannaCry

May 17,2017 19 comments

No one wants to be part of a story such as mine that follows. In January 2017, my computer screen was defaced with a very funny (yet annoying) beggar’s message demanding that I pay a sum of US$ 402. Failure to do so called for a permanent loss of my important files (my photos, electronic certificates, very important books and videos for my college study) which already has been encrypted. This was a Cerber ransomware attack. It all began after I downloaded a torrent for just an eBook with the pdf (portable document format) extension. On clicking the torrent link, it downloaded a folder. On complete download I opened the folder and found the file of my interest and opened it. As if nothing is wrong, the Adobe reader simply opened the document. I simply could not understand the language in which the document was written, it was in Russian language. I went back to the downloaded folder and opened the readme.txt text file. The instructions there were very clear and heart sinking. It read thereby: “Your Adobe Reader does not have the fonts necessary to open your document. To install the required fonts, click on the executable file in this folder.” I executed the executable (.exe) file by clicking on it. From that moment onwards, I could not easily navigate through my files; even the names of the specific files were randomized making it difficult to know what is what.  It is annoying experience you don’t want to face, trust me. To help you avoid being a victim of such a scenario, I have prepared this article for you. In it we will, explore what a ransomware is, what forces are behind it, its method of manufacture, its distribution methodology, methods of operation. We will then analyse the WannaCry malware that has recently hit the world (all these genius minds) to its knees.

What is a ransomware?

The word ransomware is basically from two words, ransome, and malware. As you already know, a ransom is anything valuable e.g. money, that you pay in order to release something or someone from being a hostage (a better example of a ransom is that which is usually demanded by kidnappers so that they can release their hostage). Malware on the other hand is a malicious software. So in a nutshell, a ransomware is a malicious software that holds a user’s resources e.g. data and/or machine hostage (by encrypting the data or locking the machine hence denying the access to it or its very important resources) while demanding a ransom to be paid. Until it is paid, the user will not be able to access the held resources. It is often accompanied with threats to act on the user’s fears but some are real threats. The Cerber ransomware that attacked my machine threatened to delete files if I don’t pay the ransom within two days. The following image gives a timeline of major ransomware attacks experienced over the years.

the ransomware timeline

The origin

Ransomware is entirely driven by encryption. Just to be sure we are on the same page, I would love to discuss what encryption is briefly. The first recognizable form of encryption was used by Julius Caesar. It is called Caesar cipher. Also known as a shift cipher, it is a substitution cipher where each letter in the original message (called the plaintext) is replaced with a letter corresponding to a certain number of letters up or down in the alphabet. That is to say, if you decide to use a shift of 3, then letter A becomes D, letter B become E, and so on. For example, here's the Caesar Cipher encryption of a message, using a right shift of 3.



Cipher text:


The process of converting a plaintext to ciphertext is called encryption.

Clearly, from the above example, it is very difficult for one to understand the cipher text as opposed to the plain text.  If you had the cipher text only and you want the plain text, you have to own the key. The key, in this case, is the number 3. Using the key in converting the ciphertext back to the plaintext is referred to as decryption. Decryption without using the key is what most call code breaking and it involves techniques such as frequency analysis. The Caesar cipher above is just too simple to decode. Encryption techniques such as the shift cipher, hill cipher, RSA, RC4, advanced encryption standard (AES), wired equivalent privacy (WEP), WPA and WPA2 (the ones you use for encrypting your network communications) are some of the examples of encryption algorithms.

There are two variants of encryption, asymmetric and symmetric.

What does “asymmetric” mean and why does that matter? The defining characteristic of public key cryptography is the use of an encryption key by one party to perform either encryption or decryption and the use of another key in the counterpart operation. In symmetric-key algorithms, there is a single key used and shared between receiver and sender, thus the key used by the receiver and sender is “symmetric” because it is the same. The use of multiple keys in asymmetric public key cryptography allows ransomware to encrypt items on a system with a public key while never exposing the private key, thus keeping it secret. For ransomware, this is essential for “mangling” data files without exposing anything that someone could use to figure out how to undo the encryption. So you have to pay a ransom in order to get the key.

Methods of manufacture

Several new ransomware families have been coded in different programming languages, such as JavaScript, PHP, PowerShell, or Python. Attackers used these languages in an effort to evade detection by security products. A number of high-profile ransomware families have also begun to add features beyond the core functionality of locking devices or encrypting files. For example, CryptXXX Contains an additional feature that allows it to gather Bitcoin wallet data and send it to the attackers. Cerber is reportedly capable of adding the infected computer to a botnet which can be used to carry out distributed denial of service (DDoS) attacks. Chimera makes an additional threat in its ransom message. In addition to encrypting files, the malware threatens to post the victims files, including pictures and videos, on the internet. The adoption of these new techniques demonstrates how ransomware is continuously evolving to maintain its foothold and remain profitable.

The major advancement in their manufacture is that they are in the cloud, being offered as a service.  The code name “Ransomware-as-a-Service” means that an affiliate (malware spreader) does not need any special programming skill, simply the willingness to spread the ransomware (typically through email botnets (a network of zombie/infected computers used to infect other computers) that are easy for a non-programmer to set up). The affiliate can sign up as an affiliate and simply download a customized ransomware binary. The malware has custom payment instructions and payment credentials and allows the affiliate to easily take part in the ransomware game.

Ransomware authors are now officially organized gang, and they have made it easy for wannabees and affiliates to participate in their crime chain and spread this malware. The automate ransomware business model includes sophisticated tools such as the telemetry dashboard that reports all kinds of useful information, such as the price for the campaign, the amount paid per binary, the operating system that is infected, time zone, and more. Affiliates now have detailed capabilities to see how effective their campaigns are and can tune their efforts to extract the maximum benefit for themselves (without leaving the comfort of their homes).

The life cycle

Like a normal living entity, malware have a life cycle.

 life cycle of a ransomware


The first step is distribution: Ransomware uses standard methods of distribution. Generally it is spread through phishing schemes involving email attachments or downloads (as in my case) and installs on an endpoint through website compromises. Some also engage malvertisements to welcome you into the butchery. If you think these old ways are too inadequate, consider this 2015 Verizon data breach report (C/O McAfee labs).

why phishing is successful

Clearly, Almost one out of four recipients open phishing messages and, shockingly, more than one out of 10 click on attachments to phishing messages. In addition, nearly half of all recipients open phishing emails and click on the links within the first 60 minutes of receiving the emails.  What is very evident is that the “human operating system” is still the weakest link and need some serious patches.

The second step is infection. The downloaded binary arrives on the user’s computer and starts the processes it needs to complete its malicious activities.

CryptoWall 3 would generate a unique computer identifier, Ensure “reboot survival” by installing the program to run at start-up (through service entry, scheduled task, AutoRun key, etc.). Deactivate shadow copies, start-up repair, and Windows error recovery. Stop Windows Security Center, Windows Defender, Windows Update Service, error reporting, and BITS. Inject itself into explorer.exe and svchost.exe (for now just know these are very important files needed by the OS for optimum functionality). I would then retrieve the external IP address. Ransom32, the world’s first ransomware written in JavaScript had far much devastating method of infection. Watch out for the WannaCry to understand how WannaCry would have done this.

The third step is communications. The ransomware process will talk to encryption-key servers to retrieve the public key needed to encrypt data. CryptoWall 3, for example, connects to a compromised WordPress site and reports its status. All control server traffic is encrypted using the RC4 encryption algorithm.

The fourth step is file search. The ransomware process searches for files on the system in a systematic fashion. It typically looks for files that are important to the user and cannot be easily replicated, such as files with extensions of jpg, docx, xlsx, pptx, and pdf. You won’t believe the number of extensions WannaCry can encrypt.

The fifth step is encryption. This is typically done through moving and renaming the targeted files, then encrypting and renaming the files after a successful encryption.

The sixth and final step is the ransom demand, typically through taking over the screen of the infected endpoint and demanding payment. Messages such as below for WannaCry will be displayed on the screen.

message from WannaCrysecond message from WannaCry

Then you will have to pay for the ransom, get a key from your own resources (e.g. deepweb), or wait for a key to be released by the serious security firms worldwide. But a problem statement still exists here; how could the ransom be paid without exposing the malware author to risk? Send payments to a post office box? Use e-wallets like PayPal? Or would you use M-Pesa? Ask the “AIDS” Trojan ransomware author who tried the post office method and law enforcement officials tracked the money and arrested him (then was very early, no secretive payment methods existed). But now this problem has been flipped upside down. A whole new world of digital currencies exist. I would not spend any of my time trying to break down this cryptocurrency world for this was already done in an earlier article. In a nutshell, they use Cryptocurrencies such as bitcoin. This video would help you understand briefly Bitcoin mining, the process involved in solving an algorithm to generate bitcoin. Another latest advancement in ransomware designs is that they will engage your computer resources to help solve the algorithm for generating the Bitcoin.

 Hopingly this article has aided you in understanding what a ransomware is. Knowledge unapplied is knowledge not gained, and this is exactly why people with effective knowledge succeed while those with the knowledge and papers to prove so, but do not apply this knowledge fail. It is because of this that we (Me and you) will apply this knowledge to analyse the WannaCry ransomware in the next article.  How else can I know if this work helped you if I don’t receive your comment?



Michael Jaroya

He is a technology enthusiast, a writer, and motivator.An individual with the love for humanity..

More in this category: Social engineering attacks revealed »


Bel - May 18,2017 at 05:47 am
Great article as always, can't wait for the analysis of the Wannacry ransomware program. .
Goodie - Sep 06,2019 at 09:22 am
Wow, I really enjoyed reading this article. Great of you to get rid of the spamming comments..
Paul - Sep 06,2019 at 09:30 am
We need more of such articles, Michael. Very well researched..
Tobias - Sep 06,2019 at 09:34 am
Wow! How do we support your work? You clearly take time researching all this and there are no adds in the site..
Ibuxadrext - Oct 12,2019 at 01:10 am
Hi! I could have sworn I’ve been to this blog before but after looking at a few of the posts I realized it’s new to me. Regardless, I’m definitely happy I came across it and I’ll be bookmarking it and checking back frequently!.
DarioNem - Nov 09,2019 at 12:30 am
«А что ещё можно установить для подъездного домофона, чтоб провода дополнительные не прокладывать» - купите себе УКП-66 от Шнайдер Электрик (правда делаются в Марий Эл, но контроль качества остался), там 6 цветовых решений, никаких проводов, правда надо батарейки, но их на несколько лет хватает. Только обязательно разберитесь с совместимостью, с какими-то домофонами она вообще не работает, а с какими-то глючит по разному.
Larryrer - Nov 09,2019 at 02:31 am
Нелегка жизнь студентов кафедры «ТехБез» МИИТа! Зачеты и экзамены сдаются только взятку для к.н. кафедры «ТехБез» МИИТа Сорокиной Екатерины Александровны. К.н. кафедры «ТехБез» МИИТа Сорокина Екатерина Александровна ведет себя беспечно, ввиду того, что действует под прикрытием зав.кафа - Аксенова Владимира Алексеевича.
CKJames - Jan 24,2020 at 09:39 am
Hello. And Bye..
Olegtharse - Jan 31,2020 at 02:59 am
belleUnift - Mar 12,2020 at 11:18 pm
Hi :). I am from Netherlands and i don't know how can i disable my signature? Regards :).
Mixspoup - Mar 14,2020 at 06:04 pm
hi guys :). I am looking for help for me and my girl. i am from France.
Natashakix - Jun 17,2020 at 03:35 am
Anybody home? :) XEvil 4.0: the best anti - ReCaptcha solution XEvil.Net.
Natashakix8807 - Aug 16,2020 at 01:37 pm
Revolutional update of captcha solving package "XRumer 19.0 + XEvil": Captchas regignizing of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Bing, Hotmail, SolveMedia, Yandex, and more than 12000 another subtypes of captchas, with highest precision (80..100%) and highest speed (100 img per second). You can use XEvil 5.0 with any most popular SEO/SMM software: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other programms. Interested? You can find a lot of impessive videos about XEvil in YouTube. Free XEvil Demo available. Good luck ;) .
Ikserst - Dec 21,2020 at 06:44 pm
Здравствуйте! У вас отличный сайт, но я удивлен тем, что у него такие низкие показатели в поисковых системах. Почему? Да, скорее всего, из-за недоверия самих поисковиков к вашему ресурсу. А это значит, что на него очень мало ссылаются других сайтов. То есть, мало ссылок на ваш сайт. Я хочу вам предложить исправить данную ситуацию и проделать работу по наращиванию ссылочной массы на ваш ресурс. Вы получите более 1000 ссылок–доноров на ваш сайт. Эти ссылки будут анкорными и безанкорными, под ваши ключевые фразы, по которым продвигаете свой сайт. А это даст рост позиций, траст, доверие поисковиков, хорошую и быструю индексацию, посещаемость, плюс ИКС! Работа займет примерно 1-2 недели, после которой вы получите долгожданный эффект, которого скорее всего еще ваш сайт не видел. Имеется в виду положительный результат, которому вы будете приятно удивлены. Я работаю на качество, как для себя и очень дорожу своими постоянными клиентами. От вас мне необходима лишь ссылка на ваш сайт и ключевые слова. Стоимость моей услуги составляет всего лишь 9900 рублей, но я готов вам сделать небольшую скидку, чтобы мы с вами подружились и вы заказывали бы продвижение сайта лишь у меня, так как я знаю в этом толк и у меня есть большой опыт. Если вам интересно мое предложение, то пожалуйста свяжитесь со мной по E-mail: С Уважением к вам, Вадим..
Lolita.tikhonovvaMi50 - Dec 25,2020 at 02:21 am
Absolutely NEW update of captcha breaking software "XRumer 19.0 + XEvil": Captcha solving of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Hotmail, MailRu, SolveMedia, Steam, and more than 12000 another categories of captchas, with highest precision (80..100%) and highest speed (100 img per second). You can use XEvil 5.0 with any most popular SEO/SMM software: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other programms. Interested? There are a lot of impessive videos about XEvil in YouTube. FREE DEMO AVAILABLE! See you later! P.S. A Huge Discount -30% for XEvil full version until 15 Jan is AVAILABLE! :) XEvil Net.
XRumerTest - Dec 28,2020 at 08:42 am
Hello. And Bye..
XRumerTest - Dec 30,2020 at 04:40 am
Hello. And Bye..
Lindatrony - Jan 26,2021 at 01:13 am
Anybody home? :) XEvil 4.0: the best anti - ReCaptcha-2 solution XEvil.Net .
buy perfume usa - Jan 28,2021 at 01:56 am
Thank you, I have recently been looking for info approximately this subject for ages and yours is the best I've found out till now. But, what concerning the conclusion? Are you sure in regards to the supply? buy perfume usa

Add Comment