天天看點

CTFHUB-資訊洩露-Git

Log

分析過程

首先用dirsearch掃描網站目錄

python3 dirsearch.py -u http://challenge-c7f11f3d275beb6c.sandbox.ctfhub.com:10800 -e * 
           

發現敏感檔案.git

CTFHUB-資訊洩露-Git

使用GitHack工具clone目标源代碼到本地

python2 GitHack.py http://challenge-c7f11f3d275beb6c.sandbox.ctfhub.com:10800/.git  
           
CTFHUB-資訊洩露-Git

在dist目錄中找到.git檔案 GIT BASH 發現addflag版本

CTFHUB-資訊洩露-Git

使用 git reset --hard 回退版本

git reset --hard 2141260d75df0d327d1525af96a627a8b64b3d64

發現一個txt

CTFHUB-資訊洩露-Git

打開即是flag

Stash

考點

Git Stash

分析過程

還是先dirsearch一下 找到敏感檔案 然後GitHack clone一下

CTFHUB-資訊洩露-Git
CTFHUB-資訊洩露-Git

Bash一下

由于題目是Stash 可以執行

git stash list

發現 stash

CTFHUB-資訊洩露-Git

執行

git stash pop

CTFHUB-資訊洩露-Git

發現flag

還可以直接使用

cat .git.refs/stash

打開stash檔案

CTFHUB-資訊洩露-Git

然後執行

git diff

比較工作區和暫存區

CTFHUB-資訊洩露-Git

注:

git stash # git stash指令會将倉庫中的修改儲存,建立一條stash資訊,預設的說明資訊是最後一次送出的節點号和送出說明。

git stash save #‘說明資訊’與1的效果一樣,說明資訊是指定的内容,更加利于了解stash的内容。

git stash list #列出目前倉庫下所有的stash條目,每一條stash用stash@{n}辨別。

git stash pop [stash] # 将stash的内容彈出,預設彈出最上面的那條,即stash@{0}。此外還可以在pop後加stash@{n}來指定要彈出的stash條目。

git stash drop [stash] #丢棄stash條目,預設丢棄最上面的那條,即stash@{0},此外還可以在drop後加stash@{n}來指定要丢棄的stash條目。

git stash clear #清除所有的stash條目。

git show stash@{n} #當有多條記錄并且過了一段時間忘記stash内容時通過該指令可以檢視stash的具體内容

Index

還是dirsearch 之後GitHack

CTFHUB-資訊洩露-Git

打開這個檔案直接就在了。。

flag