Cookies
Cookies
Platform: HackerLab | Category: Web | Type: Challenge | Difficulty: Easy | OS: NA | Author: D3v0o0Nu11 | Date: 2025-12-20 | Status: Solved Techniques: Comma-separated value formatting, HTTP Cookie header manipulation, Request parameter ordering
Summary
Task: Web page requires specific cookies with amounts. Solution: Send comma-separated values in Cookie header matching the required format.
Recon
Port scan
nmap -p- -sV -sC <TARGET> --min-rate 1000 -Pn
| Port | Service | Version | Notes |
|---|---|---|---|
| <PORT> | <SVC> | <VER> | <notes> |
Enumeration highlights
- Event:
hackerlab| ID:20251220_hackerlab_cookies - Tags: http_cookies, cookie_manipulation, comma_separated_values, request_formatting, web_basics
- Indicators: Page shows required cookies and their values, Hint "in one pack" suggests combining values, Multiple cookies with different amounts
- Source:
20251220_hackerlab_cookies.md
Foothold
Vulnerability / Misconfiguration
- Comma-separated value formatting
- HTTP Cookie header manipulation
- Request parameter ordering
<command>
Exploitation
- See original writeup content for detailed exploitation.
Privilege Escalation
Enumeration
sudo -l find / -perm -4000 2>/dev/null getcap -r / 2>/dev/null cat /etc/crontab ps aux
Exploitation
- N/A for challenge-type writeup; see exploitation above.
- Flag obtained via challenge solve.
<command>
Flags
| Flag | Location | Value |
|---|---|---|
| flag | REDACTED |
Key Takeaways / Lessons
- Comma-separated value formatting
- HTTP Cookie header manipulation
- Request parameter ordering
- Tags: http_cookies, cookie_manipulation, comma_separated_values, request_formatting, web_basics
Original Writeup
<details><summary>Click to expand original content</summary>Description
"Я не представляю свою жизнь без печений. Кстати, в одной пачке они хорошо смотрятся"
(Translation: "I can't imagine my life without cookies. By the way, they look good in one pack")
Target: http://62.173.140.174:16047/
Analysis
The web page displayed a message with required cookies:
Sugar cookies= 1 amountOatmeal cookies= 5 amountsCrackers cookies= 2 amounts
The key hint in the description — "в одной пачке" (in one pack) — indicated that all values should be combined/packed together.
Key Observations
- Multiple values — need to pass several types of cookies with different amounts
- "In one pack" format — values should be combined with commas
- Order matters — cookies and amount must correspond to each other by position
Solution
The solution was to send HTTP cookies with comma-separated values:
curl -b "cookies=Sugar cookies,Oatmeal cookies,Crackers cookies; amount=1,5,2" \
http://62.173.140.174:16047/
Request Structure
Cookie: cookies=Sugar cookies,Oatmeal cookies,Crackers cookies; amount=1,5,2
Where:
cookies— list of cookie types separated by commasamount— corresponding amounts separated by commas
Alternative Method (via browser)
In DevTools Console:
document.cookie = "cookies=Sugar cookies,Oatmeal cookies,Crackers cookies"; document.cookie = "amount=1,5,2"; location.reload();
Lessons
- Comma-separated cookies — non-standard but working way to pass multiple values
- Hints in description — "in one pack" directly indicated the format
- Order correspondence — positions in cookies and amount lists must match
References
- HTTP Cookies (MDN)
- curl -b option
Auto-tracked: saved to WriteUps; run
/xesor-reviseto fold lessons into XESXor_Methodology.md.
signed by XESXOR