Playing With Programs

Program Misuse

For each challenge in this module, a different (standard) program that is owned by root has its suid bit set. Probably, this program is not normally designed to be suid. Your task is to misuse the program with this increased privilege to read the flag. Some of these programs are ordinarily used to read files; several of them are not. In order to better understand how to use (and misuse) these programs, you may want to read through their man pages.

51 challenges

Program Misuse: Privilege Escalation

Program Misuse: Mitigations

Challenges

CHALLENGE 01

cat

— solves

Lets you directly read the flag!

CHALLENGE 02

more

— solves

Lets you directly read the flag!

CHALLENGE 03

less

— solves

Lets you directly read the flag!

CHALLENGE 04

tail

— solves

Lets you directly read the flag!

CHALLENGE 06

sort

— solves

Lets you directly read the flag!

CHALLENGE 07

vim

— solves

Shows you that an over-privileged editor is a very powerful tool!

CHALLENGE 08

emacs

— solves

Shows you that an over-privileged editor is a very powerful tool!

CHALLENGE 09

nano

— solves

Shows you that an over-privileged editor is a very powerful tool!

CHALLENGE 10

rev

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 11

od

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 12

hd

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 13

xxd

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 14

base32

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 15

base64

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 16

split

— solves

Requires you to understand their output to derive the flag from it!

CHALLENGE 17

gzip

— solves

Forces you to understand different archive formats!

CHALLENGE 18

bzip2

— solves

Forces you to understand different archive formats!

CHALLENGE 19

zip

— solves

Forces you to understand different archive formats!

CHALLENGE 20

tar

— solves

Forces you to understand different archive formats!

CHALLENGE 21

ar

— solves

Forces you to understand different archive formats!

CHALLENGE 22

cpio

— solves

Forces you to understand different archive formats!

CHALLENGE 23

genisoimage

— solves

Forces you to understand different archive formats!

CHALLENGE 24

env

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 25

find

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 26

make

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 27

nice

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 28

timeout

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 29

stdbuf

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 30

setarch

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 31

watch

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 32

socat

— solves

Enables you to read flags by making them execute other commands!

CHALLENGE 33

whiptail

— solves

Requires some light programming to read the flag.!

CHALLENGE 34

awk

— solves

Requires some light programming to read the flag.!

CHALLENGE 35

sed

— solves

Requires some light programming to read the flag.!

CHALLENGE 36

ed

— solves

Requires some light programming to read the flag.!

CHALLENGE 37

chown

— solves

Lets you get the flag by doing tricks with permissions!

CHALLENGE 38

chmod

— solves

Lets you get the flag by doing tricks with permissions!

CHALLENGE 39

cp

— solves

Lets you get the flag by doing tricks with permissions!

CHALLENGE 40

mv

— solves

Lets you get the flag by doing tricks with permissions!


NOTE: It might be helpful to take a step back and think about the broader environment you are in, and what that makes possible.

CHALLENGE 41

perl

— solves

Lets you read the flag because they let you program anything!

CHALLENGE 42

python

— solves

Lets you read the flag because they let you program anything!

CHALLENGE 43

ruby

— solves

Lets you read the flag because they let you program anything!

CHALLENGE 44

bash

— solves

Lets you read the flag because they let you program anything!

CHALLENGE 45

date

— solves

Just straight up wasn't designed to let you read files!

CHALLENGE 46

dmesg

— solves

Just straight up wasn't designed to let you read files!

CHALLENGE 47

wc

— solves

Just straight up wasn't designed to let you read files!

CHALLENGE 48

gcc

— solves

Just straight up wasn't designed to let you read files!

CHALLENGE 49

as

— solves

Just straight up wasn't designed to let you read files!

CHALLENGE 50

wget

— solves

Just straight up wasn't designed to let you read files!


NOTE: This level has a "decoy" solution that looks like it leaks the flag, but is not correct. If you're submitting what you feel should be a valid flag, and the dojo doesn't accept it, try your solution against a file with uppercase characters to see what's going on.

CHALLENGE 51

ssh-keygen

— solves

This level shows how dangerous it is to allow users to load their own code as plugins into the program. Of course, figuring out how to do so is the hard part!


NOTE: You will need to write and compile C code to solve this level! Don't know how? Learn it on pwn.college!