CTFHub_ Skill Tree_Web Information Leakage-"Git Leak"-"Log", "Stash", "Index"

1. "Log"

Open environment

Insert picture description here
Scan with dirsearch and found git leak

python dirsearch.py -u <url> -e *

Insert picture description here
Clone the directory with Githack

Note that you need python2 environment and Git installation

python2 Githack.py <url>

Insert picture description here

Insert picture description here
Now that the log is prompted, check the log record

git log

Insert picture description here
Found that there are records with added flags.
There are two ideas at this time

Method one, git reset

Use git resetrollback to the previous version to get the flag file

git reset --hard <commit>

Insert picture description here

Method two, git diff

Use git diffthe difference between the current version and the previous version to get the flag

git diff <commit>

Insert picture description here

2. "Stash"

Similarly, clone to local

Insert picture description here
Open ./.gitfound stash file

stash can be understood as a cache file of git

Insert picture description here
Use notepad++ to open to get the version number information

Insert picture description here
Then you can get the flag by using rollback or comparison

Insert picture description here

3. "Index"

The flag can be obtained directly after cloning to the local

Insert picture description here

Finish

Welcome to leave a message in the comment area.
Thanks for browsing

Guess you like

Origin blog.csdn.net/Xxy605/article/details/109283778