Esempio n. 1
0
def showDownloads():
    d = download.download()
    files = d.getlist()
    if files:
        for i in xrange(len(files)):
            files[i]['id'] = i
        return json.dumps(files)
    return '[]'
Esempio n. 2
0
def showDownloads():
    d = download.download()
    files = d.getlist()
    if files:
        for i in xrange(len(files)):
            files[i]["id"] = i
        return json.dumps(files)
    return "[]"
Esempio n. 3
0
def uploadToServer():
    f = request.files['file']
    if f:
        originalname = secure_filename(f.filename)
        data = f.read()
        filename = hashlib.md5(data).hexdigest()
        with open(config.download_dir + os.sep + filename, 'w') as fp:
            fp.write(data)
        d = download.download()
        d.add(originalname, filename)
        return '<p style="color:white">Upload success <a style="color:white" target="_Blank" href="download?filename=' + filename + '">' + filename + '</a></p>'
    return 'error'
Esempio n. 4
0
def setDownload():
    signature = request.form.get("signature").strip()
    originalname = request.form.get("filename").strip()
    savePath = request.form.get("savePath").strip()
    a = action.action()
    p = payload.payload()
    d = download.download()
    filename = d.getbyname(originalname)["filename"]
    originalname = d.getbyname(originalname)["originalname"]
    savePath += "\\" + originalname
    pid = md5(str(time.time()) + config.SECRET_KEY + signature + originalname + savePath + str(random.random()))
    exploit = p.download(filename, savePath)
    a.add(pid, signature, "[download] " + originalname + "(" + filename + ")" + " [savepath] " + savePath, exploit)
    return pid
Esempio n. 5
0
def setDownload():
    signature = request.form.get('signature').strip()
    originalname = request.form.get('filename').strip()
    savePath = request.form.get('savePath').strip()
    a = action.action()
    p = payload.payload()
    d = download.download()
    filename = d.getbyname(originalname)['filename']
    pid = md5(
        str(time.time()) + config.SECRET_KEY + signature + originalname +
        savePath + str(random.random()))
    exploit = p.download(filename, savePath)
    a.add(
        pid, signature, '[download] ' + originalname + '(' + filename + ')' +
        ' [savepath] ' + savePath, exploit)
    return pid
Esempio n. 6
0
def uploadToServer():
    f = request.files["file"]
    if f:
        originalname = secure_filename(f.filename)
        data = f.read()
        filename = hashlib.md5(data).hexdigest()
        with open(config.download_dir + os.sep + filename, "wb") as fp:
            fp.write(data)
        d = download.download()
        d.add(originalname, filename)
        return (
            '<p style="color:white">Upload success <a style="color:white" target="_Blank" href="download?filename='
            + filename
            + '">'
            + filename
            + "</a></p>"
        )
    return "error"
Esempio n. 7
0
def deleteDownload():
    filename = request.form.get("filename").strip()
    u = download.download()
    u.delete(filename)
    os.remove(config.download_dir + os.sep + filename)
    return "success"
Esempio n. 8
0
def deleteDownload():
    filename = request.form.get('filename').strip()
    u = download.download()
    u.delete(filename)
    os.remove(config.download_dir + os.sep + filename)
    return 'success'