PowerUpSQL的一些问题解决

    技术2026-03-06  8

    PowerUpSQL是针对MSSQL Server的自动化渗透工具,需要运行在目标机上,在使用上遇到的一些问题作以记录。

    0x01 首先需要目标机上有PowerShell,第一步需要更改脚本执行策略

    get-executionpolicy // 查看当前策略设置 set-executionpolicy remotesigned // 设置新的策略

    设置新的策略需要管理员权限启动powershell,remotesigned使得本地powershell脚本可以执行。

    0x02 解决Nuget问题

    如果直接按照官方文档的步骤下载、导入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。

    0x03 下载导入PowerUpSQL模块

    现在即可按照官方文档进行

    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。

    Processed: 0.017, SQL: 9