GitHub - python2014/python_sec at 7978650081121a0af10d3944fb8bff0d3ed2c7d8 · GitHub
Skip to content

About

python安全和代码审计相关资料收集 resource collection of python security and code review

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

代码注入、命令执行

1.内置危险函数

exec
execfile
eval

Python eval的常见错误封装及利用原理 Exploiting Python’s Eval

2.标准库危险模块

os
sys
subprocess
commands

3.危险第三方库 Template(user_input) : 模板注入(SSTI)所产生的代码执行 subprocess32 4.反序列化 marshal PyYAML pickle和cpickle shelve PIL unzip 参考:

Python之数据序列化(json、pickle、shelve)

Exploiting Python PIL Module Command Execution Vulnerability

payload构造

前提
	eval+compile
		多语句
	__import__
		__import__是一个函数,并且只接受字符串参数,import 都是在它的基础上实现的。
	importlib

参考 import相关,沙箱绕过 https://xianzhi.aliyun.com/forum/read/2138.html 代码注入 https://www.doyler.net/security-not-included/exploiting-python-code-injection http://www.securitynewspaper.com/2016/11/12/exploiting-python-code-injection-web-applications/ https://sethsec.blogspot.jp/2016/11/exploiting-python-code-injection-in-web.html codereview Python Security Auditing (IV): Command Execution https://www.cdxy.me/?p=747

About

python安全和代码审计相关资料收集 resource collection of python security and code review

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors