Initial commit

This commit is contained in:
Rayhan Hanaputra
2025-10-10 22:18:06 +07:00
committed by GitHub
commit ea02892f14
1246 changed files with 289342 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM public.ecr.aws/docker/library/python:3.11-slim-buster
ARG PASSWORD
WORKDIR /opt
RUN apt-get update
RUN apt-get install -y nano openssh-server curl
RUN echo root:${PASSWORD} | chpasswd
RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN service ssh start
COPY src/ .
RUN mkdir -p uploads/
RUN pip install -r requirements.txt
RUN chmod +x ./start.sh
EXPOSE 80
EXPOSE 22
CMD ./start.sh
+15
View File
@@ -0,0 +1,15 @@
version: "3"
services:
s3:
restart: always
container_name: s3
build:
context: ./
args:
- PASSWORD=PASSWORD_20000
ports:
- "20000:80"
- "20022:22"
volumes:
- ./flag.txt:/flag.txt:ro
+1
View File
@@ -0,0 +1 @@
PLACEHOLDER
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
from flask import Flask, request, redirect, render_template
import os
app = Flask(__name__)
app.config["MAX_CONTENT_LENGTH"] = 1024
@app.route("/upload", methods=["POST"])
def aplot():
try:
file = request.files["file"]
filename = file.filename
path = os.path.join("uploads/", filename)
assert filename and ".." not in filename and "flag" not in filename
assert not os.path.exists(path)
file.save(os.path.join("uploads/", filename))
return f'Download <a href="/download?filename={filename}">here</a>'
except:
return ">:("
@app.route("/download", methods=["GET"])
def donlot():
try:
filename = request.args.get("filename")
assert filename and ".." not in filename
return open(os.path.join("uploads/", filename)).read()
except:
return ">:("
@app.route("/", methods=["POST", "GET"])
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run(host="0.0.0.0", port=80, debug=False)
+1
View File
@@ -0,0 +1 @@
Flask
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
/usr/sbin/sshd -D &
chmod +x ./main.py
./main.py
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stupid Storage Service</title>
</head>
<body>
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit">
</form>
<a href=""></a>
</body>
</html>