配置文件的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. Solution -「GXOI / GZOI 2019」宝牌一大堆

    Description Link. Summarizing the fucking statement is the last thing in the world I ever want to do ...

  2. Teamcener AWC Solr链接被拒

    1.检查安装Solr安装情况 2.在tem上勾选添加 安装完成后,总共有2个文件夹需要注意,一个 solr-版本 的文件夹,一个 TcFTSindexer 的文件夹 如果是solr安装的是服务,则不需 ...

  3. 记一次 .NET某新能源MES系统 非托管泄露

    一:背景 1. 讲故事 前些天有位朋友找到我,说他们的程序有内存泄露,跟着我的错题集也没找出是什么原因,刚好手头上有一个 7G+ 的 dump,让我帮忙看下是怎么回事,既然找到我了那就给他看看吧,不过 ...

  4. 校招零Offer要不要先找实习?

    国庆前后被问到最多的问题是:"磊哥,我现在还是 0 Offer,要不要先去找个实习?",给大家看看部分截图. 同学 A: 同学 B: 同学 C: 其他还有一些截图,我这里就不一一贴 ...

  5. 轻松掌握组件启动之MongoDB(上):高可用复制集架构环境搭建

    MongoDB复制集 复制集架构 在生产环境中,强烈不建议使用单机版的MongoDB服务器.原因如下: 单机版的MongoDB无法保证系统的可靠性.一旦进程发生故障或是服务器宕机,业务将直接不可用.此 ...

  6. Go反射终极指南:从基础到高级全方位解析

    在本文中,我们将全面深入地探讨Go语言的反射机制.从反射的基础概念.为什么需要反射,到如何在Go中实现反射,以及在高级编程场景如泛型编程和插件架构中的应用,本文为您提供一站式的学习指南. 关注[Tec ...

  7. windows上时间项目时间正常,Ubuntu16.04上时间错误

    项目本次测试时间正常,放到服务器上时间差8个小时 1.查看Ubuntu系统时间,发现时间设置错误 date -R 该命令会把我们系统的时间还有时区显示出来,我们是属于东八区,如下图: 如果不是 +08 ...

  8. Util应用框架基础(六) - 日志记录(三) - 写入 Seq

    本文是Util应用框架日志记录的第三篇,介绍安装和写入 Seq 日志系统的配置方法. 安装 Seq Seq是一个日志管理系统,对结构化日志数据拥有强大的模糊搜索能力. Util应用框架目前主要使用 S ...

  9. rust程序设计(3)结构体相关概念和疑问

    结构体 // 如何定义结构体 struct User { active: bool, username: String, email: String, sign_in_count: u64, } // ...

  10. python之继承的方法重写

    目录 普通方法 方法重写super().xxx() 我们在python之继承及其实现方法中已经学会了打印子类在父类继承的属性 那么我们怎么打印出子类中特有的属性呢 普通方法 我们当然可以在子类中添加新 ...