Spring Security OAuth2 远程命令执行漏洞(CVE-2016-4977)
Spring Security OAuth2 远程命令执行漏洞(CVE-2016-4977)
Spring Security OAuth是为Spring框架提供安全认证支持的一个模块。在其使用whitelabel views来处理错误时,由于使用了Springs Expression Language(SpEL),攻击者在被授权的情况下可以通过构造恶意参数来远程执行命令。
漏洞环境
cd vulhub/spring/CVE-2016-4977
docker-compose up -d
漏洞复现
访问http://10.10.10.8:8080/oauth/authorize?response_type=${233*233}&client_id=acme&scope=openid&redirect_uri=http://test。首先需要填写用户名和密码,我们这里填入admin:admin即可。
可见,我们输入时SpEL表达式¥{233*233}已经成功执行并返回结果:
然后,我们使用poc.py来反弹shell的POC
复制poc生成的链接,替换${}部分
成功反弹
java反弹shell,需要将bash编译为base64