基于GitLab數據的還原研究
1.通過oss權限獲取部分不明數據
1.1全部數據及格式分析
1.1.1下載文件中的文件內容
通過oss服務器獲取了一些包含bundle、checksum、list、lsremote后綴文件。
1.list文件內容
2.lsremote文件內容
3.bundle文件內容
bundle中發現有git bundle
4.checksum文件內容
checksum文件內容是哈希校驗值。
1.2git bundle還原
1.2.1git bundle簡介
git bundle 是一種將 Git 倉庫的對象和引用打包到一個文件中的方法。這種文件通常以 .bundle 為擴展名。要“解壓”一個 Git bundle 文件,可以通過 Git 提供的命令將其內容導入到一個 Git 倉庫中。雖然不能直接用傳統的解壓工具(如 unzip)解壓 .bundle 文件,但你可以使用 Git 命令來處理它。
1.2.2git安裝
1. Windows
訪問 Git for Windows 官網(https://git-scm.com/download/win),下載最新的安裝程序(通常是一個 .exe 文件)。https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe
(1)運行安裝程序
雙擊下載的 .exe 文件啟動安裝向導,按照向導的指示進行安裝。大多數用戶可以使用默認設置,但你可以根據需要自定義安裝選項。
(2)驗證安裝
安裝完成后,打開命令提示符(cmd)或 Git Bash。
輸入以下命令確認安裝成功:
git --version
2. macOS安裝
brew install git
3. Linux安裝
(1)Ubuntu/Debian
sudo apt update
sudo apt install git
(2)Fedora
sudo dnf install git
(3)CentOS/RHEL
sudo yum install git
1.2.3Git Bundle相關命令
1.導入 Git Bundle
(1)創建一個新的空 Git 倉庫(如果還沒有的話)
git init new-repo
cd new-repo
(2)將 bundle 文件的內容導入到新的倉庫中
git fetch /path/to/your.bundle
這會將 bundle 文件中的所有對象和引用導入到當前 Git 倉庫中。
(3)檢查 bundle 文件的有效性
git bundle verify /path/to/your.bundle
(4)將 bundle 文件的內容合并到現有的 Git 倉庫中
git merge FETCH_HEAD
這些步驟將使你能夠訪問和使用 Git bundle 文件中的內容。
1.2.4實戰還原
1.確認bundle文件
D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_*****-framework-full-20240309162944.bundle
2.從bundle 文件中獲取數據
git fetch D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_l*****-framework-full-20240309162944.bundle
3.驗證數據
git bundle verify D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_*****-framework-full-20240309162944.bundle
4.查看pack文件
5.查看詳細文件信息
git verify-pack -v .git/objects/pack/pack-a8d9691e57b4675160f9e3487eb5bc4b86716e24.pack
6.直接合并所有文件
git merge FETCH_HEAD