forked from laet4x/py-ransomeware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecryptor.py
36 lines (31 loc) · 1000 Bytes
/
decryptor.py
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
import os
import random
import struct
import smtplib
import string
import datetime
import time
import requests
from multiprocessing import Pool
from simplecrypt import encrypt, decrypt
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
files_to_enc = []
key = "PASSWORD"
def decrypt_file(key, in_filename, out_filename=None, chunksize=64*1024):
print in_filename
out_filename = in_filename.split('.')[0]+"."+in_filename.split('.')[1]
filesize = os.path.getsize(in_filename)
with open(in_filename,'rb') as infile:
with open(out_filename, 'wb') as outfile:
ciphertext = decrypt(key,infile.read())
outfile.write(ciphertext)
def selectfiles():
files_to_enc = []
for root, dirs, files in os.walk("C:\\secret\\"):
for file in files:
if file.endswith(".enc"):
decrypt_file(key,os.path.join(root, file))
os.remove(os.path.join(root,file))
pool = Pool(processes=4)
selectfiles()