Skip to content

Instantly share code, notes, and snippets.

@p4yl0ad
Created October 30, 2023 21:06
Show Gist options
  • Save p4yl0ad/de39ed6a0221fb14a5d2998b9b4062f3 to your computer and use it in GitHub Desktop.
Save p4yl0ad/de39ed6a0221fb14a5d2998b9b4062f3 to your computer and use it in GitHub Desktop.
rpc-hunt.ps1
# https://csandker.io/2021/02/21/Offensive-Windows-IPC-2-RPC.html#rpc-servers
Get-ChildItem -Path "C:\Windows\System32\" -Filter "*.exe" -Recurse -ErrorAction SilentlyContinue | % { $out=$(C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\bin\dumpbin.exe /IMPORTS:rpcrt4.dll $_.VersionInfo.FileName); If($out -like "*RpcServerListen*"){ Write-Host "[+] Exe starting RPC Server: $($_.VersionInfo.FileName)"; Write-Output "[+] $($_.VersionInfo.FileName)`n`n $($out|%{"$_`n"})" | Out-File -FilePath EXEs_RpcServerListen.txt -Append } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment