Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 31 additions & 31 deletions 2022-final/crypto/coltranehash/challenge.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
title: Coltrane Hash
description: Råkade glömma mitt admin-lösenord, kan du hjälpa mig hitta hemligheterna bakom det kontot?
authors:
- Xenia Lööv
categories:
- crypto

# set the flag_format_prefix to `null` to not use the flag format
flag_format_prefix: SSM{
flags: gi4nt_st3p5_https://www.youtube.com/watch?v=2bQuay163xc

custom_service_types:
- type: https
display: https://{host}:{port}
hyperlink: true

service:
type: https
image: container
internal_port: 1337
external_port: 40054

# downloadable_files:
# - container/server.py

challenge_id: 56cca88d-7bfb-4bc6-b681-d4aa4940810f
spec: 0.0.1

score: 200
human_metadata:
event_name: SSM 2022 Final
title: Coltrane Hash
description: Råkade glömma mitt admin-lösenord, kan du hjälpa mig hitta hemligheterna bakom det kontot?
authors:
- Xenia Lööv
categories:
- crypto
# set the flag_format_prefix to `null` to not use the flag format
flag_format_prefix: SSM{
flags: gi4nt_st3p5_https://www.youtube.com/watch?v=2bQuay163xc
custom_service_types:
- type: https
display: https://{host}:{port}
hyperlink: true
service:
type: https
image: container
internal_port: 1337
external_port: 40054
# downloadable_files:
# - container/server.py
challenge_id: 56cca88d-7bfb-4bc6-b681-d4aa4940810f
spec: 0.0.1
score: 200
human_metadata:
event_name: SSM 2022 Final
36 changes: 18 additions & 18 deletions 2022-final/crypto/coltranehash/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM ubuntu:20.04

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip python3-flask gunicorn nginx

RUN groupadd -g 1337 ctf && useradd -r -u 1337 -g ctf ctf
RUN mkdir -p /home/ctf/

COPY server.py index.html logged_in.html secrets.txt /home/ctf/
COPY nginx.conf /etc/nginx/nginx.conf
COPY certs/ /var/web/certs

RUN chown -R root:ctf /home/ctf/
RUN chmod -R 750 /home/ctf/

WORKDIR /home/ctf/

CMD nginx && gunicorn server:app -b unix:/tmp/ctf.sock -u ctf -g ctf
FROM ubuntu:20.04
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip python3-flask gunicorn nginx
RUN groupadd -g 1337 ctf && useradd -r -u 1337 -g ctf ctf
RUN mkdir -p /home/ctf/
COPY server.py index.html logged_in.html secrets.txt /home/ctf/
COPY nginx.conf /etc/nginx/nginx.conf
COPY certs/ /var/web/certs
RUN chown -R root:ctf /home/ctf/
RUN chmod -R 750 /home/ctf/
WORKDIR /home/ctf/
CMD nginx && gunicorn server:app -b unix:/tmp/ctf.sock -u ctf -g ctf
42 changes: 21 additions & 21 deletions 2022-final/crypto/coltranehash/container/certs/server.cert
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUdcGpJ1R1Xp+UQQIEHzjfd9THOdUwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjA1MjIwOTQwMTBaFw0yMjA2
MjEwOTQwMTBaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQCvlq2ukNLrG1W7PXnJ8JioLa10omOwT68a5QjpdICh
gpjjQAVr437R9naJ7KN77CYiglWbG2qwScRiJLjk8XOm06BvYoL9Oxamj1hdbr3z
6ZVytSB68/Mj7I2oFu0jCMhqZ2h3whsd4DhKzjAFYlgvZb5q8Bry8Uv9uzbUv+qs
j3xph+/P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XnJ8JioLa10omOwT68a5QjpdICh
gpjjQAVr437R9naJ7KN77CYiglWbG2qwScRiJLjk8XOm06BvYoL9Oxamj1hdbr3z
6ZVytSB68/Mj7I2oFu0jCMhqZ2h3whsd4DhKzjAFYlgvZb5q8Bry8Uv9uzbUv+qs
j3xph+/P9S4zhlr+8AC58K31nBbdppxcq4byE5rSKAuS2oQWwd6HbIihubPeIVYc
Yf9I47tEN66wV5KVIqdmX5qIsazaKEoywAv9PBvZ7BN0pNcVwk9slI+9TRqKIrPM
Fs/+Qq2ZKRgqfZ0tjXrq9ujzwvfbNEgtQj2rUTRehxkHAgMBAAGjUzBRMB0GA1Ud
DgQWBBRQAfMfHWkMBXhbSXkE9hYrTdxmcjAfBgNVHSMEGDAWgBRQAfMfHWkMBXhb
SXkE9hYrTdxmcjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA3
nC52JWsBUFPGspde+e1ASyznzgyBabYrTgNsTTnp/j2JfrOlNGaXUjncrAvW/lUU
gYMgP9UNd3qD6DILnC2DlHUtcoWqp1G6WxYpL7oXtmgMTqmmYMwP11yD3noRnTSC
/C9q56c4gU9/7u9A4+jfR2SgJbSI4PCI9Bs9fEqAnEINOZbYYRrGOauchXH+mNf1
RGhbK+cXaazqy+4+elHQw6WT7DRA3fUiz+Pg9FzwX2dm0JLyaE3rPM547gaPXsS/
nVXD9cKVyl9KZnNX+jpAjDUioWEl8uyHvJx8E3XmPPTviYq7lnc5hr2uU/Gor7uo
jbAxNtc+OB4EcolK7+Ms
-----END CERTIFICATE-----
56 changes: 28 additions & 28 deletions 2022-final/crypto/coltranehash/container/certs/server.key
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCvlq2ukNLrG1W7
PXnJ8JioLa10omOwT68a5QjpdIChgpjjQAVr437R9naJ7KN77CYiglWbG2qwScRi
JLjk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/crypto/coltranehash/container/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<html>
<head>
<title> Coltrane Hash </title>
</head>

Welcome!
<br/>

To use this site, please start by logging in:

<form action="login" method="get">
<label for="username"> username </label>
<input id="username" name="username" type="text" required>

<label for="password"> password </label>
<input id="password" name="password" type="password" required>

<input type="submit" value="login">
</form>

<a href="source"> view page source </a>

</html>
<html>
<head>
<title> Coltrane Hash </title>
</head>
Welcome!
<br/>
To use this site, please start by logging in:
<form action="login" method="get">
<label for="username"> username </label>
<input id="username" name="username" type="text" required>
<label for="password"> password </label>
<input id="password" name="password" type="password" required>
<input type="submit" value="login">
</form>
<a href="source"> view page source </a>
</html>
26 changes: 13 additions & 13 deletions 2022-final/crypto/coltranehash/container/logged_in.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<html>
<head>
<title> Logged in </title>
</head>

Hello {username}. You are logged in. Your hash is {hash}.

<br />
{secrets}

<br />
<a href="/"> Log out </a>
</html>
<html>
<head>
<title> Logged in </title>
</head>
Hello {username}. You are logged in. Your hash is {hash}.
<br />
{secrets}
<br />
<a href="/"> Log out </a>
</html>
66 changes: 33 additions & 33 deletions 2022-final/crypto/coltranehash/container/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {}

http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

gzip on;

upstream ctf {
server unix:/tmp/ctf.sock fail_timeout=0;
}

server {
listen 1337 ssl;

ssl_certificate /var/web/certs/server.cert;
ssl_certificate_key /var/web/certs/server.key;

location / {
include proxy_params;
proxy_redirect off;
proxy_pass http://ctf;
}
}
}
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {}
http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
upstream ctf {
server unix:/tmp/ctf.sock fail_timeout=0;
}
server {
listen 1337 ssl;
ssl_certificate /var/web/certs/server.cert;
ssl_certificate_key /var/web/certs/server.key;
location / {
include proxy_params;
proxy_redirect off;
proxy_pass http://ctf;
}
}
}
2 changes: 1 addition & 1 deletion 2022-final/crypto/coltranehash/container/secrets.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Hello Admin! Here's your flag: SSM{gi4nt_st3p5_https://www.youtube.com/watch?v=2bQuay163xc}
Hello Admin! Here's your flag: SSM{gi4nt_st3p5_https://www.youtube.com/watch?v=2bQuay163xc}
Loading