惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
M
MIT News - Artificial intelligence
量子位
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
罗磊的独立博客
F
Fortinet All Blogs
美团技术团队
博客园_首页
博客园 - 【当耐特】
L
LangChain Blog
月光博客
月光博客
腾讯CDC
The Cloudflare Blog
D
Docker
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
TryHackMe Brains Challenge Walkthrough
Frank A · 2026-05-20 · via DEV Community

So this is the Brains room on TryHackMe. Its a two part challenge, you hack into a box (red team) and then you investigate what happened (blue team). Pretty cool combo actually.

Here's my video walkthrough if you wanna follow along:


Part 1: Hacking the Box

First thing, start the machine and grab the IP address. Then open a terminal and run nmap to see whats available:

nmap <target-ip>

Enter fullscreen mode Exit fullscreen mode

You'll see three things open:

  • Port 22 (SSH)
  • Port 80 (HTTP)
  • Port 50000 (something weird, looks like a database but its not)

If you go to port 80 in the browser its just a blank page, nothing there. You can run gobuster to discover hidden folders and files on it but trust me, waste of time, there's nothing.

The interesting one is port 50000. Try connecting with telnet:

telnet <target-ip> 50000

Enter fullscreen mode Exit fullscreen mode

Hit enter a few times and you'll see it returns HTML. So its actually a web server not a database. Open it in Firefox:

<target-ip>:50000

Enter fullscreen mode Exit fullscreen mode

You'll see TeamCity running. Note the version number, in this case 2023.11.3.


Finding the Exploit

Go to exploit-db.com and search for "TeamCity". You'll find a bunch of vulnerabilities, the one we want is the authentication bypass / remote code execution one. Note the CVE number and search for it on GitHub.

I used the exploit from wolf hacker. Copy the code, save it as a .py file. When you run it you might get a missing module error:

pip install faker

Enter fullscreen mode Exit fullscreen mode

Then run the exploit pointing at your target:

python exploit.py -t <target-ip>

Enter fullscreen mode Exit fullscreen mode

If it works youll get a shell. Test it:

whoami

Enter fullscreen mode Exit fullscreen mode

You should see something like "ubuntu". Then check the home folder:

ls /home/ubuntu

Enter fullscreen mode Exit fullscreen mode

Youll find a flag.txt, cat it out:

cat /home/ubuntu/flag.txt

Enter fullscreen mode Exit fullscreen mode

Thats your first flag, machine hacked.


Privilege Escalation

While your in there check what you can run as sudo:

sudo -l

Enter fullscreen mode Exit fullscreen mode

In this case everything is allowed which means you can just do:

sudo whoami

Enter fullscreen mode Exit fullscreen mode

And youll see root. Thats it, full privilege escalation. Pretty easy one but good to practice the concept.


Part 2: Investigation with Splunk

Now close that machine and start the second one (the blue team box). Put the new IP in your browser and youll see the Splunk interface.

Go to Search and Reporting. Start with a broad search to see everything:

index=*

Enter fullscreen mode Exit fullscreen mode

Set the time to "All Time" and search. Youll see around 4000 events.

Question 1: What plugin was installed after exploitation?

Just search:

index=* plugin

Enter fullscreen mode Exit fullscreen mode

Youll see an event about a plugin being uploaded. The full name is right there in the log, copy it.

Question 2: What malicious package was installed?

Search for:

dpkg

Enter fullscreen mode Exit fullscreen mode

Then filter to look through installed packages. Youll see loads of normal Linux stuff, lib this, lib that. Keep going through the pages and youll spot one called "data-collector". Thats the dodgy one, nothing legit should be called that.

Question 3: What is the backdoor user?

Search for:

useradd

Enter fullscreen mode Exit fullscreen mode

Youll find an entry where useradd was run with the username "evil-user" and a home folder to match. Yeah not subtle lol. Thats your answer.


Done

Thats the full Brains room. Red team side you exploited a TeamCity auth bypass to get a shell and escalated to root. Blue team side you used Splunk to find the plugin, the malicious package and the backdoor user that the attacker left behind.

If you want to practice the Linux commands used in this walkthrough check out https://practicelinux.com