-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathransomware_decrypt.py
143 lines (120 loc) · 6.85 KB
/
ransomware_decrypt.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
from cryptography.fernet import Fernet
import os
import colorama
from colorama import Fore,Back,Style
from time import sleep
import time
def clearConsole():
command = 'clear'
if os.name in ('nt', 'dos'):
command = 'cls'
os.system(command)
def ransomdecrypt():
def cargar_key():
return open ('key.key', 'rb').read()
def decrypt(items, key):
f = Fernet(key)
for item in items:
with open(item, 'rb') as file:
encrypted_data = file.read()
decrypted_data = f.decrypt(encrypted_data)
with open(item, 'wb') as file:
file.write(decrypted_data)
def stt():
try:
while True:
clearConsole()
print(Fore.RED+'''
.------------. ▄▄▄ ▄▄▄· ▐ ▄ .▄▄ · • ▌ ▄ ·. ▄▄▌ ▐ ▄▌ ▄▄▄· ▄▄▄ ▄▄▄ .
|.----------.| ▀▄ █·▐█ ▀█ •█▌▐█▐█ ▀. ▪ ·██ ▐███▪██· █▌▐█▐█ ▀█ ▀▄ █·▀▄.▀·
||>unlock# || ▐▀▀▄ ▄█▀▀█ ▐█▐▐▌▄▀▀▀█▄ ▄█▀▄ ▐█ ▌▐▌▐█·██▪▐█▐▐▌▄█▀▀█ ▐▀▀▄ ▐▀▀▪▄
|| || ▐█•█▌▐█ ▪▐▌██▐█▌▐█▄▪▐█▐█▌.▐▌██ ██▌▐█▌▐█▌██▐█▌▐█ ▪▐▌▐█•█▌▐█▄▄▌
|"----------'|. ▀ ▀ ▀ ▀ ▀▀ █▪ ▀▀▀▀ ▀█▄▀▪▀▀ █▪▀▀▀ ▀▀▀▀ ▀▪ ▀ ▀ .▀ ▀ ▀▀▀
.-^------------^-.
|by:'''+Fore.MAGENTA+''' b i y i v i'''+Fore.RED+'''|
"----------------'
'''+Style.RESET_ALL)
path_to_encrypt = input(Fore.RED+"*)"+Fore.YELLOW+"Ubicación del archivo (ejemplo: C:\\Users\\User\\Desktop\\Nom_Carpeta): "+Fore.GREEN)
txt=input( Fore.RED+"*)"+Fore.YELLOW+"Ingresar el nombre del archivo .txt(sin la extencion '.txt'): "+Fore.GREEN)
os.remove(path_to_encrypt+'\\'+txt+'.txt')
s=Fore.RED+Style.BRIGHT+"Proceso terminado.."
for i in s:
print (i, end="", flush=True)
sleep(0.1)
print("")
print(Fore.YELLOW+"Elige una opcion:")
print(Fore.RED+"1)"+Fore.MAGENTA+"Utilizar el script otra vez")
print(Fore.RED+"2)"+Fore.MAGENTA+"Salir")
rp=int(input(Fore.GREEN+">> "))
if rp==1:
stt()
elif rp==2:
exit()
else:
print(Fore.RED+"Opcion invalida!")
time.sleep(2)
items = os.listdir(path_to_encrypt)
full_path = [path_to_encrypt+'\\'+item for item in items]
key = cargar_key()
decrypt(full_path, key)
except Exception as e:
print("")
print(Fore.RED+"--Error--\nRazon:",e)
time.sleep(4)
stt()
except KeyboardInterrupt:
print("")
print(Fore.RED+Style.BRIGHT+"\nDetenido por el usuario"+Fore.RESET)
time.sleep(2)
print(Fore.MAGENTA+Style.BRIGHT+'''
,,.*((####(###(//***, ***
/./#################(/********** .(
.(#####################(/************** *.
,%########################(/***************** ,
.##########################(//********************,
,(#############################/*********************.,
*##############################//*********************** .
/###############################(/************************ ,
*###############################(/**************************
.###############################(//****** . .. . ... ******.
.################################(((/*** *********** .*** *
/(################################(//****************************
,##################################(/*********** *******
,#########(#########(/##############//***** *, .******** *****
,########( .##((#########(/**. ,*****. .*************/
,#################/ .########(/ ********* *************/,
/(####################/ .#####(/*******/*, .. ,***/*.***,*
((###########(/***/((#############(/***, ,.****,,***,,,.. .****.(
./##########/. ,##########(/**. ,,. ,**..
,################################//****, ..,,*, , /*********
################################(/************ ************
((###############################(//*********** ************(
,###############################(/***********, ***********.
*(#############################(/******* *************** .*/,
.#############################(/******** . ..,,. .**.
.(##################. ,#######(/** * .,,,,*,,,,,,, */*.
,/##################### ,(###(. ,,,,,,,,,,,,,,, ,, ***,
(//#########################(*,,,,,,,,,,,,,,. ,.,* ,/
,*,#######################(/*,,,,,,,,.. ,,,.**. /
.(,####################/. ..,,, .. ** *.
/(*/###################(**,,... .,.**.* ,./
.#,(##################(*,,,,, **** **./
*(,(###############/**********, ** * /
//#,##############(/******* *** *,(
#,#*(###########//********,,*.(
.(#/#########//****** **.
.(########//*****,.*
,.*(##(//* ./
# Redes sociales:
# Youtube: biyivi
https://www.youtube.com/channel/UCRitJ4OwEQmpk_aEPK9INkw
# Instagram: @b.i.y.i.v.i
https://www.instagram.com/b.i.y.i.v.i/
# TikTok: @biyivi
https://www.tiktok.com/@biyivi
# github: biyivi
https://github.com/biyivi
Adios :)
''')
stt()
ransomdecrypt()