-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
29 lines (24 loc) · 903 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# encoding:utf-8
import argparse
import time
from dingtalkchatbot.chatbot import DingtalkChatbot
parser = argparse.ArgumentParser(description='Beacon Info')
parser.add_argument('--computername')
parser.add_argument('--internalip')
parser.add_argument('--externalip')
parser.add_argument('--username')
args = parser.parse_args()
internalip = args.internalip
externalip = args.externalip
computername = args.computername
username = args.username
content = f"""## <font color=Red>CobaltStrike 上线提醒</font>\n
**主机名: {computername}**\n
**内网IP: {internalip}**\n
**回连IP: {externalip}**\n
**用户名: {username}**\n
**上线时间: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))}**\n
"""
webhook = 'https://oapi.dingtalk.com/robot/send?access_token=xxx' // TODO 进行替换
xiaoding = DingtalkChatbot(webhook)
xiaoding.send_markdown(title="CS上线", text=content)