Jump to content

Antihack.py me borrrar archivos de mas


Byron Marroquin

Recommended Posts

Hola.

def Pack_1():
    Whitelist = ['__future__.bat','copy_reg.bat','linecache.bat','ntpath.bat','os.bat','site.bat','stat.bat','string.bat','traceback.bat','types.bat','UserDict.bat']
    path =('lib')
    k = os.listdir(path)
    if k != Whitelist:
        for item in k:
            if not item in Whitelist:
                f=open("syserr.txt", "a")
                nombre="%s%s" % (item[0].upper(), item[1:])
                f.write("[ANTI-HACK3]Se ha detectado un archivo mal intencionado (se ha eliminado %s)\n" % nombre)
                f.close()
                #os._exit(0)
                os.remove("lib///"+ str(item))

En Whitelist debes agregar todos los archivos que no son amenazas, pues está borrando todos los archivos que no están en la whitelist, así deberías ir añadiendo:

Whitelist = ['__future__.bat','copy_reg.bat','linecache.bat','ntpath.bat','os.bat','site.bat','stat.bat','string.bat','traceback.bat','types.bat','UserDict.bat','Aifc.pyc','Airmir.pyc','Antigravity.pyc']

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...