Skip to content

rahulrajdixit/Ransomware-Script-For-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ransomware-Script

Please Note

Warning

Please consider running these scripts only if you can clearly understand the workings of the script. It is advised to go through the code before running it. If you like to tinker with these scripts, then please consider running them in a safe environment (For example: in a virtual machine).

Important

These are Python scripts just to demonstrate the working process of a simple ransomware. Actual ransomware has a much more complex working process and is not as simple as these scripts.

Note

The tool can only encrypt and decrypt files (and not folders) within the same directory of the Python scripts. This project was developed out of curiosity with the help of some references. Please do not misuse the script and use it only for educational/demonstration purposes.

Introduction

These Python scripts encrypt and decrypt the files within the same directory using Fernet Encryption.

The folder consists of 2 scripts:

  • encrypt.py: For encrypting all the files using Fernet Encryption
  • decrypt.py: For decrypting all the files.

A separate file named "key_file.key" is generated during the encryption process, and the key present within this file is used during the decryption process. Please note that the generated key is unique every time "encrypt.py" script is run, and the key within "key_file.key" is replaced every time.

A password is required during the decryption process, which is asked by the script. The current password to decrypt the files is ransome (Check line 37 of decrypt.py file for a better understanding).


How to use it?

  1. Download the zip file, and extract it. The scripts should be in the Ransomware-Script-main folder.
  2. (optional) Add additional files which you would like to encrypt into the Ransomware-Script-main folder.
  3. Try to open Test_PDF_File.py and test_file.txt to see if data is present.
  4. Encrypt all the files within the folder (except encrypt.py, decrypt.py and key_file.key (which will be generated during the encryption process)). Use the following command in the present-working-directory:-
python encrypt.py
  1. Try to open the encrypted files Test_PDF_File.py and test_file.txt and view their content.
  2. Decrypt the files using using the command:-
python decrypt.py

PLEASE NOTE: The script will ask for a password before decrypting the file. The password is: ransome. (Check the below given example)

  1. Try to view the files again. This time, they should be decrypted back.

Example

Here, we can see all the files from the zip file.

image

And here, we can see the files with their content without encryption.

image

Now, we encrypt the files.

image

Here, we can see, that the data is encrypted, hence the following output.

image

Now, we decrypt the files.

image

And here, we have recovered the files back after the decryption process.

image

Releases

No releases published

Packages

No packages published

Languages