Created
May 7, 2025 01:29
-
-
Save HouqiyuA/50735ade87344e34f53a626b249feb82 to your computer and use it in GitHub Desktop.
gitea-versio leak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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