-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecrypter.sh
43 lines (33 loc) · 863 Bytes
/
decrypter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
apt-get install python3 -y
apt install python3-pip -y
pip install cryptography
PY_SH=$(cat <<EOF
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import glob
import os
import sys
from cryptography.fernet import Fernet
from pathlib import Path
print("starting...\n")
KEY = Fernet(b'key_generated_by_the_ransomware_and_printed_in_console')
extensions_list = ["pdf", "docx", "xlsx", "png", "jpg", "jpeg"]
def notify(file_path):
try:
with open(file_path, "rb") as encrypted_file:
encrypted = encrypted_file.read()
decrypted = KEY.decrypt(encrypted)
with open(file_path, "wb") as decrypted_file:
decrypted_file.write(decrypted)
print(file_path)
except:
pass
print("decrypting...\n")
for extension in extensions_list:
for file_path in Path("/").rglob("*."+extension):
notify(file_path)
EOF
)
python3 -c "$PY_SH"
rm -f decrypter.sh