June 30, 2026
RootMe — TryHackMe Write-Up
TR:
By Mert Budak
5 min read
Açık olan portları, çalışan servisleri ve servislerin versiyonlarını bulmak için nmap taraması gerçekleştirdim.
nmap 10.114.152.90 -T4 -Anmap 10.114.152.90 -T4 -A-T4: Taramayı hızlandırmak ve zamandan tasarruf etmek için -T4 parametresini kullandım. -A: Agresif tarama modu. Hedef sistemden detaylıca bilgi toplaması için -A parametresini kullandım.
Tarama Sonuçları: PORT 22: OpenSSH 8.2p1 servisinin aktif olduğunu tespit ettim. PORT 80: Apache httpd 2.4.41 web sunucusunun hedef sistemde aktif olduğunu tespit ettim.
ENG:
I performed an nmap scan to detect open ports, active services and their versions.
nmap 10.114.152.90 -T4 -Anmap 10.114.152.90 -T4 -A_-T4: I utilized the -T4 parameter to save time and accelerate the scan. -A: Aggressive scan mode. I utilized -A parameter to gather detailed information from the target system.
Scan Results: PORT 22: I detected the OpenSSH 8.2p1 service was active. PORT 80: I identified Apache httpd 2.4.41 web server was deployed on the target system._
TR:
Hedef sistemdeki gizli dizinleri bulmak için gobuster taraması gerçekleştirdim.
gobuster dir -u http://10.114.152.90/ -w /usr/share/wordlists/dirb/common.txtgobuster dir -u http://10.114.152.90/ -w /usr/share/wordlists/dirb/common.txtdir: Dizin taramasını belirtir. -u: URL belirtir. -w: Dizin taraması için kullanılan wordlist'i belirtir.
Tespit edilen gizli dizinler: http://10.114.152.90/css : CSS kodları içeren dizin. http://10.114.152.90/js : JavaScript kodları içeren dizin. http://10.114.152.90/panel : Dosya yükleyebildiğimiz dizin. http://10.114.152.90/uploads : Yüklü olan dosyaları görebildiğimiz dizin.
ENG:
I performed a gobuster scan to identify the hidden directories on the target system.
gobuster dir -u http://10.114.152.90/ -w /usr/share/wordlists/dirb/common.txtgobuster dir -u http://10.114.152.90/ -w /usr/share/wordlists/dirb/common.txtdir: Specifies a directory scan. -u: Specifies the target URL. -w: Specifies the wordlist utilized for the directory scan.
Identified the hidden directories http://10.114.152.90/css : Directory containing that css code. http://10.114.152.90/js : Directory containing that JavaScript code. http://10.114.152.90/panel : The directory where we can upload the files. http://10.114.152.90/uploads : The directory where we can view the uploaded files.
TR:
Hedef sistemde dosya yüklememize izin veren /panel dizinini kullanarak sisteme bir PHP reverse shell dosyası yüklemeyi ve hedef sistem üzerinde komut çalıştırma yetkisi elde etmeyi hedefledim.
Bağlantıyı yakalayabilmek için öncelikle Kali makinemde bir Netcat dinleyicisi başlattım.
nc -lvnp 4444nc -lvnp 4444Komutun kısa açıklaması:
nc: Netcat aracını ifade eder. -lvnp: Dinleme modu (listen), detaylı çıktı (verbose), DNS çözümlemesi yapmadan hızlı bağlantı (numeric-only) ve port belirleme (port) parametreleridir. 4444: Bağlantı için kullanılan port numarasıdır (İsteğe göre 1234, 5555 gibi farklı portlar da tercih edilebilir).
Yüklenecek reverse shell scriptini kendiniz yazabilirsiniz veya GitHub platformundaki bu iş için yazılmış güvenilir standart scriptlerden de faydalanabilirsiniz. Burası isteğe bağlı. Standart script kullanırken IP adresi ve port bilgilerini güncellemeyi, kodun güvenilirliğini (backdoor barındırmadığını) kontrol etmeyi unutmamalısınız.
Sunucu .php uzantılı dosyaları engellediği için dosya uzantısını değiştirerek yüklemeyi denedim. Bu tür senaryolarda denenebilecek alternatif bazı uzantılar şunlardır: .php3 .phtml .phar .phAr
NOT: Yapılan fazla denemelerden dolayı server şişti, makineyi baştan başlattım. Bu sebeple IP adresi değişti. Karışıklık olmaması için bu durumu belirtmek istedim.
ENG:
_I aimed to perform remote code execution and upload a PHP reverse shell file by leveraging /panel directory that allows us to upload the file on the target system.
As a first step, I launched the Netcat listener on my Kali_ machine to connect with the target.
nc -lvnp 4444nc -lvnp 4444_Short explanation of command
nc: It specifies the Netcat tool. -lvnp: listening mode (listen), detailed output (verbose), fast connection without dns resolution (numeric-only), specifies the port (port). 4444: The port number for the connection ( The different ports like 1234, 5555 etc could be preferred optionally)._
You can craft your reverse shell script or leverage scripts that standard, reliable, crafted for this purpose on the GitHub platform. This is optional. You shouldn't forget to modify IP address and port information, check out security of the code (be sure it does not contain backdoors).
_I tried to upload the files by changing file extension due to the fact that .php extension files blocked by server. Some alternative extensions can be tried in such scenarios. .php3 .phtml .phar .phAr
NOTE: I had to restart the machine because the server was crashed due to excessive testing. As a result the IP address changed. I wanted to explain the situation to avoid any confusion._
TR:
user.txt dosyasını bulmak için aşağıdaki komutu kullandım.
find / -type f -name user.txtfind / -type f -name user.txtKomutun kısa açıklaması
find / : Kök dizinden itibaren aramaya başlar. -type f : Sadece dosya(file) olanları filtreler.
user.txt dosyasının konumunu tespit ettim. Dosyayı okudum, bayrağı ele geçirdim.
ENG:
I used the following command to find the user.txt file.
find / -type f -name user.txtfind / -type f -name user.txtShort explanation of the command
find / : Start the search from the root directory. -type f : Filters the search to look for the files only.
I detected file path of user.txt file. I read it, I captured the flag.
TR:
SUID bitli olan dosyaları bulmak için aşağıdaki komutu kullandım.
find / -perm -4000 2>/dev/nullfind / -perm -4000 2>/dev/nullkomutun kısa açıklaması
find / : Kök dizinden (/) itibaren aramaya başlar. -perm -4000: İzinleri (permission) tarar; -4000 ise tam olarak SUID biti aktif olan dosyaları getir demektir. 2>/dev/null : Ekrana sadece bulduğu temiz sonuçları basar, izin verilmeyenleri göstermez.
Bir sürü SUID biti aktif dosya listelendi. /usr/bin/python2.7 dosyası dikkatimi çekti. GTFOBins platformunda olan aşağıdaki komutu kullandım ve root.txt dosyasını okudum.
python -c 'print(open("/root/root.txt").read())'python -c 'print(open("/root/root.txt").read())'print, open vb ifadeler çok açık olsa da buradaki esas kritik nokta, SUID bitinin aktif olması sebebiyle bu komutun root yetkileriyle çalışması ve normalde okuyamayacağımız /root/root.txt dosyasını okuyabilmemizdir.
ENG:
I used the following command to find the SUID bit files.
find / -perm -4000 2>/dev/nullfind / -perm -4000 2>/dev/null_Short explanation of the command
find / : Start the search from the root directory. -perm -4000: It scans the permissions; -4000 it means to display on the terminal the files that have SUID bit. 2>/dev/null: Only display clean results on the screen, don't show us permission error messages._
A large number of files which had active SUID bits were listed. The /usr/bin/python2.7 file caught my attention. I executed the following command from the GTFOBins platform and I read the root.txt file.
python -c 'print(open("/root/root.txt").read())'
python -c 'print(open("/root/root.txt").read())'The expressions like print, open etc. are crystal clear but the keypoint here is that command executed with root privileges because the SUID bit is active. This allows us to read /root/root.txt file, which we cannot access under normal conditions.