Code Monkey home page Code Monkey logo

sharpc2's Introduction

SharpC2

Documentation Status

SharpC2 is a Command & Control (C2) framework written in C#. It consists of an ASP.NET Core Team Server, a .NET Framework implant, and a .NET MAUI client.

sharpc2's People

Contributors

rakan-dev avatar rasta-mouse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sharpc2's Issues

ls command when aborted raise an error

Issue when ls command is tasked, and status is aborted there is an error.
result from task is: The path is not of a legal form.
so it can't be Deserialize to an object DirectoryEntry

cannot select the desired word

When the ps and ls commands are executed, a list will be displayed. When you select a word in the list with the mouse and try to copy it, the selected part will change, making it impossible to select the desired word. Please fix this bug, or give an option to copy to the clipboard when clicking a certain part. Thanks alot!

bug

External Handler

i don't know what is the issue really i tried to debug it and no luck
i create External handler with port 7878 in teamserver and run demo-controller and run demo-client and wait the drone connected to teamserver but when i send task it's marked as TASKED but the problem is when data come to drone

Screenshot 2023-04-16 203656

as shown in picture data incorrect I dont know where is problem maybe in client or controller but everything seems fine

Execute-Assembly - weird parsed assembly name

Hi @rasta-mouse - thanks again for this great project.

I have a strange error when using Execute-Assembly. For most assemblies it works fine, but for one in particular (https://github.com/GhostPack/Seatbelt) the code in TransactedAssembly.cs here

public Assembly Load(byte[] assemblyBytes)
{
    _assemblyName = ParseArray(assemblyBytes); 

returns 's15_0' for _assemblyName instead of the expected 'SeatBelt.exe' (if I build with 'Debugging Information = 'None' then the ParseArray method fails completely as the string pointer is never found and Array.Copy throws an exception on an unaligned copy).

Thinking that I was building it wrong, I tried a pre-built version from https://github.com/Flangvik/SharpCollection and had the same error (with the _assemblyName = 'alue>b__2_0')

The workaround is to avoid ParseArray in this case and overload the Load() method to take the name of assembly you upload and then it's all sweet. But I have no idea what's special about SeatBelt which produces such an assembly.

Anyway, thanks again.
Cheers, Tim

Drone DLL Processor Error on attempting to load

Exe and ps1 are working fine, but when I generated a payload for a DLL and try loading it with Assembly.Load

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'drone, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. This assembly was compiled for a different processor.
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, Boolean fSkipIntegrityCheck, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at AssemblyLoader.Program.Main()

If target X86 with my assembly loader and recompile i get the same error, if I specify x64 I get this one:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'drone, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) ---> System.IO.FileLoadException: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, Boolean fSkipIntegrityCheck, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at AssemblyLoader.Program.Main()

Any help would be appreciated

Unable to build

hi, I'm trying to build the project using VS2022 but the packages cannot be restored

Untitled

Cannot build the server.

The error says that .NET 7.0 is needed whereas the target machine already has the requirement, still, the server does not build.

image

teamserver run error

I use the command to run the teamserver on ubuntu.

sudo ./teamserver 172.16.12.13 kitty123

But run error.

./teamserver: 1: Syntax error: "(" unexpected

Race condition

Issue : Race Condition in Task Shell

task sent and running result come and disappear
i think drone sent this frames:
1- Task running with result
2- Task completed with result
3- Task running with result

so there is no result in Client sometimes

image:
race condition 2

Unable to start HTTP/HTTPs Handler

I am attempting to use v1.2.0 of SharpC2. I installed the client app successfully on my Windows 10 VM following the additional instructions from https://learn.microsoft.com/en-us/dotnet/maui/windows/deployment/publish-cli?view=net-maui-6.0. I use a Kali VM for the Teamserver.

However I get "Unhandled exception" even before I can configure a listener for the beacon/drone. I am able to setup a SMB listener though. Not sure why it fails to allow me to setup a HTTP/HTTPs listener. Clicking on Reload and attempting again gives the same error. Screenshot and version details attached

SharpC2-HTTP-Listener

SMB-Listener

On a side note when i start the Teamserver I get no confirmation of the certificate hash either. But I do get a prompt when i connect from the client.

Login

Please add "Dornes added" webhook

Now, webhook only supports "User Authentication" and "Web Log", I would really appreciate it if you can add a webhook when a new drone adds to the server(“got a new fish”)

Readthedocs link

Hi @rasta-mouse ,

Do you know where we can find the latest doco on SharpC2 ? The readthedocs link points to https://sharpc2.readthedocs.io/en/latest/ which is "a Python library for cooks and food lovers that creates recipes mixing random ingredients". While that sounds interesting (and delicious!) I'd love to be able to find more detailed information about SharpC2.

Cheers, Tim

i can't compile

/root/SharpC2/TeamServer/TeamServer.csproj : error NU1101: Unable to find package DonutCore. No packages exist with this id in source(s): nuget.org
Failed to restore /root/SharpC2/TeamServer/TeamServer.csproj (in 7.24 min)

Package DonutCore not found

TeamServer.csproj : error NU1101: Package DonutCore not found. A package with this ID does not exist in source nuget.org

Client cannot compile

/usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-tizen [/root/SharpC2/Client/Client.csproj]
/usr/share/dotnet/sdk/7.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/root/SharpC2/Client/Client.csproj]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.