From 7b89991930b3439c3ee65949d486b4804c7e3997 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 22 Feb 2024 02:33:52 -0500 Subject: lactf 2024 results Signed-off-by: Malfurious --- scores.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scores.txt b/scores.txt index 037e3ab..014d947 100644 --- a/scores.txt +++ b/scores.txt @@ -27,3 +27,4 @@ UMass CTF 2023 965 40 /571 RITSEC CTF 2023 3472 72 /712 (717) BITSCTF 2024 1040 93 /921 +lactf 2024 1347 447 /1074 -- cgit v1.2.3 From d692b398a30ba62a75fb10286ef3702acadc9e38 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 22 Feb 2024 02:39:02 -0500 Subject: x86 register correction Signed-off-by: Malfurious --- docs/re/arch_x86.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/re/arch_x86.txt b/docs/re/arch_x86.txt index dcb7775..5d526b2 100644 --- a/docs/re/arch_x86.txt +++ b/docs/re/arch_x86.txt @@ -101,7 +101,7 @@ The function return value is stored in the a register. Argument #3: rdx Argument #4: rcx Argument #5: r8 - Argument #6: r15 + Argument #6: r9 Stack pointer register: rsp Base pointer register: rbp Return value in: rax -- cgit v1.2.3 From f5673a402720fea58337d9dd1090b2625ae5f073 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 22 Feb 2024 02:56:44 -0500 Subject: Update docker guide The docker reference guide now better explains various common situations. The file is moved to docs/nix since docker is not strictly a web technology. This location makes more sense. Signed-off-by: Malfurious --- docs/nix/docker.txt | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/web/docker.txt | 15 ------ 2 files changed, 131 insertions(+), 15 deletions(-) create mode 100644 docs/nix/docker.txt delete mode 100644 docs/web/docker.txt diff --git a/docs/nix/docker.txt b/docs/nix/docker.txt new file mode 100644 index 0000000..6fb77df --- /dev/null +++ b/docs/nix/docker.txt @@ -0,0 +1,131 @@ +Docker intro / quick reference +============================== +You might come across docker files supplied with web or even binary exploitation +challenges. Utilizing them will allow you to recreate a local copy of the +remote infrastructure to help troubleshoot an attack. + +Sections in this doc are for various common situations you might find yourself +in. It is not necessary to read the whole thing top-to-bottom. Just start in +the section relevant to you and refer to external docs afterward if needed. + + + +"Everything in Docker is system-wide - How do I check system status?" +--------------------------------------------------------------------- +The four main "objects" you might deal with are containers, images, volumes, +and networks. + + docker ps -a + docker images -a + docker volume ls + docker network ls + +With a blank slate, all these lists should be empty - except for networks, which +shows the default "bridge", "host", and "none" networks. + +To clean up: + + docker stop # if necessary, for each container + docker system prune --all --force # drop unused containers, images, networks + docker volume prune --all --force # drop unused volumes + +Resources still in-use by a running container are not pruned by the above +commands. + + + +"I have a docker-compose.yml file." (or equivalent) +--------------------------------------------------- +In this case, you can likely skip most manual steps. Everything should happen +automatically when you attempt to run the services. Probably all you need to +do is: + + docker compose up --detach --build + +To build or pull the image then run a (set of) container(s) in the background. +If you omit `--detach`, the process will remain in the foreground and logs are +printed to the terminal. To shutdown: + + docker compose down + +Docker compose yaml file reference +https://docs.docker.com/compose/compose-file/compose-file-v3/ + + + +"I have a Dockerfile only." +--------------------------- +`cd` to the directory with the Dockerfile and run: + + docker build --tag . + + will name the image. Names can be suffixed with `:` if +desired. Now run a new container from this image in the foreground: + + docker run --rm -it [arguments...] + +or the background: + + docker run --rm -d [arguments...] + +Useful command-line options (specify before ): + + -p hostport:containerport # expose port + -v hostpath:containerpath # mount fs volume + --rm # delete container on exit + -i # be interactive + -t # create TTY + -d # detach, run in background + + + +"I have nothing - I want to create a Dockerfile." +------------------------------------------------- +The Dockerfile defines the recipe for building images, which themselves are the +baseline for spawning containers. Here's a stripped down skeleton for a basic +debian-based image: + + FROM debian:latest + ENV DEBIAN_FRONTEND=noninteractive + RUN apt install --yes \ + package-one \ + package-two \ + package-three + + COPY . / + CMD ["/bin/bash", "-c", "echo", "Hello world"] + +When building this sample, files from the current working directory are copied +to "/" in the image, the listed packages are installed, and when run +"echo Hello world" is executed in bash. + +Dockerfile reference +https://docs.docker.com/engine/reference/builder/ + + + +"I want to get a shell / run new command in existing container." +---------------------------------------------------------------- +Get the container name or ID with: + + docker ps -a + +then: + + docker exec -it /bin/bash + +Bash is probably preferred, but some distros don't include it and you'll need to +start /bin/sh instead. + + + +"I want to copy a file to/from container and my host." +------------------------------------------------------ +Get the container ID with: + + docker ps -a + +then: + + docker cp : + docker cp : diff --git a/docs/web/docker.txt b/docs/web/docker.txt deleted file mode 100644 index 992b5b3..0000000 --- a/docs/web/docker.txt +++ /dev/null @@ -1,15 +0,0 @@ -# TODO: This whole doc - -docker run -p host:container - Run container with port forwarding - -docker run --rm -d --network host --name - --rm Destroy container on exit - -d Run detached (don't hijack terminal) - --net... Use host's network (don't need port forward) - -docker exec -it - Get a shell in container - - -I'm told docker-compose is just much simpler, try to use if possible. -- cgit v1.2.3