14. darkhole_2 靶機

Web

掃目錄

image-20211231130215588

發現存在 .git 備份,於是直接 githacker 嘗試恢復文件

image-20220101144933954

成功恢復的文件

image-20211231130134828

查看這些文件中暴露的信息

login.php

image-20211231130333062

dashboard.php

image-20211231151431944

dashboard 經過編碼,嘗試解碼一次,但剩下的字符無法對齊。非簡單的 10 進制加減變換 ,只能靠猜進行填充。

import re
names = ["dashboard"]

for name in names:
    f = open(name+".php","r",encoding="utf-8")
    str = f.read();
    # str = re.sub(r"\\x[0-9|a-f|A-F]{2}",lambda match: chr(int(match.group().replace("\\x","0x"),base=16)),str)
  
    f = open(name+".php","w",encoding="utf-8")
    
    f.write(str)

彙總收集到的信息

Profiler Name || Krishivalahs
 <link href="/DevanagariBrahmi/logo.png" rel="shortcut icon">
  <meta content="Team Bboysdreamsfell" name="author">
  <!-- <a href="file:///C:/Users/SAURABH%20SINGH/Desktop/HTML5/PROJECTS/Project%201/Project_1.html"><h1>Sign In</h1></a> -->
        <!-- <a href="file:///C:/Users/SAURABH%20SINGH/Desktop/HTML5/PROJECTS/Project%201/P2.html">  <h1>Log In</h1></a> -->

嘗試進行密碼爆破,但失敗了。看下 writeup,提醒 git log

image-20220101144957090

第二個提醒添加了默認口令在 login.php 文件中。那麼進行查看。

image-20220101145009235

登錄進去後發現 id 可以進行注入。手注得密碼。

image-20220101151847234

利用口令 ssh 登錄到終端。

image-20220101151959248

提權

查看計劃任務,發現 losy 用戶會在登陸時定時執行命令

image-20220101152932666

查看該目錄下文件。

image-20220101152942381

那麼就讓其執行 反彈 shell 的命令

image-20220101153733476 image-20220101153749952

成功獲取到 losy 用戶 shell

image-20220101153802650

查看歷史命令,發現執行 python3 獲取sudo shell,並且提示密碼爲 gang

image-20220101154047313

那麼我們獲取 full tty 後,使用sudo 進行提權。

python3 -c 'import pty; pty.spawn("/bin/bash")'

image-20220101154103319

成功獲取到root

image-20220101154209997
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章