Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
df25841
task: Add beep-beep-boop public source code and deployment
gabrielmocanu Jun 30, 2023
165dcf2
task: Add chef-hacky-mchack source code and deployment
gabrielmocanu Jun 30, 2023
2b7c8fc
task: Add colors source code and deployment
gabrielmocanu Jun 30, 2023
0b103ed
task: Add do-you-need-glasses source code and deployment
gabrielmocanu Jun 30, 2023
bb10e0a
task: Add great-names source code and deployment
gabrielmocanu Jun 30, 2023
f22697e
task: Add mind-your-own-business source code and deployment
gabrielmocanu Jun 30, 2023
2ab83e2
task: Add nobody-loves-me source code and deployment
gabrielmocanu Jun 30, 2023
66dc73b
task: Add santa source code and deployment
gabrielmocanu Jun 30, 2023
4b3cfb3
task: Add traverse-universe source code and deployment
gabrielmocanu Jun 30, 2023
2fecb8d
chore(cookies): update traverse-universe challenge
gabrielmocanu Jan 2, 2026
8ea45a2
chore(cookies): update santa challenge
gabrielmocanu Jan 2, 2026
976947d
chore(cookies): update nobody-loves-me challenge
gabrielmocanu Jan 2, 2026
3411f6e
chore(cookies): update mind-your-own-business challenge
gabrielmocanu Jan 2, 2026
d2e5642
chore(cookies): update do-you-need-glasses challenge
gabrielmocanu Jan 2, 2026
7f7878b
chore(cookies): update chef-hacky-mchack challenge
gabrielmocanu Jan 2, 2026
8cfe57a
chore(cookies): update beep-beep-boop challenge
gabrielmocanu Jan 2, 2026
c0c244b
chore(cookies): update colors challenge
gabrielmocanu Jan 2, 2026
e73d31f
chore(cookies): update great-names challenge
gabrielmocanu Jan 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Name: Beep beep boop

Check failure on line 1 in chapters/web-application-security/cookies-and-session-management/drills/beep-beep-boop/README.md

View workflow job for this annotation

GitHub Actions / Checkpatch

WARNING:REPEATED_WORD: Possible repeated word: 'Beep'

## Description

Get the flag from http://141.85.224.115:8088.

Score: 50

## Vulnerability

Information disclosure in robots.txt leading to a hidden PHP file. The cookie from that page also needs to be set to a certain value.

## Exploit

Script in `./sol/solution.sh`

## Environment

Apache web server. (deployable as a Docker container using files in `deploy/` folder)

## Deploy

Copy `deploy/` folder and run `make run`.

If you need to update the image and container, remove the old container with `make clean` and update the image (and container) using `make`.

It is not possible to update the container without updating the image first.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Stage 1: Generate the source file with the flag
FROM alpine:latest AS builder

ARG FLAG
COPY src/73656372657420666f72204153494d4f.template.php /tmp/73656372657420666f72204153494d4f.template.php
RUN sed "s/__TEMPLATE__/${FLAG}/g" /tmp/73656372657420666f72204153494d4f.template.php > /tmp/73656372657420666f72204153494d4f.php

# Stage 2: Final image
FROM php:7.2-apache

COPY src/index.html /var/www/html/
COPY src/robots.txt /var/www/html/
COPY src/assets /var/www/html/assets
COPY --from=builder /tmp/73656372657420666f72204153494d4f.php /var/www/html/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
EXTERNAL_PORT := 8088
INTERNAL_PORT := 80
NAME := cookies-and-session-management_beep-beep-boop
FLAG := $(shell cat ../flag)

run: build
docker run -d -p $(EXTERNAL_PORT):$(INTERNAL_PORT) --name $(NAME) -t $(NAME)

build:
docker build --build-arg FLAG="$(FLAG)" -t $(NAME) -f Dockerfile ..

stop:
docker stop $(NAME)

clean: stop
docker rm $(NAME)
docker image rm $(NAME):latest

.PHONY: run build stop clean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SSS{We_w0rsh1p_1saac_As1m0v}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
setcookie('robotType', 'HUMAN'); // 48756d616e

if ($_COOKIE['robotType'] == 'ASIMOV') { // 4153494d4f
echo 'Congrats! You’ve proven to be worthy. <br />Here is your secret: __TEMPLATE__';
} else {
echo 'This is a secure area that can only be accessed by the most advanced humanoid robots.';
}
?>
Loading
Loading