-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-rubeus.ps1
More file actions
25 lines (20 loc) · 908 Bytes
/
build-rubeus.ps1
File metadata and controls
25 lines (20 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Removes some indicators and builds Rubeus
# Note that no assemblyname/namespace might be almost as suspicious
$old_guid = '658C8B7F-3664-4A95-9572-A3E5871DFC06'
$new_guid = (New-Guid).ToString()
[string[]] $filetypes = "*.cs", "*.sln", "*.csproj"
ForEach ($filetype in $filetypes) {
$files = Get-ChildItem -Path $filetype -Recurse -File
ForEach ($file in $files) {
$content = Get-Content $file
$content = $content -Replace "$old_guid", "$new_guid"
$content | Set-Content $file
}
}
$csproj = Get-ChildItem Rubeus\Rubeus.csproj
$csprojxml = [xml] (Get-Content $csproj.FullName)
$csprojxml.Project.PropertyGroup[0].RootNamespace = ''
$csprojxml.Project.PropertyGroup[0].AssemblyName = ''
$csprojxml.Save($csproj.FullName)
msbuild .\Rubeus.sln -t:Clean
msbuild .\Rubeus.sln /property:Configuration=Release /property:TargetFrameworkVersion=v4.8