"Ransomware attacks like WannaCry highlight the critical need for robust cybersecurity measures and regular data backups. They serve as a stark reminder of the vulnerabilities in our interconnected digital world."
Stockholm is a Python-based ransomware simulation tool designed for educational and cybersecurity training purposes. It encrypts files within a specified directory and provides functionality to decrypt them using a generated or provided key. The tool includes options for silent operation, version display, and help documentation.
- File Encryption: Encrypts all files in the specified directory using the
cryptography
library. - File Decryption: Decrypts files using a provided decryption key.
- Silent Mode: Suppresses output to the terminal for a quieter operation.
- Help Menu: Displays usage instructions and available options.
- Version Information: Displays the current version of the tool and system information.
Run the script with the following options:
--help
or--h
: Display the help menu with usage instructions.--version
or--v
: Show the current version of the tool and system information.--r <key>
: Reverse the encryption process using the provided decryption key.--silent
or--s
: Suppress output to the terminal.
Tip: You can modify the target folder for encryption or decryption by changing the directory path in the script. In a real-world scenario, ransomware typically targets sensitive data or the user's home directory.
- Encrypt Files:
python3 stockholm.py
- Decrypt Files:
python3 stockholm.py --reverse <decryption_key>
Note: The
make reverse
option is included for educational and security training purposes. It uses thefilekey.key
generated and stored during encryption. In a real ransomware attack, the decryption key would typically be deleted or withheld, making recovery without the key impossible.
-
Display Help:
python3 stockholm.py --help
-
Show Version:
python3 stockholm.py --version
-
Silent Mode:
python3 stockholm.py --silent
-
Encryption:
- The tool generates a unique encryption key using the
cryptography
library. - All files in the specified directory (
Folders_to_encrypt
) are encrypted. - The encryption key is saved to a file named
filekey.key
.
- The tool generates a unique encryption key using the
-
Decryption:
- The tool uses the provided decryption key to decrypt the files.
- If the key is invalid, an error is raised.
-
File Crawling:
- The tool recursively scans the specified directory to identify all files for encryption or decryption.
-
Output:
- The tool displays the progress of encryption or decryption unless silent mode is enabled.
- Python 3.x
- Required Python libraries:
cryptography
art
scanf
Install the required libraries using pip: