Git Product home page Git Product logo

havoc's Introduction

Havoc


Havoc is a modern and malleable post-exploitation command and control framework, created by @C5pider.




⚠️ Havoc is in an early state of release. Breaking changes may be made to APIs/core structures as the framework matures.

Support

Consider supporting C5pider on Patreon/Github Sponsors. Additional features are planned for supporters in the future, such as custom agents/plugins/commands/etc.

Quick Start

Please see the Wiki for complete documentation.

Havoc works well on Debian 10/11, Ubuntu 20.04/22.04 and Kali Linux. It's recommended to use the latest versions possible to avoid issues. You'll need a modern version of Qt and Python 3.10.x to avoid build issues.

See the Installation docs for instructions. If you run into issues, check the Known Issues page as well as the open/closed Issues list.


Features

Client

Cross-platform UI written in C++ and Qt

  • Modern, dark theme based on Dracula

Teamserver

Written in Golang

  • Multiplayer
  • Payload generation (exe/shellcode/dll)
  • HTTP/HTTPS listeners
  • Customizable C2 profiles
  • External C2

Demon

Havoc's flagship agent written in C and ASM

  • Sleep Obfuscation via Ekko, Ziliean or FOLIAGE
  • x64 return address spoofing
  • Indirect Syscalls for Nt* APIs
  • SMB support
  • Token vault
  • Variety of built-in post-exploitation commands
  • Patching Amsi/Etw via Hardware breakpoints
  • Proxy library loading
  • Stack duplication during sleep.

Extensibility


Community

You can join the official Havoc Discord to chat with the community!

Contributing

To contribute to the Havoc Framework, please review the guidelines in Contributing.md and then open a pull-request!

Note

Please do not open any issues regarding detection.

The Havoc Framework hasn't been developed to be evasive. Rather it has been designed to be as malleable & modular as possible. Giving the operator the capability to add custom features or modules that evades their targets detection system.

havoc's People

Contributors

0xtriboulet avatar 0xv1n avatar adamsvoboda avatar blacktrace avatar byinarie avatar chbgsmcm avatar codextf2 avatar cracked5pider avatar dabigblob avatar daniruiz avatar djnnvx avatar fplazar avatar h00die avatar iieitaimus avatar janemandy avatar k3nundrum avatar killeven avatar lucasstinson avatar n0isegat3 avatar p4p1 avatar realoriginal avatar rhakb avatar rmusser01 avatar s4ntiagop avatar sect0uch avatar souzomain avatar timoxoszt avatar w33ts avatar youngifif avatar zeromemoryex 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  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

havoc's Issues

Python.h dependency when installing Havoc Client

When installing the Havoc client according to the documentation,
using Ubuntu 22.04,
the following error is encountered:

[  4%] Building CXX object CMakeFiles/Havoc.dir/Havoc_autogen/mocs_compilation.cpp.o
In file included from /Build/Build/Havoc_autogen/BEIJ4H4JXG/../../../Include/UserInterface/Widgets/SessionGraph.hpp:4,
                 from /Build/Build/Havoc_autogen/BEIJ4H4JXG/moc_SessionGraph.cpp:10,
                 from /Build/Build/Havoc_autogen/mocs_compilation.cpp:2:
/Build/Include/global.hpp:43:10: fatal error: Python.h: No such file or directory
   43 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/Havoc.dir/build.make:112: CMakeFiles/Havoc.dir/Havoc_autogen/mocs_compilation.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/Havoc.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

The following python-related packages have been installed:

python3-all-dev 
libpython3.9-dev
python3
python3-dev

Expected behaviour is that the installed Python.h from libpython3.9-dev is found during the search.

Injection issues and Detecting OS issue

Detecting OS Issues

  • Detects host system as Windows 10 when running a demon on Windows 11.
  • Checkin command shows x86 instead of x64 and can't determine OS correctly

image

Injection Issues

When running the command: shellcode inject x64 /home/kali/Github/donut/payload.bin the following is observed

  • When trying to inject into task manager on Windows 11 it gives an error "Error Access denied" but demon is running with same privileges as task manager so not sure what the issue is and both are x64 bit processes,
  • When trying to inject into notepad it looks like it's been successful but it never connects back
  • It does work fine for most other processes though

GUI issue when exiting

  • Trying to remove a dead demon doesn't seem to work. It just stays there.
  • Would it be possible when exiting a demon via the GUI to give an option for thread or process as per cli?
  • When exiting a demon it doesn't automatically mark it as dead. Not sure if this is by design or an issue
  • When exiting a demon, sometimes the timer keeps going up even though the process has been terminated. To the user via GUI this looks like the demon is still active and when you mark it as dead it comes back to life as the timer keeps increasing

Incorrect command description/category for `dotnet list-versions`

Running help dotnet list-versions returns some incorrect information:

  • The command shows that it accepts args
  • The command behavior is marked as fork & run

Location:

{
.CommandString = "list-versions",
.Description = "lists installed/available dotnet versions",
.Behavior = BEHAVIOR_FORK_AND_RUN,
.Usage = "[/path/to/assembly.exe] (args)",
.Example = "/tmp/Seatbelt.exe -group=all -full",
},

Command crashing Demon

Running the command net users works as expected
Running command net localgroup kills the demon

Package Requirements

Requirements on kali.

Teamserver reqs:
go mod download golang.org/x/sys
go mod download github.com/ugorji/go

client reqs:
qtbase5-dev
libqt5websockets5-dev
libspdlog-dev
python3-dev
libboost-all-dev

smb weird behavior

On a smb demon, did dir C:\Windows and the proc list
and the parent disconnected
Parent was http ekko, smb was foliage
image

`token make` crashes Teamserver when "\" is not included in the username.

If token make is sent without \ in the username, the Teamserver will crash.

Fix: Ensure the array values exist after the string split before accessing them.

Issue Location:

ArrayData = strings.Split(string(UserDomain), "\\")
Domain = ArrayData[0]
Username = ArrayData[1]
job.Data = []interface{}{
SubCommand,
Local,
Username,
Password,
Domain,
}

Reproduction

Command sent: token make user pass

Crash:

panic: runtime error: index out of range [1] with length 1

goroutine 9 [running]:
github.com/Cracked5pider/Havoc/teamserver/pkg/demons.TaskPrepare({0xc0002c4c80?, 0xc00042ad88?}, 0x28, {0xae6c20?, 0xc0007ee810})
        /home/kali/Desktop/Havoc/Teamserver/pkg/demons/demons.go:1177 +0x62ec
github.com/Cracked5pider/Havoc/teamserver/pkg/teamserver.(*Teamserver).DispatchEvent(0xc000336900, {{0x7, {0xc0002c4c98, 0x6}, {0xc0007e8cd8, 0x13}, {0x0, 0x0}}, {0x3, 0xc0007ee810}})
        /home/kali/Desktop/Havoc/Teamserver/pkg/teamserver/dispatch.go:89 +0x361d
github.com/Cracked5pider/Havoc/teamserver/pkg/teamserver.(*Teamserver).handleRequest(0xc000336900, {0xc000029936, 0x6})
        /home/kali/Desktop/Havoc/Teamserver/pkg/teamserver/teamserver.go:299 +0x1425
created by github.com/Cracked5pider/Havoc/teamserver/pkg/teamserver.(*Teamserver).Start.func2
        /home/kali/Desktop/Havoc/Teamserver/pkg/teamserver/teamserver.go:91 +0x1f7

Generate payload -> close -> generate payload

close the window before a payload finishes generating and try doing it again and it wont do anything until the first one compiles. maybe print a box saying compilation already in progress or something

[enhancement] callback time

last callback needs a date, or can be done like CS where it shows time since last callback in hours days etc. milliseconds may not be necessary to display

Proc commands not working

  • When running the command proc kill it doen't terminate the process.
  • proc getpid not returning anything

[enhancement] threaded BOFs without breaking sleep obf

maybe have the bof write output to a pipe and the agent can read it on wake. and dont encrypt the bof memory ofc.
Austin suggestion for the implementation:

write a position indendent bof loader, inject it with the BOF, go to sleep. IF the COFF needs to write output, design the BeaconPrintf() API to write to a pipe to read it from the agent.

File Manager - Directory Listing Tree doesn't "Merge" new results when requesting `C:\`

When opening the File Manager UI the Demon will populate the File Manager Directory Tree with the current directory of the demon's executable path.

When typing a new path in the File Manager path box and pressing ENTER, the new results are shown under a new "root" folder instead of being "merged" with the existing results. In this case I requested the path C:\ and the results were returned under a blank root folder, resulting in duplicated folder icons (two Users folders).

image

Observations: Potential Stability Issues and Useability

Stability Issues

I observed that when connecting to a TeamServer, and promptly deleting the connection dialog from another Havoc process on the same host would result in a generic SEGFAULT. I'll dig into this further and see where I can help, I have a feeling its some UAF issue that may have arose.

Useability

Differentiate between dialogs of 'Headers' and 'URI''s. Currently, the behavior is to display the following:

image

When selecting either 'Headers' or 'URI's to insert into the listener dialog. Nothing major, maybe a documentation or useability improvement in the future.

I'll ensure I document any further issues I uncover, and see if I can help out with existing issues.

Havoc.sh error on Ubuntu 20.04

grafik

grafik

After running ./Build.sh successfully

Linux 5.10.16.3-microsoft-standard-WSL2
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal

BOF loader doesnt support some CS BOFs

BOFs in general seem broken. Here's a simple test BOF.

#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include "../../beacon.h"
DECLSPEC_IMPORT DWORD WINAPI KERNEL32$ExitProcess(UINT);

void go(char * args, int length) {
   KERNEL32$ExitProcess(0);
}

this is a simple ExitProcess BOF, and the output is

12-09-2022 02:32:43 [codex] Demon » inline-execute /root/Desktop/cobaltstrike/BOFs/exitprocess/exitprocess.x64.o
[*] [C1BF8A65] Tasked demon to execute an object file: /root/Desktop/cobaltstrike/BOFs/exitprocess/exitprocess.x64.o
[+] Send Task to Agent [1087 bytes]
[!] Symbol not found: $unwind$go
[!] Failed to execute object file [1]

(the process did not exit)

Add .gitignore

Ignore Building folders, profiles and more (maybe go related stuff can also be ignored?).

Command crashing GUI

Running command config implant.verbose terminates the GUI with a segmentation fault error

[Formatting Issues]

Chekin command
image

proc list
image

also do not forget to remove the <-- you are here message

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.