Skip to content

Commit e1481a1

Browse files
committed
Change custom-ssh to general-ssh
1 parent 2b15df7 commit e1481a1

File tree

14 files changed

+17
-16
lines changed

14 files changed

+17
-16
lines changed

example-problems/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ problem development with.
1919
1. [Reversing Python](/example-problems/reversing-python/)
2020
- Presents a vulnerable program through a port using socat. Also goes over
2121
some tips on debugging your Dockerfile.
22-
1. [Custom SSH (Multi-stage Dockerfile)](/example-problems/custom-ssh/)
22+
1. [General SSH (Multi-container)](/example-problems/general-ssh/)
2323
- Demonstrates separating the challenge builder container from the
2424
interactive container.
2525

example-problems/custom-ssh/README.md renamed to example-problems/general-ssh/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Custom SSH Problem Creation Walkthrough
1+
# General SSH Problem Creation Walkthrough
22

33
## Pre-requisites
44

@@ -19,7 +19,7 @@ the filesystem that together compose the flag.
1919
The new thing about this challenge is that it uses multiple build stages in the
2020
Dockerfile to make use of multiple containers instead of just one.
2121

22-
In Custom SSH, we spin up an Ubuntu container called "builder" and use it to
22+
In General SSH, we spin up an Ubuntu container called "builder" and use it to
2323
make the flag and store it in separate files and in `/challenge/metadata.json`.
2424
We spin up another container which we call "sshHost". This is the container
2525
that becomes the main focal point of the challenge. We copy the separate parts
@@ -37,23 +37,23 @@ be separate containers, not just secure permissions.
3737
### File Listing
3838

3939
1. Besides problem details, the most important change in
40-
[problem.md](/example-problems/custom-ssh/problem.md) is changing Type to
40+
[problem.md](/example-problems/general-ssh/problem.md) is changing Type to
4141
"custom".
4242

4343
2. instructions-to-Xof3.txt's contain verbal instructions on how to find the
4444
next part of the flag. The Dockerfile copies these into the "sshHost"
4545
container.
4646

47-
3. [profile](/example-problems/custom-ssh/profile) is a bash profile that
47+
3. [profile](/example-problems/general-ssh/profile) is a bash profile that
4848
places the newly logged in user into a different folder than their home
4949
directory. This is done so that returning home from the root directory
5050
yields the last part of the flag instead of the first.
5151

52-
4. [start.sh](/example-problems/custom-ssh/start.sh) starts a listener that
52+
4. [start.sh](/example-problems/general-ssh/start.sh) starts a listener that
5353
receives ssh connections. This script is ran as the last step in the
5454
Dockerfile.
5555

56-
5. [Dockerfile](/example-problems/custom-ssh/Dockerfile), the first line is
56+
5. [Dockerfile](/example-problems/general-ssh/Dockerfile), the first line is
5757
different for this file. It's the "LAUNCH" directive which tells cmgr which
5858
containers should be actively running for the challenge. For our challenge,
5959
we don't need "builder" running, but we do need "sshHost" running. The next
@@ -69,15 +69,15 @@ be separate containers, not just secure permissions.
6969
of the flag parts in the Dockerfile since it can access them easily with
7070
`COPY --from=builder ...`.
7171

72-
6. [config-builder.py](/example-problems/custom-ssh/config-builder.py), this
72+
6. [config-builder.py](/example-problems/general-ssh/config-builder.py), this
7373
script generates the password from the seed and puts it in the file for the
7474
"sshHost" to use. Then it generates the flag and splits it into 3 parts and
7575
writes a file for each, also for the "sshHost" container. Finally, it writes
7676
the whole flag into `/challenge/metadata.json`, as needed by cmgr. It also
7777
puts the "password" into this file, so that the problem description can give
7878
the password to the competitor.
7979

80-
7. [config-sshhost.py](/example-problems/custom-ssh/config-sshhost.py), this
80+
7. [config-sshhost.py](/example-problems/general-ssh/config-sshhost.py), this
8181
script creates the "ctf-player" user and the needed directories and also
8282
changes the password of the account to be that which was generated by the
8383
"builder" container.

example-problems/custom-ssh/config-builder.py renamed to example-problems/general-ssh/config-builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# Configure a box for the custom ssh example challenge.
2+
# Configure a box for the general ssh example challenge.
33
################################################################################
44

55

example-problems/custom-ssh/config-sshhost.py renamed to example-problems/general-ssh/config-sshhost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# Configure a box for the custom ssh example challenge.
2+
# Configure a box for the general ssh example challenge.
33
################################################################################
44

55

example-problems/custom-ssh/problem.md renamed to example-problems/general-ssh/problem.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Custom SSH
1+
# General SSH
22

33
- Namespace: picoctf/examples
4-
- ID: custom-ssh
4+
- ID: general-ssh
55
- Type: custom
66
- Category: General Skills
77
- Points: 1
@@ -11,6 +11,7 @@
1111
Do you know how to move between directories and read files in the shell?
1212

1313
## Details
14+
1415
`ssh -p {{port("ssh")}} ctf-player@{{server("ssh")}}` using password
1516
`{{lookup("password")}}`
1617

example-problems/reversing-python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ the cmgr user, and some more control and introspection of the docker build
7373
process goes a long way in being able to determine what is going wrong.
7474

7575
1. Clone this repo
76-
2. Go to the custom-ssh directory
76+
2. Go to the reversing-python directory
7777
- `cd start-problem-dev/example-problems/reversing-python/`
7878
3. Switch Dockerfiles. `Dockerfile.test` has 1 discrepancy in it.
7979
- `mv Dockerfile Dockerfile.good`

example-problems/web-css/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ our previous implementation of using sed in a Dockerfile will fail silently.
5757
Python is also helpful for writing `metadata.json`. Even writing one line for
5858
the flag is clunky using `echo` in the Dockerfile. Doing this is much cleaner
5959
in Python, and necessary if we end up writing more variables than just the flag,
60-
such as in this [config](/example-problems/custom-ssh/config-builder.py#L70).
60+
such as in this [config](/example-problems/general-ssh/config-builder.py#L70).
6161

6262
Everything that can be done in the Dockerfile, can be done in Python, though
6363
usually more verbosely, but with better error handling and friendlier syntax.
64-
Here's an [example](/example-problems/custom-ssh/config-sshhost.py#L24) of
64+
Here's an [example](/example-problems/general-ssh/config-sshhost.py#L24) of
6565
running an arbitrary shell command in Python.
6666

6767
## Conclusion

0 commit comments

Comments
 (0)