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 '[]'
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 "[]"
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'
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
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
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"
def deleteDownload(): filename = request.form.get("filename").strip() u = download.download() u.delete(filename) os.remove(config.download_dir + os.sep + filename) return "success"
def deleteDownload(): filename = request.form.get('filename').strip() u = download.download() u.delete(filename) os.remove(config.download_dir + os.sep + filename) return 'success'