summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible.yaml5
-rw-r--r--fast/server.yaml4
-rw-r--r--fast/submitter.py16
-rw-r--r--nginx/ctf.rs.conf4
-rw-r--r--tulip/0002-tulip-services.patch46
-rw-r--r--tulip/tulip.env4
6 files changed, 68 insertions, 11 deletions
diff --git a/ansible.yaml b/ansible.yaml
index 209337e..b13c60c 100644
--- a/ansible.yaml
+++ b/ansible.yaml
@@ -73,6 +73,11 @@
src: "./tulip/0001-restart-always.patch"
dest: ~/tulip/docker-compose.yml
+ - name: Apply the Tulip Services patch
+ patch:
+ src: "./tulip/0002-tulip-services.patch"
+ dest: ~/tulip/services/api/configurations.py
+
- name: Build and run Docker containers with Docker Compose
docker_compose:
project_src: ~/tulip
diff --git a/fast/server.yaml b/fast/server.yaml
index 8c3bdb8..fcee064 100644
--- a/fast/server.yaml
+++ b/fast/server.yaml
@@ -1,7 +1,7 @@
game:
tick_duration: 80
- flag_format: ENO[A-Za-z0-9+\/=]{48}
- team_ip: 10.1.26.1
+ flag_format: SAAR\{[A-Za-z0-9-_]{32}\}
+ team_ip: 10.32.160.0
submitter:
delay: 20
diff --git a/fast/submitter.py b/fast/submitter.py
index dcaffe7..a5df7cb 100644
--- a/fast/submitter.py
+++ b/fast/submitter.py
@@ -1,7 +1,13 @@
-import requests
+from pwn import *
def submit(flags):
- flag_responses = requests.post('http://example.ctf/flags', json=flags).json()
- accepted_flags = { item['flag']: item['response'] for item in flag_responses if item['response'].endswith('OK') }
- rejected_flags = { item['flag']: item['response'] for item in flag_responses if not item['response'].endswith('OK') }
- return accepted_flags, rejected_flags
+ accepted_flags, rejected_flags = {}, {}
+ r = remote('submission.ctf.saarland', 31337)
+ for flag in flags:
+ r.sendline(flag.encode())
+ response = r.recvline().decode().strip()
+ if response.startswith('[OK]'):
+ accepted_flags[flag] = response
+ else:
+ rejected_flags[flag] = response
+ return accepted_flags, rejected_flags
diff --git a/nginx/ctf.rs.conf b/nginx/ctf.rs.conf
index 774b19c..52869df 100644
--- a/nginx/ctf.rs.conf
+++ b/nginx/ctf.rs.conf
@@ -2,7 +2,7 @@ server {
listen 80;
listen [::]:80;
- server_name tulip.ctf.rs;
+ server_name tulip.hooke.rs;
location / {
proxy_pass http://127.0.0.1:3000;
@@ -14,7 +14,7 @@ server {
listen 80;
listen [::]:80;
- server_name fast.ctf.rs;
+ server_name fast.hooke.rs;
location / {
proxy_pass http://127.0.0.1:2023;
diff --git a/tulip/0002-tulip-services.patch b/tulip/0002-tulip-services.patch
new file mode 100644
index 0000000..887c3ff
--- /dev/null
+++ b/tulip/0002-tulip-services.patch
@@ -0,0 +1,46 @@
+From da7f3fbc8c99cb123a0e62bf7c102c1735dfaf56 Mon Sep 17 00:00:00 2001
+From: Aleksa Vuckovic <aleksa@vuckovic.cc>
+Date: Sat, 18 Nov 2023 14:28:29 +0000
+Subject: [PATCH] tulip patch
+
+---
+ services/api/configurations.py | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/services/api/configurations.py b/services/api/configurations.py
+index a39a800..ae37f0c 100755
+--- a/services/api/configurations.py
++++ b/services/api/configurations.py
+@@ -30,11 +30,21 @@ tick_length = os.getenv("TICK_LENGTH", 2*60*1000)
+ start_date = os.getenv("TICK_START", "2018-06-27T13:00+02:00")
+ mongo_host = os.getenv("TULIP_MONGO", "localhost:27017")
+ mongo_server = f'mongodb://{mongo_host}/'
+-vm_ip = "10.10.3.1"
++vm_ip = "10.32.160.2"
+
+-services = [{"ip": vm_ip, "port": 9876, "name": "cc_market"},
+- {"ip": vm_ip, "port": 80, "name": "maze"},
+- {"ip": vm_ip, "port": 8080, "name": "scadent"},
+- {"ip": vm_ip, "port": 5000, "name": "starchaser"},
+- {"ip": vm_ip, "port": 1883, "name": "scadnet_bin"},
+- {"ip": vm_ip, "port": -1, "name": "other"}]
+\ No newline at end of file
++services = [{"ip": vm_ip, "port": 2080, "name": "turingmachines"},
++ {"ip": vm_ip, "port": 8000, "name": "DjangoBells"},
++ {"ip": vm_ip, "port": 16379, "name": "redisbbq"},
++ {"ip": vm_ip, "port": 8080, "name": "pasteable"},
++ {"ip": vm_ip, "port": 30000, "name": "telework"},
++ {"ip": vm_ip, "port": 24929, "name": "saassaassaassaas"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"},
++ {"ip": vm_ip, "port": -1, "name": "other"}]
+--
+2.34.1
+
diff --git a/tulip/tulip.env b/tulip/tulip.env
index 619c9e7..27a1dcd 100644
--- a/tulip/tulip.env
+++ b/tulip/tulip.env
@@ -1,8 +1,8 @@
-FLAG_REGEX="[A-Z0-9]{31}="
+FLAG_REGEX="SAAR\{[A-Za-z0-9-_]{32}\}"
TULIP_MONGO="mongo:27017"
# The location of your pcaps as seen by the host
-TRAFFIC_DIR_HOST=./services/test_pcap
+TRAFFIC_DIR_HOST=/traffic
# The location of your pcaps (and eve.json), as seen by the container
TRAFFIC_DIR_DOCKER=/traffic