PowerUpSQL是针对MSSQL Server的自动化渗透工具,需要运行在目标机上,在使用上遇到的一些问题作以记录。
设置新的策略需要管理员权限启动powershell,remotesigned使得本地powershell脚本可以执行。
如果直接按照官方文档的步骤下载、导入PowerUpSQL可能会报错,这里先解决Nuget报错问题。
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
先设置SSL,保证后续能顺利下载Nuget。
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" $targetNugetExe = "$rootPath\nuget.exe" Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe Set-Alias nuget $targetNugetExe -Scope Global -Verbose这里四行powershell语句作为ps1脚本来运行,会下载Nuget。
现在即可按照官方文档进行
install-module -name powerupsql
import-module -name powerupsql.psd1
IEX(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/NetSPI/PowerUpSQL/master/PowerUpSQL.ps1")
下载完成后即可运行PowerUpSQL命令进行渗透。 相关命令可查Cheat-Sheet。
