summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksa Vuckovic <aleksa@vuckovic.cc>2024-07-18 18:44:35 +0200
committerAleksa Vuckovic <aleksa@vuckovic.cc>2024-07-18 18:44:35 +0200
commitde4a22bad19c4cf39a673f837bd48d823c10d264 (patch)
treeb23084bbc36a394079261c6c85adc04b2837ac3e
parent6179887fdf9960fd94dc8cbb02f54745a11d6a17 (diff)
italian ad + tulip update
-rw-r--r--fast/server.yaml8
-rw-r--r--fast/submitter.py30
-rw-r--r--nginx/ctf.rs.conf4
-rw-r--r--tulip/0002-tulip-services.patch51
-rw-r--r--tulip/tulip.env42
5 files changed, 85 insertions, 50 deletions
diff --git a/fast/server.yaml b/fast/server.yaml
index fcee064..51d8fad 100644
--- a/fast/server.yaml
+++ b/fast/server.yaml
@@ -1,10 +1,10 @@
game:
- tick_duration: 80
- flag_format: SAAR\{[A-Za-z0-9-_]{32}\}
- team_ip: 10.32.160.0
+ tick_duration: 120
+ flag_format: [A-Z0-9]{31}=
+ team_ip: 10.60.24.1
submitter:
- delay: 20
+ interval: 15
server:
password: sifra
diff --git a/fast/submitter.py b/fast/submitter.py
index a5df7cb..1c7c21d 100644
--- a/fast/submitter.py
+++ b/fast/submitter.py
@@ -1,13 +1,21 @@
-from pwn import *
+import requests
+
+TEAM_TOKEN = "0574cec7b21a0cba8f1b2efb5ca8fac5"
+
def submit(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
+ accepted_flags, rejected_flags = {}, {}
+ response = requests.put(
+ "http://10.10.0.1:8080/flags",
+ headers={"X-Team-Token": TEAM_TOKEN},
+ json=flags,
+ )
+
+ responses = response.json()
+
+ for flag in responses:
+ if flag["status"]:
+ accepted_flags[flag["flag"]] = flag["msg"]
+ else:
+ rejected_flags[flag["flag"]] = flag["msg"]
+ return accepted_flags, rejected_flags
diff --git a/nginx/ctf.rs.conf b/nginx/ctf.rs.conf
index ab7afea..3e6ea2d 100644
--- a/nginx/ctf.rs.conf
+++ b/nginx/ctf.rs.conf
@@ -2,7 +2,7 @@ server {
listen 80;
listen [::]:80;
- server_name tulip.hooke.rs;
+ server_name tulip.s1.ctf.rs;
location / {
proxy_pass http://127.0.0.1:3000;
@@ -14,7 +14,7 @@ server {
listen 80;
listen [::]:80;
- server_name fast.hooke.rs;
+ server_name fast.s1.ctf.rs;
location / {
proxy_pass http://127.0.0.1:2023;
diff --git a/tulip/0002-tulip-services.patch b/tulip/0002-tulip-services.patch
index a4136e8..f012a8f 100644
--- a/tulip/0002-tulip-services.patch
+++ b/tulip/0002-tulip-services.patch
@@ -1,23 +1,34 @@
-From da7f3fbc8c99cb123a0e62bf7c102c1735dfaf56 Mon Sep 17 00:00:00 2001
+From c7ba613ad4b55c59ff0dbb05c774eccc526eef32 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
+Date: Thu, 4 Jul 2024 09:18:50 +0000
+Subject: [PATCH] services
---
- services/api/configurations.py | 24 +++++++++++++++++-------
- 1 file changed, 17 insertions(+), 7 deletions(-)
+ services/api/configurations.py | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/services/api/configurations.py b/services/api/configurations.py
-index a39a800..ae37f0c 100755
+index 0dea4f4..032fdb4 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")
+@@ -31,11 +31,16 @@ start_date = os.getenv("TICK_START", "2018-06-27T13:00+02:00")
mongo_host = os.getenv("TULIP_MONGO", "localhost:27017")
+ flag_regex = os.getenv("FLAG_REGEX", "[A-Z0-9]{31}=")
mongo_server = f'mongodb://{mongo_host}/'
--vm_ip = "10.10.3.1"
-+vm_ip = "10.32.160.2"
-
+-vm_ip = os.getenv("VM_IP", "10.10.3.1")
++vm_ip = "10.60.24.1"
++
++services = [{"ip": vm_ip, "port": 1337, "name": "inlook"},
++ {"ip": vm_ip, "port": 8000, "name": "extcel"},
++ {"ip": vm_ip, "port": 3000, "name": "CCForms"},
++ {"ip": vm_ip, "port": 3001, "name": "CCForms"},
++ {"ip": vm_ip, "port": 8443, "name": "ccalendar"},
++ {"ip": vm_ip, "port": 9001, "name": "x"},
++ {"ip": vm_ip, "port": 9002, "name": "x"},
++ {"ip": vm_ip, "port": 9003, "name": "x"},
++ {"ip": vm_ip, "port": 9004, "name": "x"},
++ {"ip": vm_ip, "port": -1, "name": "other"}]
+
-services = [{"ip": vm_ip, "port": 9876, "name": "cc_market"},
- {"ip": vm_ip, "port": 80, "name": "maze"},
- {"ip": vm_ip, "port": 8080, "name": "scadent"},
@@ -25,22 +36,6 @@ index a39a800..ae37f0c 100755
- {"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
+2.25.1
diff --git a/tulip/tulip.env b/tulip/tulip.env
index 27a1dcd..19e6359 100644
--- a/tulip/tulip.env
+++ b/tulip/tulip.env
@@ -1,13 +1,45 @@
-FLAG_REGEX="SAAR\{[A-Za-z0-9-_]{32}\}"
-TULIP_MONGO="mongo:27017"
+##############################
+# Tulip config
+##############################
+# The connection string to connect to the mongo bd
+TULIP_MONGO=mongo:27017
# The location of your pcaps as seen by the host
TRAFFIC_DIR_HOST=/traffic
-
# The location of your pcaps (and eve.json), as seen by the container
TRAFFIC_DIR_DOCKER=/traffic
+##############################
+# Game config
+##############################
+
# Start time of the CTF (or network open if you prefer)
-TICK_START="2018-06-27T13:00+02:00"
+TICK_START="2024-07-03T10:00+02:00"
# Tick length in ms
-TICK_LENGTH=180000
+TICK_LENGTH=120000
+# The flag format in regex
+FLAG_REGEX="[A-Z0-9]{31}="
+
+##############################
+# PCAP_OVER_IP CONFIGS
+##############################
+
+#PCAP_OVER_IP="host.docker.internal:1337"
+# # For multiple PCAP_OVER_IP you can comma separate
+#PCAP_OVER_IP="host.docker.internal:1337,otherhost.com:5050"
+
+##############################
+# FLAGID CONFIGS
+##############################
+
+# # enable flagid scrapping
+# FLAGID_SCRAPE=1
+# # enable flagid scanning
+# FLAGID_SCAN=1
+# # Flag Lifetime in Ticks (-1 for no check, pls don't use outside testing)
+# FLAG_LIFETIME=-1
+# # Flagid endpoint currently Testendpoint in docker compose
+# FLAGID_ENDPOINT="http://flagidendpoint:8000/flagids.json"
+# # VM IP (inside gamenet)
+VM_IP="10.60.24.1"
+TEAM_ID="10.60.24.1"