Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 56 additions & 1 deletion docs/12. Client Script.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@ This section describes all of the different API functions that can be used to
control the client side of havoc. The API scripting language of choice is python
to allow users to utilise the power and simplicity of python.

## Installing extensions

### Manual Install

If you wish to install Havoc client side modules manually it is quite easy. The
Havoc app provides a script manager tab where modules can be loaded. This can
be accessed through Scripts > Scripts Manager.

![Havoc Script Manager page](/images/assets/HavocScriptManager.png)

You can either select *Load Script* to load a script or select a currently loaded
script to either Reload it or removes it.

![Havoc Script Manager page](/images/assets/HavocScriptManagerSubMenu.png)

### Extensions tab inside of the GUI

The havoc python API also includes a store where you can download directly inside
of havoc different extensions for the front-end. This interface is accessible to
users through Attack > Extensions.

#### Contribute your extensions to the store

Currently the store is located on the [following repo](https://github.com/p4p1/havoc-store)
more details can be found directly there on publishing your own module. Make sure
that your module does not change the directory of Havoc with *os.chdir* to not
break dependencies. You can publish your module by doing a pull request directly
on the repo after editing the json file that is downloaded by the front-end inside
of public/havoc-modules.json. A json entry should look like the following:
```
{
"title":"<your title>",
"description":"<Your description>",
"author":"<Your username on github>",
"link":"<the link to the module>",
"preview":"<The preview image of the module",
"category": {
"BOF": false,
"Console": false,
"Graphical": true
}
}
```

![Havoc Extensions page](/images/assets/HavocExtentions.png)

## Python API Documentation

The python api is divided in two main section the havoc and havocui modules. The
Expand Down Expand Up @@ -382,7 +428,7 @@ import havoc

instance = havoc.Demon("identifier")
TaskID = instance.ConsoleWrite(havoc.CONSOLE_TASK, "Launching a command")
demon.DotnetInlineExecute( TaskID, "powershell \"Get-ChildItem -Path C:\\\\ -Filter *.exe -Recurse\"") )
demon.Command( TaskID, "powershell \"Get-ChildItem -Path C:\\\\ -Filter *.exe -Recurse\"") )
```

#### havoc.Event()
Expand Down Expand Up @@ -1419,6 +1465,15 @@ tree.setBottomTab()

## Examples

### External resources
Provided are different blog posts where people from the community have extended havoc through the API
- [Extending Havoc C2](https://codex-7.gitbook.io/codexs-terminal-window/red-team/red-team-dev/extending-havoc-c2)
- [Shhhavoc dev log](https://jakobfriedl.github.io/blog/shhhavoc.html)
- [Havocui module devlog](https://leosmith.wtf/blog/havoc-c2-pythonapi.html)
- [Havocui Widget module devlog](https://leosmith.wtf/blog/havocui-widget-python.html)
- [Havocui Logger module devlog](https://leosmith.wtf/blog/havoc-gui-advancements.html)
- [Havocui Style widget devlog](https://leosmith.wtf/blog/havoc-again.html)

### Shhhavoc.py
#### Description
A port of the [Shhhloader](https://github.com/icyguider/Shhhloader) program to
Expand Down
Binary file added public/images/assets/HavocExtensions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/assets/HavocScriptManager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.