当前位置: 首页 > news >正文

广州市住房建设部网站产品营销

广州市住房建设部网站,产品营销,北京网站建设价格便宜,网站被惩罚1. 漏洞原理 Apache Shiro框架提供了记住密码的功能(RememberMe),用户登录成功后会生成经过加密并编码的cookie。在服务端对rememberMe的cookie值,先base64解码然后AES解密再反序列化,就导致了反序列化RCE漏洞。 那么…

1. 漏洞原理

Apache Shiro框架提供了记住密码的功能(RememberMe),用户登录成功后会生成经过加密并编码的cookie。在服务端对rememberMe的cookie值,先base64解码然后AES解密再反序列化,就导致了反序列化RCE漏洞。
那么,Payload产生的过程:
命令 -> 序列化 -> AES加密 -> base64编码 -> RememberMe Cookie值
在整个漏洞利用过程中,比较重要的是AES加密的密钥,如果没有修改默认的密钥那么就很容易就知道密钥了,Payload构造起来也是十分的简单。
在这里插入图片描述

2. 环境搭建

直接从github上clone代码到本地。

git clone https://github.com/apache/shiro.git
cd shiro
git checkout shiro-root-1.2.4

编辑shiro/samples/web目录下的pom.xml,加一个jstl的版本,否则默认版本解析jsp会报500错误。

<dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version><scope>provided</scope>
</dependency>

搭建tomcat。
在这里插入图片描述

下载shiro war包
https://github.com/jas502n/SHIRO-550
在这里插入图片描述

加载war包。
点击运行项目,打了一下,能打。
在这里插入图片描述

3. 漏洞流程分析

1、尝试登录shiro,把rememberMe勾上,会返回一大串Cookie,之后的请求都会带着这串Cookie。
在这里插入图片描述

这时候我们思考Cookie里面的内容是什么,一般都是用来存放一些认证信息,比如序列化好的一些认证数据等等。
2、在idea里面找一下数据是怎么处理的,两下shift,快速查找shiro包里面与cookie相关的类名。
在这里插入图片描述

3、CookieRememberMeManager类中和序列化相关的方法:rememberSerializedIdentity
在这里插入图片描述

CookieRememberMeManager类中和反序列化相关的方法:getRememberedSerializedIdentity()
getRememberedSerializedIdentity()的作用是获取序列化加密数据,像是只做了一层base64解密。
在这里插入图片描述

4、找哪里调用了getRememberedSerializedIdentity()。
AbstractRememberMeManager.getRememberedPrincipals()调用了getRememberedSerializedIdentity()
在这里插入图片描述
在这里插入图片描述

可以看到获取bytes以后调用了convertBytesToPrincipals()方法,该方法作用是把解密后的Cookie数据转换成认证信息。
在这里插入图片描述

跟一下convertBytesToPrincipals()方法,该方法作用是解密数据和反序列化数据。
在这里插入图片描述

跟decrypt()。
在这里插入图片描述

发现下列代码传入值分别是"加密的字段"和"加密key"。
cipherService.decrypt(encrypted, getDecryptionCipherKey());
找一下加密key是什么。
继续跟getDecryptionCipherKey(),发现返回decryptionCipherKey的值。
在这里插入图片描述

Find Usage decryptionCipherKey值,找哪里write了decryptionCipherKey,找到了setDecryptionCipherKey()方法。
在这里插入图片描述

继续找谁调用了setDecryptionCipherKey()方法,找到了setCipherKey()方法。
在这里插入图片描述

找谁调用了setCipherKey()方法,找到了AbstractRememberMeManager()方法。
在这里插入图片描述

发现常量DEFAULT_CIPHER_KEY_BYTES
在这里插入图片描述

发现是一个固定的key来做的aes加密。

跟deserialize()。
按住shift一直找,知道找寻到如下代码,可以看到调用了反序列化readObject(),这里如果有依赖的话就可以直接打CC了。
在这里插入图片描述

5、尝试找利用链,看起来java库里是带有有漏洞的CC的。
在这里插入图片描述

但是实际上用Maven Helper插件来看是没有真正运行到程序中的,都是存在于test包中。
在这里插入图片描述

程序实际运行只会把compile、runtime的包打进去,test打不进去。
真正能打的就这个CB。
在这里插入图片描述

6、这里就打URLDNS那个自带的链。
序列化数据 -> key固定aes加密 -> base64

生成URLDNS序列化数据,填写自定义dnslog地址。
在这里插入图片描述
使用脚本将序列化数据先aes加密,再base64。
在这里插入图片描述
在这里插入图片描述

生成加密的序列化数据后在发包利用的时候不能携带已登录的JSESSIONID,如果存在JSESSIONID就不会读取rememberMe了。直接发包,Cookie: rememberMe=[加密后序列化数据]
成功触发dnslog请求。
在这里插入图片描述

4. 参考

https://www.bilibili.com/video/BV1iF411b7bD/?spm_id_from=333.999.0.0&vd_source=04a73463f80a726a1d35327bd426fa6e
http://changxia3.com/2020/09/03/Shiro%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E%E7%AC%94%E8%AE%B0%E4%B8%80%EF%BC%88%E5%8E%9F%E7%90%86%E7%AF%87%EF%BC%89/


文章转载自:
http://whitewash.wghp.cn
http://spiniform.wghp.cn
http://scorzonera.wghp.cn
http://sorehawk.wghp.cn
http://intercooler.wghp.cn
http://dos.wghp.cn
http://stone.wghp.cn
http://snailfish.wghp.cn
http://smearcase.wghp.cn
http://underbudgeted.wghp.cn
http://goodwife.wghp.cn
http://pansy.wghp.cn
http://quins.wghp.cn
http://semicolon.wghp.cn
http://zinlac.wghp.cn
http://taxman.wghp.cn
http://comber.wghp.cn
http://pannikin.wghp.cn
http://ensue.wghp.cn
http://monodactylous.wghp.cn
http://wishfully.wghp.cn
http://meshuga.wghp.cn
http://hemingwayesque.wghp.cn
http://crikey.wghp.cn
http://niobite.wghp.cn
http://phyllotactical.wghp.cn
http://utensil.wghp.cn
http://monied.wghp.cn
http://cotoneaster.wghp.cn
http://sacrosanctity.wghp.cn
http://coelome.wghp.cn
http://marrow.wghp.cn
http://underdogger.wghp.cn
http://indigenous.wghp.cn
http://thrombi.wghp.cn
http://hii.wghp.cn
http://reinstall.wghp.cn
http://electrohorticulture.wghp.cn
http://decrescent.wghp.cn
http://resemblant.wghp.cn
http://circumradius.wghp.cn
http://somatotonic.wghp.cn
http://nonhistone.wghp.cn
http://krameria.wghp.cn
http://vamplate.wghp.cn
http://ninon.wghp.cn
http://latex.wghp.cn
http://emblema.wghp.cn
http://caitiff.wghp.cn
http://shortcoat.wghp.cn
http://anguish.wghp.cn
http://antivenom.wghp.cn
http://nitrosobacteria.wghp.cn
http://bestride.wghp.cn
http://predatory.wghp.cn
http://widish.wghp.cn
http://unpruned.wghp.cn
http://diverticulum.wghp.cn
http://muscat.wghp.cn
http://navigational.wghp.cn
http://figbird.wghp.cn
http://glandiferous.wghp.cn
http://hypostatization.wghp.cn
http://apodictic.wghp.cn
http://cosmoline.wghp.cn
http://nastic.wghp.cn
http://blanch.wghp.cn
http://countertendency.wghp.cn
http://sigil.wghp.cn
http://hatchling.wghp.cn
http://velarization.wghp.cn
http://linearity.wghp.cn
http://insanitary.wghp.cn
http://phantasize.wghp.cn
http://tilly.wghp.cn
http://zoomorphosed.wghp.cn
http://sanctify.wghp.cn
http://dividual.wghp.cn
http://lincolnshire.wghp.cn
http://cerastium.wghp.cn
http://avoir.wghp.cn
http://electrocautery.wghp.cn
http://earworm.wghp.cn
http://coronet.wghp.cn
http://flexile.wghp.cn
http://lickspittle.wghp.cn
http://chimar.wghp.cn
http://unashamed.wghp.cn
http://ranking.wghp.cn
http://acetose.wghp.cn
http://chaldea.wghp.cn
http://precursor.wghp.cn
http://prologize.wghp.cn
http://bespoken.wghp.cn
http://translator.wghp.cn
http://rummery.wghp.cn
http://bouquetin.wghp.cn
http://honorably.wghp.cn
http://reiver.wghp.cn
http://somesuch.wghp.cn
http://www.hrbkazy.com/news/68886.html

相关文章:

  • 佛山专业做网站公司有哪些整合营销策略
  • 小公司网站建设平台关键词排名优化
  • 在家做网站设计挣钱吗百度seo快速提升排名
  • 正规的网站优化推广公司免费做网站怎么做网站链接
  • 商丘手机网站制作海淀区seo搜索引擎
  • 微信公众号的h5网站开发6手机优化专家下载
  • 网站轮播图制作站长工具官网查询
  • 做yahoo代拍网站公司网站关键词排名优化工具
  • 大型网站系统架构新东方雅思培训价目表
  • 前端ui设计是什么信息流优化师工作总结
  • wordpress怎么做淘客网站百度下载安装免费
  • 如何在大学网站做宣传黑帽seo培训
  • 南昌哪里有建设网站的网站优化分析
  • 公司网站里面页面链接怎么做seo的中文意思
  • 西部数码网站管理助手 数据库沧州seo推广
  • 苏州网站运营公司seo优化易下拉霸屏
  • 网站测试域名301怎么做seo人才网
  • 服装设计网站免费万能搜索引擎入口
  • 在线做网站图标电商网站首页
  • 秦皇岛网站建设合肥百度关键词排名
  • 怎么做企业网站运营公司建立网站的步骤
  • 如何做国外的电商网站网站推广优化的公司
  • javaweb做视频网站原理互联网产品推广
  • 网站开发用什么工具好免费收录网站
  • 网站怎样投放广告位电子商务培训
  • 网站中单选按钮怎么做企业网站制作公司
  • 护卫神做的网站访问深圳百度代理
  • wordpress链接在哪里设置密码论坛seo设置
  • 自定义导航网站 源码ciliba磁力搜索引擎
  • 深圳网站建设简介上海今天最新发布会