-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for fileless execution on Windows systems using PowerShell, a…
…llowing you to run the client without saving any files to disk. This is particularly useful in restricted environments where:
- Loading branch information
doxx
authored and
doxx
committed
Dec 23, 2024
1 parent
aab663d
commit e69c773
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Memory execution of DarkFlare client | ||
# Usage: .\memory-exec.ps1 -t cdn.example.com -d localhost:22 | ||
|
||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string]$t, | ||
|
||
[Parameter(Mandatory=$true)] | ||
[string]$d, | ||
|
||
[Parameter(Mandatory=$false)] | ||
[string]$l = "stdin:stdout", | ||
|
||
[Parameter(Mandatory=$false)] | ||
[string]$p | ||
) | ||
|
||
$url = "https://github.com/doxx/darkflare/releases/latest/download/darkflare-client-windows-amd64.exe" | ||
|
||
# Download binary into memory | ||
$webClient = New-Object System.Net.WebClient | ||
$bytes = $webClient.DownloadData($url) | ||
|
||
# Create arguments array | ||
$args = @("-l", $l, "-t", $t, "-d", $d) | ||
if ($p) { $args += @("-p", $p) } | ||
|
||
# Execute in memory | ||
$assembly = [System.Reflection.Assembly]::Load($bytes) | ||
$entryPoint = $assembly.EntryPoint | ||
$entryPoint.Invoke($null, @(,[string[]]$args)) |