Common Web Vulnerability - PHP
  • Introduction to Common Web Vulnerability
  • LFI (Local File Inclusion)
  • SQL Injection
  • OS Command Injection
  • Remote Code Injection
  • Cross Site Scripting
  • Insecure File Upload
  • IDOR (Insecure Direct Object Referrence)
  • RFI(Remote File Inclusion)
  • Broken Access Control
  • Broken Authorization
  • Source code disclosure
  • php type juggling
  • git of terror
Powered by GitBook
On this page

git of terror

Previousphp type juggling

Last updated 1 year ago

Risks of Exposing the .git Folder:

  1. Source Code Exposure: The .git folder contains the entire history of changes made to the source code, including sensitive information such as passwords, API keys, and database credentials that may have been accidentally committed.

  2. Security Vulnerability Identification: Attackers can analyze the commit history to identify security vulnerabilities, such as hardcoded credentials, debug code, or sensitive information disclosures, that may have been introduced into the codebase.

  3. Configuration Disclosure: The .git/config file may contain sensitive configuration settings, such as remote repository URLs or deployment keys, which can be leveraged by attackers to gain unauthorized access or control over the repository.

Mitigation Strategies:

To mitigate the risk of exposing the .git folder in the var/www/html directory, consider the following measures:

  1. Disable Directory Listing: Ensure that directory listing is disabled on the web server to prevent users from browsing directory contents, including the .git folder.

  2. Remove the .git Folder: Remove the .git folder from the var/www/html directory if it is not required for deployment or development purposes. Be cautious when deleting files and folders to avoid unintended data loss.

  3. Gitignore Sensitive Files: Use a .gitignore file to specify files and directories that should not be tracked by Git, including configuration files, environment-specific settings, and sensitive data.

  4. Restrict Access: Configure proper file permissions and access controls to restrict access to sensitive directories and files, such as the .git folder, to authorized users only.

  5. Regular Auditing: Conduct regular audits of the web server's file system to identify and remediate any inadvertently exposed files or directories, including the .git folder.

  6. Security Testing: Perform security testing, including vulnerability scanning and penetration testing, to identify and address any security vulnerabilities introduced by inadvertently exposed files or directories.

Dumping data from .git

cd GitTools/Dumper
chmod +x gitdumper.sh
./gitdumper.sh http://target.tld/.git/ dest-dir
cd dest-dir
git checkout .
GitHub - internetwache/GitTools: A repository with 3 tools for pwn'ing websites with .git repositories availableGitHub
Download gittools
Logo