配置文件的webhook支持discord,所以尝试使用钉钉和企业微信。

WebHook {
Discord {
Url = ""
AvatarUrl = ""
User = "announcer"
}
}

服务端中判断如果配置了webhook会在自身添加agent之前就转发给discord了。

func (t *Teamserver) AgentAdd(Agent *agent.Agent) []*agent.Agent {
if Agent != nil {
if t.WebHooks != nil {
t.WebHooks.NewAgent(Agent.ToMap())
}
}
...
}

可以看到在上线时,server的控制台上会有上线的信息。

借鉴一个老哥的做法:起个子程序来开服务端,同时监听并捕获这个信息:

    process = subprocess.Popen(['./havoc', 'server', '--profile', './profiles/havoc.yaotl', '-v', '--debug'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True) capture = False // 获取到前四行即可
if "[DBUG] [agent.ParseDemonRegisterRequest:382]" in line:
capture = True
captured_text = ""
line_count = 0
continue if capture:
if line_count < 5:
captured_text += line + '\n'
line_count += 1
else: #
send_messages('New connection!\n'+captured_text.strip())
capture = False

然后根据官方文档 发送text类型的消息,markdown可以但是在微信中不能正常显示。

上面是markdown下面是text文本,代码也上传了:gayhub

​​​​

但这样并不是很好,而翻官方文档,里面有提供对客户端api的详细说明,主要涉及到havoc和havocui这两个。

对于ui可以直接在客户端的console中尝试他的效果:

像获取demons的数量可以用havoc.GetDemons()

文档中介绍了一些比较常用的api,在\client\src\Havoc\PythonApi​有更多的调用方向,比如下面的:

PyMemberDef PyDemonClass_members[] = {

        { "Listener",       T_STRING, offsetof( PyDemonClass, Listener ),    0, "Listener name" },
{ "DemonID", T_STRING, offsetof( PyDemonClass, DemonID ), 0, "Listener name" },
{ "ExternalIP", T_STRING, offsetof( PyDemonClass, ExternalIP ), 0, "External IP" },
{ "InternalIP", T_STRING, offsetof( PyDemonClass, InternalIP ), 0, "Internal IP" },
{ "User", T_STRING, offsetof( PyDemonClass, User ), 0, "Username" },
{ "Computer", T_STRING, offsetof( PyDemonClass, Computer ), 0, "Computer" },
{ "Domain", T_STRING, offsetof( PyDemonClass, Domain ), 0, "Domain" },
{ "OS", T_STRING, offsetof( PyDemonClass, OS ), 0, "Windows Version" },
{ "OSBuild", T_STRING, offsetof( PyDemonClass, OSBuild ), 0, "Windows OS Build" },
{ "OSArch", T_STRING, offsetof( PyDemonClass, OSArch ), 0, "Windows Architecture" },
{ "ProcessName", T_STRING, offsetof( PyDemonClass, ProcessName ), 0, "Process Name" },
{ "ProcessID", T_STRING, offsetof( PyDemonClass, ProcessID ), 0, "Process ID" },
{ "ProcessArch", T_STRING, offsetof( PyDemonClass, ProcessArch ), 0, "Process Architecture" }, { "CONSOLE_INFO", T_INT, offsetof( PyDemonClass, CONSOLE_INFO ), 0, "Console message type info" },
{ "CONSOLE_ERROR", T_INT, offsetof( PyDemonClass, CONSOLE_ERROR ), 0, "Console message type error" },
{ "CONSOLE_TASK", T_INT, offsetof( PyDemonClass, CONSOLE_TASK ), 0, "Console message type task" }, { NULL },
}; PyMethodDef PyDemonClass_methods[] = { { "ConsoleWrite", ( PyCFunction ) DemonClass_ConsoleWrite, METH_VARARGS, "Prints messages to the demon sessions console" },
{ "ProcessCreate", ( PyCFunction ) DemonClass_ProcessCreate, METH_VARARGS, "Creates a Process" },
{ "InlineExecute", ( PyCFunction ) DemonClass_InlineExecute, METH_VARARGS, "Executes a coff file in the context of the demon sessions" },
{ "InlineExecuteGetOutput", ( PyCFunction ) DemonClass_InlineExecuteGetOutput, METH_VARARGS, "Executes a coff file in the context of the demon sessions and get the output via a callback" },
{ "DllSpawn", ( PyCFunction ) DemonClass_DllSpawn, METH_VARARGS, "Spawn and injects a reflective dll and get output from it" },
{ "DllInject", ( PyCFunction ) DemonClass_DllInject, METH_VARARGS, "Injects a reflective dll into a specified process" },
{ "DotnetInlineExecute", ( PyCFunction ) DemonClass_DotnetInlineExecute, METH_VARARGS, "Executes a dotnet assembly in the context of the demon sessions" },
{ "Command", ( PyCFunction ) DemonClass_Command, METH_VARARGS, "Run a command" },
{ "CommandGetOutput", ( PyCFunction ) DemonClass_CommandGetOutput, METH_VARARGS, "Run a command and retreive the output" },
{ "ShellcodeSpawn", ( PyCFunction ) DemonClass_ShellcodeSpawn, METH_VARARGS, "Executes shellcode spawning a new process" }, { NULL },
};

代码的逻辑也很简单,就是通过havoc.Demon(demon_id)​获取到这个对象,抽出这里面的对象发送即可。代码可以去仓库看看。最终完成的效果如下:

最后也是正常能提示了,传送门:gayhub(一起交流)

Havoc插件编写的更多相关文章

  1. jQuery插件编写及链式编程模型小结

    JQuery极大的提高了我们编写JavaScript的效率,让我们可以愉快的编写代码,做出各种特效.大多数情况下,我们都是使用别人开发的JQuery插件,今天我们就来看看如何把我们常用的功能做出JQu ...

  2. Wireshark插件编写

    Wireshark插件编写 在抓包的过程中学习了使用wireshark,同时发现wireshark可以进行加载插件,便在网上学习了一下相应的插件开发技术. 需求编写一个私有协议名为SYC,使用UDP端 ...

  3. typecho插件编写教程1 - 从HelloWorld说起

    typecho插件编写教程1 - 从HelloWorld说起 老高 187 5月25日 发布 推荐 0 推荐 收藏 2 收藏,189 浏览 最近老高正在编写一个关于typecho的插件,由于typec ...

  4. jQuery插件编写及链式编程模型

    jQuery插件编写及链式编程模型小结 JQuery极大的提高了我们编写JavaScript的效率,让我们可以愉快的编写代码,做出各种特效.大多数情况下,我们都是使用别人开发的JQuery插件,今天我 ...

  5. vue插件编写与实战

    关于 微信公众号:前端呼啦圈(Love-FED) 我的博客:劳卜的博客 知乎专栏:前端呼啦圈 前言 热爱vue开发的同学肯定知道awesome-vue 这个github地址,里面包含了数以千计的vue ...

  6. chart.js angular组件封装(ng6)、实战配置、插件编写

    前言 项目需要使用chart.js插件,由于项目是使用angular开发,那么我第一步就是先把chart.js改造成angular组件来使用. 本项目代码都可以在github上下载:项目git地址 a ...

  7. Gulp:插件编写入门

    之前挖了个坑,准备写篇gulp插件编写入门的科普文,之后迟迟没有动笔,因为不知道该肿么讲清楚Stream这货,毕竟,gulp插件的实现不像grunt插件的实现那么直观. 好吧,于是决定单刀直入了.文中 ...

  8. 关于chrome插件编写的小结

    一个插件的大致目录结构如下: 其中manifest文件最为重要,它定义/指明插件应用的相关信息(权限.版本.功能说明等),点此查看Manifest的详情>>   这里有一篇chrome官方 ...

  9. chrome插件编写基本入门

    chrome插件编写基本入门  http://igeekbar.com/igeekbar/post/331.htm #精选JAVASCRIPTCHROME 作为一名程序猿,怎么能不会写chrome插件 ...

  10. [Linux实用工具]munin-node插件配置和插件编写

    前面介绍了2篇munin使用的相关文章: [Linux实用工具]Linux监控工具munin的安装和配置 [Linux实用工具]Linux监控工具munin的展示(Nginx)   这次介绍一下mun ...

随机推荐

  1. modbus转profinet网关连接UV系列流量计程序实例

    modbus转profinet网关连接UV系列流量计程序实例 用户现场是西门子1200PLC通过兴达易控Modbus转Profinet网关连接流量计的配置,对流量瞬时值及报警值监控及控制程序案例 硬件 ...

  2. GPT-4 API waitlist

    Skip to main content Site Navigation GPT-4 API waitlist We're making GPT-4 available as an API for d ...

  3. Top 5 Code Smells Newbies Developers Could Easily Identify & Avoid

    Posted by Ajitesh Kumar / In Freshers, Software Quality / February 1, 2014 Following is one very pop ...

  4. 使用PasteSpider把你的代码升级到服务器的Docker/Podman上,K8S太庞大,PasteSpider极易上手!

    如果你的服务器的内存小于16GB,那么K8S就和你无缘了,但是你可以使用PasteSpider来实现发布你的项目到服务器上! PasteSpider是一个运维工具,使用NET编写的,部署于服务器的Do ...

  5. LLM探索:为ChatGLM2的gRPC后端增加连续对话功能

    前言 之前我做 AIHub 的时候通过 gRPC 的方式接入了 ChatGLM 等开源大模型,对于大模型这块我搞了个 StarAI 框架,相当于简化版的 langchain ,可以比较方便的把各种大模 ...

  6. zend framework 数据库操作(DB操作)总结

    (1)数据查询总结 fetchRow()这个方法返回一行,具体返回是相关数组还是什么用setFetchMode()决定fetchCol()返回第一列fetchOne()返回第一行,第一列.为一个值不是 ...

  7. codeforce 827div4

    第一次在codeforce上打题,补一下题记录成长 D题 分析:求数组中两个互质的数的最大下标和: 思路:观察到数据范围n是2e5暴力做n^2会超时,再观察数据a[i]最大为1000,所以这2e5个数 ...

  8. PXE批量网络装机

    PXE高效批量网络装机 系统装机的三种引导方式 1.硬盘 2.光驱(u盘) 3.网络启动 pxe 系统安装过程 加载boot loader Boot Loader 是在操作系统内核运行之前运行的一段小 ...

  9. 【LGR-161-Div.3】洛谷基础赛 #4 P9688 Colo.

    原题链接:P9688 Colo. 很显然,能够共存的颜色一定不会相交,所以可以记录每个颜色最左边的位置和最右边的位置,我们对于每个颜色只考虑,这个颜色左边的可以和这个颜色共存的额颜色 用f[i][j] ...

  10. Ubuntu 20.04 查看显示器信息

    安装 ddcutil apt install ddcutil 输入命令 ddcutil detect --verbose 输出类似如下: Output level: Verbose Reporting ...