Git Daemon Service Detection
Git daemon serves repositories over the git:// protocol on port 9418. It is typically deployed for fast, unauthenticated read-only access to public repositories, but is frequently misconfigured to expose internal repositories that should not be publicly accessible. The service itself provides no authentication — any repository marked with a git-daemon-export-ok file is accessible to any connecting client. Detection is straightforward; the interesting work is in what the repositories contain.
Port Detection
9418/tcp open git Git
Protocol Probe — Confirm Response
The git protocol uses a pkt-line format. Send a minimal upload-pack request to confirm the daemon is responding and read the initial ref advertisement:
HEAD refs/heads/main refs/heads/develop refs/tags/v1.0 refs/tags/v2.3
Ref names in the response confirm the repository exists and is accessible. Branch names and tags are immediately visible — develop and feature branches often contain work-in-progress code with more secrets than the main branch.
nmap Script Enumeration
Probe Common Repository Names
Git daemon does not list available repositories — you need to guess names. Test common repository names and check which ones respond with ref data:
FOUND: git://10.10.10.50/repo.git FOUND: git://10.10.10.50/config.git
A config repository is an immediate high-value target — it likely contains deployment configurations, credentials, and infrastructure details. Move to repository enumeration to explore the found repos before cloning.
References
-
git-daemon documentationgit-scm.com/docs/git-daemon (opens in new tab)
git-daemon-export-ok, base-path, and access control configuration
Was this helpful?
Your feedback helps improve this page.