write-ups-challenges-2022-2023/break-from-the-jail/level-1/SOLUTION.md

30 lines
700 B
Markdown
Raw Normal View History

2022-11-24 21:59:22 +00:00
# Hack the Jail - Part 1
## Difficulty
Very easy, but the participant needs to know about "sudo", which might be unknown for Linux novices.
## How To Solve
![](https://imgs.xkcd.com/comics/sandwich.png)
If something says "permission denied" on Linux, try with `sudo`. In this case the `/etc/sudoers` file seems to contain a peculiar line related to the currently executing user `ig`. It states the following:
```
ig ALL = NOPASSWD: /bin/cat
```
This means that the `ig` user is allowed to execute the `/bin/cat` binary with elavated permissions without using a password.
Therefore executing:
```
sudo cat /flag.txt
```
reveals the flag.
## Flag
IGCTF{ASimpleVisudoCanDoGreatDamage1}