Go-based implementation of Cobalt Strike style BOF/COFF loaders
by Loki - Thursday July 25, 2024 at 08:10 PM
#1
Goffloader is a library that allows easy in-memory execution of Cobalt Strike BOFs and unmanaged PE files.
Given that there's already a number of very excellent C implementations of this functionality, why do this in Go?
Quote:Adding BOF loading to Go expands the number of open source security projects that can be used within Go security tooling. There are entire repositories of useful functionality that are now accessible for Go tools via this library.
While you can technically just use a C implementation of COFF loaders (Sliver does this, for example), CGO is annoying.
Go is a nice language for static signature evasion. You can see an example of us being able to run an embedded version of mimikatz without jumping through too many hoops.
Limitations
Quote:Currently the COFFLoader implementation is only for x64 architecture. 32-bit support will be coming soon.
At the moment the PE execution is just loading a BOF with hard-coded arguments - eventually a few different approaches will be supported.
The Beacon* API implementation is partial - most BOFs don't use much beyond the arg parsing + output functions, but there's a chunk of beacon.h which still needs to be implemented. This will be done as useful BOFs are identified that rely on these APIs.
Using this library in its current state will NOT generate a 0/N detections file on VT. Right now it's 2 or 3 detections from the usual offender false+ mills, but users should be aware of this.
Hidden Content
You must register or login to view this content.



Omnicer
[Image: e47c91a87cc521d1efbd20183b42ee4259c9c593.gifv]
PGP
Reply
#2
Something interesting
Reply
#3
(07-25-2024, 08:10 PM)Loki Wrote:
Goffloader is a library that allows easy in-memory execution of Cobalt Strike BOFs and unmanaged PE files.
Given that there's already a number of very excellent C implementations of this functionality, why do this in Go?
Quote:Adding BOF loading to Go expands the number of open source security projects that can be used within Go security tooling. There are entire repositories of useful functionality that are now accessible for Go tools via this library.
While you can technically just use a C implementation of COFF loaders (Sliver does this, for example), CGO is annoying.
Go is a nice language for static signature evasion. You can see an example of us being able to run an embedded version of mimikatz without jumping through too many hoops.
Limitations
Quote:Currently the COFFLoader implementation is only for x64 architecture. 32-bit support will be coming soon.
At the moment the PE execution is just loading a BOF with hard-coded arguments - eventually a few different approaches will be supported.
The Beacon* API implementation is partial - most BOFs don't use much beyond the arg parsing + output functions, but there's a chunk of beacon.h which still needs to be implemented. This will be done as useful BOFs are identified that rely on these APIs.
Using this library in its current state will NOT generate a 0/N detections file on VT. Right now it's 2 or 3 detections from the usual offender false+ mills, but users should be aware of this.


Omnicer

is this BOF loader for some kind of stage 1 C2? or this is for CS directly?
This forum account is currently banned. Ban Length: (Permanent)
Ban Reason: Malware. /Thread-Shellter-Pro-v4-7-x86-NOT-WORKING-crack
Reply
#4
(07-25-2024, 08:10 PM)Loki Wrote:
Goffloader is a library that allows easy in-memory execution of Cobalt Strike BOFs and unmanaged PE files.
Given that there's already a number of very excellent C implementations of this functionality, why do this in Go?
Quote:Adding BOF loading to Go expands the number of open source security projects that can be used within Go security tooling. There are entire repositories of useful functionality that are now accessible for Go tools via this library.
While you can technically just use a C implementation of COFF loaders (Sliver does this, for example), CGO is annoying.
Go is a nice language for static signature evasion. You can see an example of us being able to run an embedded version of mimikatz without jumping through too many hoops.
Limitations
Quote:Currently the COFFLoader implementation is only for x64 architecture. 32-bit support will be coming soon.
At the moment the PE execution is just loading a BOF with hard-coded arguments - eventually a few different approaches will be supported.
The Beacon* API implementation is partial - most BOFs don't use much beyond the arg parsing + output functions, but there's a chunk of beacon.h which still needs to be implemented. This will be done as useful BOFs are identified that rely on these APIs.
Using this library in its current state will NOT generate a 0/N detections file on VT. Right now it's 2 or 3 detections from the usual offender false+ mills, but users should be aware of this.


Omnicer

enter chinese apt
Reply
#5
qwerwerqwerqweqweqweqweqweqweqweqwe
Reply
#6
Something interesting
Reply
#7
will check this
This forum account is currently banned. Ban Length: (Permanent)
Ban Reason: Leeching | http://breached26tezcofqla4adzyn22notfqw...an-Appeals if you feel this is incorrect.
Reply
#8
look pretty good
Reply
#9
thanks lets see how it is
Reply
#10
nice11111111111111
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  A Collection of Beacon Object Files that integrate with Cobalt Strike Loki 28 2,957 04-02-2025, 10:04 AM
Last Post: baivanz
  Rust Based Windows Kernel Rootkit Loki 124 8,466 04-02-2025, 09:35 AM
Last Post: YazaliMartins3
  web-based c2 server *python nullvex 0 240 03-21-2025, 09:49 AM
Last Post: nullvex
  Anti-VM basic implementation Vittlesical 12 1,528 02-26-2025, 12:33 AM
Last Post: UND0XX4BL3
  What are Malware Loaders? How do you create one? Zix 3 774 02-05-2025, 01:50 PM
Last Post: Brownsugar281

Forum Jump:


 Users browsing this thread: