For the complete documentation index, see llms.txt. This page is also available as Markdown.

Gitea

Gitea is a self-hosted Git service similar to GitHub/GitLab. It stores user credentials and may expose sensitive repository data.


Discovery

# Default port: 3000

# Version disclosure at bottom of page
# "Powered by Gitea Version: 1.22.1"

# Check for public repositories
http://TARGET:3000/explore/repos

If registration is enabled, create an account and check whether it becomes the first user. Older Gitea installs may make the first registered user an administrator.

http://TARGET:3000/user/sign_up
http://TARGET:3000/admin

The admin dashboard summary is a quick confirmation:

The Gitea database holds 1 users, 0 organizations, 0 public keys, 0 repositories...

Gitea 1.7.5 CVE-2020-14144 Git Hooks RCE

Gitea 1.7.5 can be vulnerable to authenticated command execution through Git hooks. In the observed path, registration was enabled, the new account became user ID 1, and the account could access /admin.

Version disclosure:

Create an account:

Observed working account:

Use the authenticated hook RCE PoC:

If the exploit reports completion but no shell arrives, verify outbound filtering and try a callback port that is already exposed by the target. In the observed path, 80 did not return a shell, but 3000 did.

Start the listener:

If the PoC creates the temporary local repository but does not trigger the hook, manually push from the temporary repo path printed by the exploit:

Enter the Gitea username and password when prompted. A successful push triggers the hook and returns a shell:

Successful shell context:

Useful process context after exploitation:


Enumeration

Docker Configuration

If Gitea runs in Docker, check docker-compose.yml for mount paths:

This means files at /data/... in container are at /home/developer/gitea/data/... on host.

Important Files

Finding Config Path via Docker


app.ini Secrets

For MySQL-backed installs, app.ini can expose local database credentials:

Connect locally with the configured password:


Extracting Credentials from gitea.db

User Table Output


Cracking Gitea Password Hashes

Gitea uses PBKDF2-HMAC-SHA256 (hashcat mode 10900).

Using gitea2hashcat

Cracking with Hashcat


Useful Paths

Path
Description

/data/gitea/conf/app.ini

Main config (Docker)

/data/gitea/gitea.db

SQLite database

/data/git/repositories/

Git repositories

/data/gitea/sessions/

Session files

/data/gitea/jwt/private.pem

JWT private key

Last updated