AlpacaHack Logo

Challenges

Sign InSign Up

Rows:

CHALLENGEAUTHORS

SOLVES

(CURRENT)

SOLVE RATE

(AT CONTEST TIME)

AlpacaHack 2100

Daily AlpacaHack

admin

1761

solves

-

1574

solves

-

Daily AlpacaHack

934

solves

-

AlpacaHack Round 2 (Web)

628

solves

Top 28%

= 84/300 users

Daily AlpacaHack

623

solves

-

Daily AlpacaHack

606

solves

-

SECCON Beginners CTF 2024

542

solves

Top 73%

= 683/928 teams

Daily AlpacaHack

409

solves

-

Daily AlpacaHack

406

solves

-

Daily AlpacaHack

375

solves

-

Daily AlpacaHack

367

solves

-

echo

AlpacaHack Round 1 (Pwn)

363

solves

Top 32%

= 56/174 users

Daily AlpacaHack

349

solves

-

Daily AlpacaHack

342

solves

-

Daily AlpacaHack

337

solves

-

Daily AlpacaHack

331

solves

-

Encoding Basics

Daily AlpacaHack

331

solves

-

🐈

Daily AlpacaHack

323

solves

-

Bars

Daily AlpacaHack

318

solves

-

108

Daily AlpacaHack

306

solves

-

Rows:

permission denied 2

Daily AlpacaHackTopic: File PermissionReleased: Apr 30, 2026

75 solves
Misc
Medium

by

minaminao

minaminao

cat: flag.txt: Permission denied

NOTE: This challenge is related to permission denied.

Beginner Hint 1 (AI-translated)
  • If you connect with nc, you will notice that a shell starts.
  • If you read chal.sh, you can see that flag.txt is created with permission 400 before the shell starts.
  • This command is executed by the root user.
  • So 400 means that only the root user can read the file.
  • After that, runuser -u alpaca -- sh starts a shell as the alpaca user.
  • However, if you run cat flag.txt, you still get Permission denied, so you cannot read the flag.
  • How can you read the flag, then?
Beginner Hint 2 (AI-translated)
  • This is a meta-level hint, but why is the permission of flag.txt being set inside chal.sh in the first place?
  • The permission of chal.sh is specified in the Dockerfile.
  • In the same way, it should also be possible to set the permission of flag.txt in the Dockerfile.
  • Think about what behavioral difference is created between setting permissions in the Dockerfile and setting them later in chal.sh.
Beginner Hint 3 (AI-translated)
  • In the previous challenge, permission denied, the nobody user was used, but this time the alpaca user is used.
  • Also, the shell runs in the /home/alpaca directory.
  • What does this make possible?

[Announcement] Thank you for playing Daily AlpacaHack! We'd appreciate it if you could fill out the survey

permission-denied-2.tar.gz
descriptionsolveswriteups