-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
147 changed files
with
8,188 additions
and
2,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[submodule "docs/themes/hugo-geekdoc"] | ||
path = docs/themes/hugo-geekdoc | ||
url = https://github.com/thegeeklab/hugo-geekdoc.git | ||
[submodule "[email protected]:sdslabs/katana-services.git"] | ||
branch = main | ||
[submodule "katana-services"] | ||
path = katana-services | ||
url = [email protected]:sdslabs/katana-services.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"foxundermoon.shell-format" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# katana | ||
An advanced yet simple attack/defence CTF infrastructure in Go | ||
|
||
## Setup | ||
- To start, you must have the following installed: | ||
- Go 1.18+ | ||
- Minikube & kubectl | ||
- Run `make set-env` to setup the environment | ||
- To start katana, run `./bin/katana run` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y python3 python3-pip curl | ||
|
||
WORKDIR /opt/kissaki/ | ||
COPY . . | ||
|
||
RUN pip3 install -r requirements.txt | ||
|
||
CMD ["/bin/bash", "-c", "python3 /opt/kissaki/app.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import requests | ||
import time | ||
from flask import Flask, jsonify | ||
import os | ||
from kubernetes import client, config | ||
import logging | ||
|
||
# app = Flask(__name__) | ||
|
||
# Set up logging | ||
logging.basicConfig(level=logging.INFO) | ||
|
||
try: | ||
config.load_incluster_config() | ||
except config.config_exception.ConfigException: | ||
try: | ||
config.load_kube_config() | ||
except config.config_exception.ConfigException: | ||
raise | ||
|
||
v1 = client.CoreV1Api() | ||
service = v1.read_namespaced_service(name="kissaki-svc", namespace="katana") | ||
cluster_ip = service.spec.cluster_ip | ||
ports = service.spec.ports | ||
port = ports[0].port | ||
|
||
|
||
# @app.route("/") | ||
def hello(): | ||
return "Hello, world!" | ||
|
||
|
||
# @app.route("/test") | ||
def test_challenge_checker(): | ||
res = ( | ||
"making request to " | ||
+ "http://" | ||
+ str(cluster_ip) | ||
+ ":" | ||
+ str(port) | ||
+ "/register " | ||
) | ||
return res | ||
|
||
|
||
# @app.route("/register") | ||
def register_challenge_checker(): | ||
logging.info( | ||
"making request to " | ||
+ "http://" | ||
+ str(cluster_ip) | ||
+ ":" | ||
+ str(port) | ||
+ "/register " | ||
) | ||
|
||
# Register with kissaki | ||
checker_info = { | ||
"name": "knock-challenge-checker", | ||
"challenge": "knock", | ||
} # Example info | ||
|
||
response = requests.post( | ||
"http://" + str(cluster_ip) + ":" + str(port) + "/register", | ||
json=checker_info, | ||
) | ||
message = response.json().get("message") | ||
|
||
logging.info(f"Received message from kissaki: {message}") | ||
|
||
return "challenge_checker registered in kissaki" | ||
|
||
|
||
# @app.route("/check") | ||
def check_challenge(): | ||
for i in range(10): | ||
# TODO: Implement challenge checking logic | ||
challenge_status = {"status": "OK"} # Example status | ||
|
||
# Send status to kissaki service | ||
response = requests.post( | ||
"http://" + str(cluster_ip) + ":" + str(port) + "/status", | ||
json=challenge_status, | ||
) | ||
message = response.json().get("message") | ||
logging.info(f"Received message from kissaki: {message}") | ||
|
||
time.sleep(10) # Check every 10 seconds | ||
|
||
return jsonify(challenge_status) | ||
|
||
|
||
# if __name__ == "__main__": | ||
# app.run(host="0.0.0.0", port=8080) |
1 change: 1 addition & 0 deletions
1
challenges-sample/knock/challenge-checker/challenge-checker.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
challenge checker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kubernetes | ||
flask | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
contains informations about schedules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:17.4.0-buster-slim | ||
|
||
RUN mkdir -p /app | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
|
||
RUN yarn | ||
|
||
COPY . . | ||
|
||
USER node | ||
|
||
CMD ["node", "index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: knock-knock | ||
author: BrownieInMotion | ||
description: |- | ||
Knock knock? Who's there? Another pastebin!! | ||
${link_main_0} | ||
flag: dice{1_d00r_y0u_d00r_w3_a11_d00r_f0r_1_d00r} | ||
|
||
provide: | ||
- ./index.js | ||
- ./Dockerfile | ||
|
||
containers: | ||
main: | ||
build: . | ||
ports: | ||
- 3000 | ||
environment: | ||
FLAG: "dice{1_d00r_y0u_d00r_w3_a11_d00r_f0r_1_d00r}" | ||
|
||
expose: | ||
main: | ||
- target: 3000 | ||
http: knock-knock | ||
healthContent: Create Paste |
Oops, something went wrong.