Exploiting Version Control Systems

null meet Bangalore

29 August 2015

Abstract

This session will focus on how to exploit a scenario where Version control related data is publicly exposed.

what kind of juicy data can be extracted from the files as well as how you can leverage this for exploitation.

Slides

AI Generated Summary

AI Generated Content Disclaimer

Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.

This presentation covers the exploitation of publicly exposed version control system (VCS) directories on web servers, demonstrating how developers who deploy code via Git, SVN, or Mercurial can inadvertently expose their entire source code repository. Anant Shrivastava walks through VCS directory structures, predictable file paths for detection, available extraction tools, and live demos of extracting source code both with and without directory listing enabled.

Key Topics Covered

Actionable Takeaways

  1. Never deploy VCS metadata directories (.git, .svn, .hg) to production web servers — add explicit deny rules in your web server configuration to block access to these directories.
  2. During penetration tests, always probe for VCS directories by checking predictable paths like .git/HEAD, .svn/entries, .svn/wc.db, and .hg/requires on target web servers.
  3. Use automated tools like svn-extractor, DVCS-pillage, or dvcs-ripper to reconstruct source code from exposed VCS directories, even when directory listing is disabled.
  4. Check .gitignore files when discovered, as they reveal the names of files and directories the developer considered sensitive enough to exclude from version control.
  5. If using auto-deployment from VCS, ensure the deployment process strips VCS metadata or that web server rules prevent access to hidden directories.
  6. Include VCS directory exposure checks in your standard security scanning and CI/CD pipeline to catch accidental deployments before they reach production.

Social chatter