Machine / Machines

Base

Directory listing leak -> .swp source code exposure -> PHP strcmp type juggling auth bypass -> File upload to webshell -> Credential reuse for SSH -> sudo find privesc 1. Directory listing + swap files = source code disclosure 2. PHP strcmp() with loose ==...

EasyPublished 2025-11-12Sanitized local writeup

Scenario

Base attack path

Directory listing leak to .swp source code exposure to PHP strcmp type juggling auth bypass to File upload to webshell to Credential reuse for SSH to sudo find privesc 1. Directory listing + swap files = source code disclosure 2. PHP strcmp() with loose ==...

Objective

Machine walkthrough focused on Machines evidence, validation, and reusable operator lessons.

Base sanitized attack graph

Walkthrough flow

01

Scope and service discovery

02

Attack surface mapping

03

Initial foothold

04

Privilege escalation

05

Proof captured

Source coverage

Moderate source coverage

Status: partial. This article is generated from 4 sanitized Markdown sources and keeps raw flags, credentials, keys, cookies, and reusable secrets out of the rendered blog.

73% coverage
Evidence verdict

Moderate confidence: the page is useful for review, but it should be treated as partial because the available source material is thinner or less narrative-complete.

  • <TARGET>-Base/walkthrough.md
  • HTB/<TARGET>-Base/notes.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__<TARGET>-Base__notes.md.8acefe2603.md
  • HTB/_knowledge/exports/ctf-lightrag-latest-203412/documents/machine__Base__notes.md.2e2df60ddf.md

Technical Walkthrough

Base - Walkthrough

Target: <TARGET> | OS: Ubuntu Linux | Difficulty: Easy

Attack Chain Summary

Directory listing leak -> .swp source code exposure -> PHP strcmp type juggling auth bypass -> File upload to webshell -> Credential reuse for SSH -> sudo find privesc

Lessons Learned

  1. Directory listing + swap files = source code disclosure
  2. PHP strcmp() with loose == comparison is vulnerable to type juggling via array injection
  3. File upload bypassed with content-type spoofing (no server-side extension check)
  4. Credential reuse from web config to SSH
  5. sudo find is trivially exploitable via -exec

Source-Backed Dossier

The sections below are merged from companion Markdown notes for the same case. They are rendered after sanitization so the article stays precise without publishing raw flags, credentials, or target-specific secrets.

Notes

Scope

  • Target: <TARGET> (Base)
  • OS: Linux (Ubuntu)
  • Difficulty: Easy (Starting Point)
  • Pwnbox: <TARGET> (profex0r)
  • VPN IP: <TARGET>

Evidence Ledger

TimestampCommandFindingNext Action
2026-05-05 16:00nmap initialSSH 22, HTTP 80 (Apache 2.4.29 Ubuntu)Enumerate web
2026-05-05 16:00curl /login/Directory listing: config.php, login.php, login.php.swpDownload .swp
2026-05-05 16:01strings login.php.swpstrcmp() type juggling vuln in loginAuth bypass
2026-05-05 16:01POST username[]=&password[]=302 redirect to /upload.php - auth bypassedUpload shell
2026-05-05 16:01Upload shell.php (field: image)Success - shell at /_uploaded/shell.phpRCE
2026-05-05 16:01RCE as www-datauid=33(www-data)Read config
2026-05-05 16:01cat config.phpadmin / thisisagoodpasswordSSH as john
2026-05-05 16:02SSH john@targetuser.txt: <hash redacted>Privesc
2026-05-05 16:02sudo -l(root) /usr/bin/findGTFOBins
2026-05-05 16:02sudo find -exec cat root.txtroot.txt: <hash redacted>Done

Credentials

  • admin / thisisagoodpassword (web app + john SSH reuse)

Flags

  • User: <hash redacted>
  • Root: <hash redacted>

Notes

Scope

  • Target: <TARGET> (Base)
  • OS: Linux (Ubuntu)
  • Difficulty: Easy (Starting Point)
  • Pwnbox: <TARGET> (<<secret redacted>>)
  • VPN IP: <TARGET>

Evidence Ledger

TimestampCommandFindingNext Action
2026-05-05 16:00nmap initialSSH 22, HTTP 80 (Apache 2.4.29 Ubuntu)Enumerate web
2026-05-05 16:00curl /login/Directory listing: config.php, login.php, login.php.swpDownload .swp
2026-05-05 16:01strings login.php.swpstrcmp() type juggling vuln in loginAuth bypass
2026-05-05 16: <REDACTED>
2026-05-05 16:01Upload shell.php (field: image)Success - shell at /_uploaded/shell.phpRCE
2026-05-05 16:01RCE as www-datauid=33(www-data)Read config
2026-05-05 16:01cat config.phpadmin / thisisagoodpasswordSSH as john
2026-05-05 16:02SSH john@targetuser.txt: <<secret redacted>>Privesc
2026-05-05 16:02sudo -l(root) /usr/bin/findGTFOBins
2026-05-05 16:02sudo find -exec cat root.txtroot.txt: <<secret redacted>>Done

Credentials

  • admin / thisisagoodpassword (web app + john SSH reuse)

Flags

  • User: <<secret redacted>>
  • Root: <<secret redacted>>

Notes

Scope

  • Target: Base
  • Difficulty: Easy / Very Easy
  • OS: Linux
  • Current known IP: Pending
  • Local support folder: <local workspace>

Evidence Rule

Public research in research.md is advisory only. Record only live target evidence in this file after validation.

Evidence Ledger

TimestampCommandOutput fileFindingConfidenceNext action
PendingPendingPendingPublic research handoff created. Live target IP not yet recorded here.HighAdd target IP, run live enumeration, and save outputs under nmap/ and enum/.