Git Product home page Git Product logo

rust-ransomware's Introduction

Rust-Ransomware

1. What is this?

This is a Windows ransomware I wrote 100% in Rust. The GUI for the ransomnote is written in Python's tkinter because I am too lazy to code my GUI using WinAPI.

2. Overview of how it works

This ransomware first checks if this is the first time it's running by checking the existence of a file called encrypt_date.txt. If this file exists, then this is not the first time the malware is ran.

If the file does not exist, the malware starts the enryption process.

First, it checks for admin priviledges, and if the process does not have admin rights, it will attempt to elevate by asking the user's permission through UAC.

Second, after gaining admin priviledges, it will add itself to the registry Software\Microsoft\Windows\CurrentVersion\Run to maintain persistence after the machine reboots. Since this malware is ran every time the machine reboots, we need the file check above to know if we need to encrypt files or not.

Third, after adding itself to the registry, it will traverse and encrypt all personal files on the user's system and display the ransomnote. After encrypting, it will write the date into encrypt_date.txt. The files encrypted will have an extension of .peter at the end.

If the machine reboots and is already encrypted, it will just display the ransomnote. The ransomnote will display the countdown 1 month from the time in encrypt_date.txt. Once the countdown is done, it will write \x99\x99 into the file and restart the computer.

Whenever the encrypt_date.txt is read and the bytes returned are \x99\x99, all the files will be deleted.

3. How to install

Download the ransomware here. Make sure that both the executables are in the same directory for it to work.

This ransomware does not required Internet access to work. Simply downloading and doubleclicking on the Rust-Ransomware.exe file are sufficient to run.

4. Component

  1. Anti-reversing techniques

    I used most of the techniques found here

  2. Encryption

    In the /src/encryption.rs, you can see how I use a hardcoded AES key to encrypt my files.

    This is certainly not the best approach for encryption, so I will work on implementing a hybrid version between AES and RSA like how WannaCry did.

5. Ransom Request

You can edit and change the ransom request in ransomnote.py, then compile it into an executable using PyInstaller.

6. Test Run

Alt text

6. NOTE

This ransomware is only for educational purposes.

Please be considerate when installing and running this malware, as it can serious cause damage to the machine that you are running it on.

I coded this in to learn more about WinAPI and malware development, and I do not intend for anyone to use this for malicious purposes.

Therefore, I am not to be held responsible by anyone to any lost to damaged property as a result of using this malware.

rust-ransomware's People

Contributors

cdong1012 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.