Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update system-exploration directory #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Empty Files

So many empty files...
Nevertheless, you must find the flag!

If you're having difficulties solving this exercise, go through [this](../../../reading/summary.md) reading material.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Find Us If You Can

This is a two-stage challenge.
The first flag is somewhere on the remote system.
Use the hint it comes with, in order to figure out the second flag as well.

If you're having difficulties solving this exercise, go through [this](../../../reading/summary.md) reading material.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash
# SPDX-License-Identifier: BSD-3-Clause

echo "Get the first flag."
# Use 2> /dev/null to ignore the error messages.
find / -type f -name flag -print0 2> /dev/null | xargs -0 cat | grep SSS

echo "Now get the second one."
find / -name '*doc*' -print0 2> /dev/null | grep --null-data bugs | xargs -0 cat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Not Your Doge

The image is in `.pnm` format.
It has a rather simple header, that you can find [here](https://en.wikipedia.org/wiki/Netpbm#PPM_example)(`.pnm`s are almost the same as `.ppm`s; it's just the data encoding that differs).
But it's incomplete.
Find a way to reveal it completely.

If you're having difficulties solving this exercise, go through [this](../../../reading/summary.md) reading material.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause

#! /usr/bin/python

file = open("../support/not-doge.pnm", "rb")
data = file.read()
file.close()

# The height is located at an offest of 7 bytes inside the header.
new_data = data[:7] + b"688" + data[10:]

out_file = open("not-doge.pnm", "wb")
out_file.write(new_data)
out_file.close()
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Surgical Precision

There are many false flags out there.
Answer the questions and find the **real** flags.
The quizzes cover subjects discussed today and during the previous session.
Think of them as a recap.

The answer to each of the riddles in the files `question-*` from the `drills/surgical-precision/support` is the name of one of the given files.
When you've found an answer, upload the flag in that file.

Beware of [red herrings](https://en.wikipedia.org/wiki/Red_herring)!

If you're having difficulties solving this exercise, go through [this](../../../reading/summary.md) reading material.
36 changes: 36 additions & 0 deletions chapters/scratch-linux/system-exploration/guides/doge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Doge

The best way to showcase the `strings` command is to use it in order to find our first flag for today.
Head to the `guides/doge/support` folder and take a look at the image you've been given.

Since this section is dedicated to the `strings` command, we'll run this command on our `doge.jpg` file:

```bash
root@kali:~/essentials-security/chapters/scratch-linux/system-exploration/guides/doge/public# strings doge.jpg
JFIF
[...]
eP!_"
```

So there are lots of human-readable strings in this image, but very few, if any, actually make any sense.
In order to filter them out, we'll use what we've learned today: `|` + `grep`.
We'll try to find the flag itself.
Maybe we get lucky.

```bash
root@kali:~/essentials/system-exploration/activities/doge/public# strings doge.jpg | grep SSS
<there should be a flag here>
```

That's how you use `strings`: often in combination with some filtering mechanism, such as `grep`.

Another way to get the flag is to run the `file` command:

```bash
root@kali:~/essentials/system-exploration# file activities/doge/public/doge.jpg
activities/doge/public/doge.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, comment: "SSS{grep_your_strings}", progressive, precision 8, 500x500, components 3
```

The flag is included in the file as a comment.
Image comments are often used in CTFs in order to hide some more subtle information, such as hints.
Always remember to check them out.
Loading
Loading