PortSwigger Lab: Information disclosure in version control history
Step 4: Exploring /.git contentPress enter or click to view image in full sizeOnce the crawling is c 2026-4-10 08:24:43 Author: infosecwriteups.com(查看原文) 阅读量:11 收藏

Step 4: Exploring /.git content

Press enter or click to view image in full size

Once the crawling is completed, you will see a path named .git. We’ll explore that directory. Go to the address bar, add /.git, and press Enter.

You will see some files related to Git.

Press enter or click to view image in full size

To analyze these files, we need to download a copy of the entire directory using the following command:

wget -r https://0aef00d6038cfdc382dd38d3007d002e.web-security-academy.net/.git

This will start downloading the entire content of .git to your Kali Linux system.

Press enter or click to view image in full size

Note: The URL may change due to inactivity, so you might need to start a new session. However, the steps remain the same.

Get Nikhil Bhandari’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

Once the download is completed, navigate to the downloaded directory (e.g., "0a8900ac0499438880ce7b2b001a00ae.web-security-academy.net") using the cd command.

Once you’re inside this directory, use:

ls -al

Press enter or click to view image in full size

Once you’re inside this directory use “ls -al” to display the hidden files and folders. Once command is executed you’ll se .git folder. Navigate to that folder and once again execute “ls -al” command, you’ll see the following files:

Press enter or click to view image in full size

to display hidden files and folders. After executing the command, you will see the .git folder. Navigate to that folder and run ls -al again to view its contents.

Now, to read the contents of the config file you need to use an application called git-cola.

Press enter or click to view image in full size

In the terminal, type:

git-cola

A window will pop up. Here, you will see two files: admin.conf and admin_panel.php. When you select admin.conf, you will see a line at the bottom containing "ADMIN_PASSWORD".

Press enter or click to view image in full size

To view the previous commit of that file, go to Commit in the toolbar and click on Amend Last Commit.

You will see a previous version of admin.conf, which contains the admin password.

This is how we found the administrator password.

Press enter or click to view image in full size

Using the found password, log in to the administrator account.

Press enter or click to view image in full size

Once logged in, click on the Admin Panel.

Press enter or click to view image in full size

You will be redirected to the Users page, where you can see two users: Weiner and Carlos. To complete the lab, you need to delete Carlos.

Step 5: Completing the Lab

Press enter or click to view image in full size

Once you delete Carlos, check your browser, and you will see the message:
“Congratulations, you have solved the lab.”

That’s it! You’ve successfully solved the Information disclosure in version control history lab.

Thank you for taking the time to read my article!
I hope you found it informative and valuable. If you enjoyed it, please consider liking the article, following me for more content, and sharing it with others who might benefit from it. Your support means a lot!


文章来源: https://infosecwriteups.com/portswigger-lab-information-disclosure-in-version-control-history-8c69ddf0cfca?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh