initial commit
This commit is contained in:
30
up.run
Executable file
30
up.run
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
print("Content-type: text/html\n")
|
||||
import os
|
||||
import cgi
|
||||
import cgitb
|
||||
|
||||
|
||||
origin_url = "https://augustiner-kantorei.de/upload"
|
||||
|
||||
cgitb.enable()
|
||||
form = cgi.FieldStorage()
|
||||
fileitem = form['myfile']
|
||||
|
||||
if fileitem.filename:
|
||||
# strip leading path from file name to avoid
|
||||
# directory traversal attacks
|
||||
fn = os.path.basename(fileitem.filename)
|
||||
open('../downloads/' + fn, 'wb').write(fileitem.file.read())
|
||||
|
||||
print(f"""
|
||||
<html>
|
||||
<head>
|
||||
<!--meta http-equiv="refresh" content="0; url={origin_url}" /-->
|
||||
</head>
|
||||
<body>
|
||||
<h2>Erfolgreich hochgeladen</h2>
|
||||
<a href={origin_url}>Zurück zur Maske</a>
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
Reference in New Issue
Block a user