Coder Social home page Coder Social logo

cs-pushplus's Introduction

CS-PushPlus

使用免费且支持微信模板消息推送的 PushPlus 进行上线主机提醒

如果有订阅 ServerChan 的企业微信推送通道可以移步:https://github.com/lintstar/CS-ServerChan

前言

Mac 版微信目前不支持企业微信消息推送 而 Server 酱从8月开始不再使用微信模板消息通知

因此需要换一种新的推送方式

配置相关信息

登录 PushPlus(推送加)

image-20210812105852128

脚本有两个地方需要替换:

PushPlus.py

http://www.pushplus.plus/push1.html 复制自己的 token 替换到下面的地方

image-20210812104818949

这里的通知模板支持 Markdown 格式可以随意替换

image-20210812104840045

PushPuls.cna

在客户端或者服务端后台挂载时,需要改成 PushPlus.py Python 脚本所在的绝对路径(从盘符开始)

image-20210812110028880

通过 CobaltStike 服务端 / 客户端 挂载脚本,将上线主机信息通过 PushPlus 微信模板消息通知到微信

服务端后台挂载

把 cna 脚本添加到本地客户端后,如果beacon上线了,这个提醒的请求是从客户端发出的。

如果网络有波动,断开了到 teamserver 的连接,就收不到通知了。

解决方法是使用 agscript 在服务器端运行cna文件,和挂载 CobaltStrike 一样,把 cna 脚本也挂载到后台:

 [root@Catherine CS4.3]# screen
 [root@Catherine CS4.3]# ./agscript xx.xxx.xx.xxx [port] Catherine [passwd] CS-PushPlus/PushPlus.cna
 Initial Beacon Checkin: 2122252342 PID: 3488
 Sending server: python3 /root/Tools/CS4.3/CS-PushPlus/PushPlus.py --computernam LINTSTAR82CF --internalip 10.xx.xx.15 --username lintstar

挂载后查看进程:

 [root@Catherine ~]# ps -a
     PID TTY          TIME CMD
 1045504 pts/0    00:00:00 teamserver
 1045507 pts/0    00:00:12 java
 1049085 pts/4    00:00:00 bash
 1049086 pts/4    00:00:08 java
 1055932 pts/7    00:00:00 ps

Agscript 用法

这里 agscript 的用法为:

 ./agscript [host] [port] [user] [pass] </path/to/file.cna>
  • [host] # 服务器的 ip 地址。
  • [port] # cs 的端口号,启动 cs 时有显示。
  • [user] # 后台挂载脚本时连接到 teamserver 的用户名。
  • [pass] # 启动服务端 cs 时设置的密码。
  • [path] # cna 文件的路径。

效果

Mac版微信

image-20210812110851409

手机微信

image-20210812111423987

cs-pushplus's People

Contributors

lintstar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.