Redirection Containers
PreviousCrafting Malicious Pluggable Authentication Modules for Persistence, Privilege Escalation, and LaterNextEnum_AzureSubdomains
Last updated
Last updated
from flask import Flask, request, redirect
app = Flask(__name__)
@app.route('/')
def index():
return '''
<html>
<head>
<title>Redirection Website</title>
</head>
<body>
<h1>Welcome to my redirector website!</h1>
</body>
</html>
'''
@app.route('/healthz')
def healthcheck():
return "Healthy"
@app.route('/callback')
def callback():
user_agent = request.headers.get('User-Agent')
if user_agent == 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36':
return redirect('http://10.0.0.2')
if __name__ == '__main__':
app.run(port=443)FROM python:3.12-slim
WORKDIR /redirector_app
# Copy the current directory contents
ADD . /redirector_app
# Install flask
RUN pip install flask
# Make TCP 443 available
EXPOSE 443
# Ensure container is healthy
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/healthz || exit 1
# Run when the container launches
CMD ["python3", "redirector.py"]