Python unpickle 造成任意命令執行漏洞
Path python/unpickle
原理
參考文章:
http://rickgray.me/2015/09/12/django-command-execution-analysis.html
https://www.leavesongs.com/PENETRATION/zhangyue-python-web-code-execute.html
測試
編譯及運行測試環境:
docker-compose build
docker-compose up -d
訪問http://your-ip:8000,顯示Hello {username}!。username是取Cookie變量user,對其進行base64解碼+反序列化后還原的對象中的“username”變量,默認為“Guest”,偽代碼:pickle_decode(base64_decode(cookie[‘user’]))[‘username’] or ‘Guest’。
調用exp.py,反彈shell:

Vulhub 文檔
推薦文章: