基本环境
$ sudo apt-get install libxml2-dev libxslt1-dev
$ sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl
DEMO:
$ git clone https://github.com/CHYbeta/CVE-2017-11427-DEMO.git
$ cd CVE-2017-11427-DEMO
$ source venv/bin/active
$ cd vuln_saml
$ python index.py
账号:
username: user_evil
password: iamuser1
email: [email protected]
username: user_normal
password: iamuser2
email: [email protected]
首先登录用户 user_evil。用burp截取SAMLResponse字段值。

选择Action-> send to repeater,为后续做准备。
接着Forward,使用户 user_evil 认证成功。

将上述的SAMLResponse字段值先进行一次urldecode,然后去掉换行符,最后进行base64解码。将解码后的xml文件中的emailAddress和Attribute修改为[email protected]<!-- -->.evil,也即在原本认证用户的邮箱[email protected]之间插入了注释。

接着将修改后的xml进行base64编码,接着urlencode,替换原本的SAMLResponse值,获得新的session

用这个新的session去登录:

user.email已经变为[email protected],登录用户user_normal成功。