Skip to content

Commit

Permalink
Merge pull request #1 from BC-SECURITY/console_update
Browse files Browse the repository at this point in the history
Update application to remove sockets
  • Loading branch information
Cx01N authored Aug 14, 2024
2 parents 65baa4c + 9b63c84 commit 4cf55c2
Show file tree
Hide file tree
Showing 21 changed files with 314 additions and 3,855 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Publish Self-Contained Assemblies

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build and release'
required: true
default: 'main'
release_version:
description: 'Release version (e.g., v1.0.0)'
required: true

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
runtime:
- linux-x64
- linux-x86
- linux-arm64

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: '6.x'

- name: Restore dependencies
run: dotnet restore

- name: Build and publish self-contained assembly
run: dotnet publish -c Release -r ${{ matrix.runtime }} --self-contained -p:PublishSingleFile=true -o ./publish/${{ matrix.runtime }}

- name: Create and upload release
uses: softprops/[email protected]
with:
files: ./publish/${{ matrix.runtime }}/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.runtime == 'linux-x64' }}
164 changes: 0 additions & 164 deletions EmpireCompiler/Class.cs

This file was deleted.

4 changes: 2 additions & 2 deletions EmpireCompiler/Core/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class Compiler
{
public class CompilationRequest
{
public EmpireCompiler.Models.Grunts.ImplantLanguage Language { get; set; } = Models.Grunts.ImplantLanguage.CSharp;
public EmpireCompiler.Models.Agents.ImplantLanguage Language { get; set; } = Models.Agents.ImplantLanguage.CSharp;
public Platform Platform { get; set; } = Platform.X64;
}

Expand Down Expand Up @@ -86,7 +86,7 @@ private class SourceSyntaxTree

public static byte[] Compile(CompilationRequest request)
{
if (request.Language == Models.Grunts.ImplantLanguage.CSharp)
if (request.Language == Models.Agents.ImplantLanguage.CSharp)
{
return CompileCSharp((CsharpCompilationRequest)request);
}
Expand Down
8 changes: 4 additions & 4 deletions EmpireCompiler/Core/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Project: Empire (https://github.com/BC-SECURITY/Empire)
// License: GNU GPLv3

using EmpireCompiler.Models.Grunts;
using EmpireCompiler.Models.Agents;
using System;
using System.Collections.Generic;

Expand All @@ -20,7 +20,7 @@ public class EmpireContext

public List<TaskOption> gruntTaskOptions { get; set; }

public List<GruntTask> gruntTasks { get; set; }
public List<AgentTask> gruntTasks { get; set; }

private int nextTaskId;
public EmpireContext()
Expand All @@ -31,7 +31,7 @@ public EmpireContext()
referenceSourceLibraries = new List<ReferenceSourceLibrary>();
referenceSourceLibraryReferenceAssemblies = new List<ReferenceSourceLibraryReferenceAssembly>();
gruntTaskOptions = new List<TaskOption>();
gruntTasks = new List<GruntTask>();
gruntTasks = new List<AgentTask>();
nextTaskId = 0;

}
Expand All @@ -43,7 +43,7 @@ public void Add(Object entity)
gList.Add(entity);
}

public void Add(GruntTask entity)
public void Add(AgentTask entity)
{
gruntTasks.Add(entity);
}
Expand Down
10 changes: 5 additions & 5 deletions EmpireCompiler/Core/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// License: GNU GPLv3

using EmpireCompiler.Core.Empire;
using EmpireCompiler.Models.Grunts;
using EmpireCompiler.Models.Agents;
using System;
using System.Collections.Generic;
using System.IO;
Expand All @@ -28,8 +28,8 @@ public async static Task IngestTask(ICovenantService2 service, String recievedTa

IDeserializer deserializer = new DeserializerBuilder().Build();
List<SerializedGruntTask> serialized = deserializer.Deserialize<List<SerializedGruntTask>>(recievedTask);
List<GruntTask> tasks = serialized.Select(S => new GruntTask().FromSerializedGruntTask(S)).ToList();
foreach (GruntTask task in tasks)
List<AgentTask> tasks = serialized.Select(S => new AgentTask().FromSerializedGruntTask(S)).ToList();
foreach (AgentTask task in tasks)
{
await service.CreateGruntTask(task);
}
Expand Down Expand Up @@ -276,8 +276,8 @@ await service.CreateEntities(

string yaml = File.ReadAllText(file);
List<SerializedGruntTask> serialized = deserializer.Deserialize<List<SerializedGruntTask>>(yaml);
List<GruntTask> tasks = serialized.Select(S => new GruntTask().FromSerializedGruntTask(S)).ToList();
foreach (GruntTask task in tasks)
List<AgentTask> tasks = serialized.Select(S => new AgentTask().FromSerializedGruntTask(S)).ToList();
foreach (AgentTask task in tasks)
{
await service.CreateGruntTask(task);

Expand Down
Loading

0 comments on commit 4cf55c2

Please sign in to comment.