diff --git a/README.md b/README.md index 3cd84c6c..a57bb679 100644 --- a/README.md +++ b/README.md @@ -289,14 +289,21 @@ - [WellCMS 2.0 Beta3 后台任意文件上传](./books/WellCMS%202.0%20Beta3%20后台任意文件上传.pdf) - [国外详细的CTF分析总结文章(2014-2017年)](https://github.com/ctfs) - [这是一篇“不一样”的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码](./books/这是一篇"不一样"的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码-%20奇安信A-TEAM技术博客.pdf)|[原文地址](https://blog.ateam.qianxin.com/post/zhe-shi-yi-pian-bu-yi-yang-de-zhen-shi-shen-tou-ce-shi-an-li-fen-xi-wen-zhang/) -- [CobaltStrike4.0用户手册_中文翻译_3](./books/CobaltStrike4.0用户手册_中文翻译_3.pdf) - [表达式注入.pdf](./books/表达式注入.pdf) - [WordPress ThemeREX Addons 插件安全漏洞深度分析](./books/WordPress%20ThemeREX%20Addons%20插件安全漏洞深度分析.pdf) - [通达OA文件包含&文件上传漏洞分析](./books/通达OA文件包含&文件上传漏洞分析.pdf) - [高级SQL注入:混淆和绕过](./books/高级SQL注入:混淆和绕过.pdf) - [权限维持及后门持久化技巧总结](./books/权限维持及后门持久化技巧总结.pdf) +- [CobaltStrike4.0用户手册_中文翻译_3](./books/CobaltStrike4.0用户手册_中文翻译_3.pdf) - [Cobaltstrike 4破解之 我自己给我自己颁发license.pdf](./books/Cobaltstrike%204破解之%20我自己给我自己颁发license.pdf) - [Cobalt Strike 4.0 更新内容介绍](./books/Cobalt%20Strike%204.0%20更新内容介绍.pdf) +- [Cobal_Strike_自定义OneLiner](./books/Cobal_Strike_自定义OneLiner_Evi1cg's_blog.pdf) +- [cobalt strike 快速上手 [ 一 ]](./books/cobalt%20strike%20快速上手 [ 一 ]%20-%20klion's blog.pdf) +- [Cobalt strike3.0使用手册](./books/Cobalt%20strike3.0使用手册 _ Evi1cg's blog.pdf) +- [Cobalt_Strike_Spear_Phish_CS邮件钓鱼制作](./books/Cobalt_Strike_Spear_Phish_Evi1cg's blog CS邮件钓鱼制作.md) +- [Remote NTLM relaying through CS](./books/Remote NTLM relaying through CS _ Evi1cg's blog.pdf) +- [渗透测试神器Cobalt Strike使用教程](./books/渗透测试神器Cobalt%20Strike使用教程.pdf) +- [Cobalt Strike的teamserver在Windows上快速启动脚本](./books/CS_teamserver_win.md) ## 说明 diff --git a/books/CS_teamserver_win.md b/books/CS_teamserver_win.md new file mode 100644 index 00000000..b5bb90a3 --- /dev/null +++ b/books/CS_teamserver_win.md @@ -0,0 +1,55 @@ +CS的teamserver经常是在linux服务器上跑的,有小伙伴问在win server上怎么跑,所以弄了一个批处理,需要的看着改改,win上面需要装[`java JDK`](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html),win上默认没有keytool,所以需要自己去生成一个cobaltstrike.store ~ + +``` +@echo off +:check_java + java -version >nul 2>&1 + if %errorLevel% == 0 ( + goto:check_permissions + ) else ( + echo [-] is Java installed? + goto:eof + ) + +:check_permissions + echo [+] Administrative permissions required. Detecting permissions... + set TempFile_Name=%SystemRoot%\System32\BatTestUACin_SysRt%Random%.batemp + (echo "BAT Test UAC in Temp" >%TempFile_Name% ) 1>nul 2>nul + if exist %TempFile_Name% ( + echo [+] Success: Administrative permissions confirmed. + del %TempFile_Name% 1>nul 2>nul + goto:check_certificate + ) else ( + echo [-] Failure: Current permissions inadequate. + goto:eof + ) + +:check_certificate + set certificate=".\cobaltstrike.store" + if exist %certificate% ( + goto:test_arguments + ) else ( + echo [!] Please generate the cobaltstrike.store ! + echo [!] Example: keytool -keystore ./cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias cobaltstrike -dname "CN=Major Cobalt Strike, OU=AdvancedPenTesting, O=cobaltstrike, L=Somewhere, S=Cyberspace, C=Earth" + goto:eof + ) + +:test_arguments + set argC=0 + for %%x in (%*) do Set /A argC+=1 + if %argC% LSS 2 ( + echo [-] teamserver ^ ^ [/path/to/c2.profile] [YYYY-MM-DD] + echo ^ is the default IP address of this Cobalt Strike team server + echo ^ is the shared password to connect to this server + echo [/path/to/c2.profile] is your Malleable C2 profile + echo [YYYY-MM-DD] is a kill date for Beacon payloads run from this server + goto:eof + ) else ( + goto:run_cobal + ) +:run_cobal + java -XX:ParallelGCThreads=4 -Dcobaltstrike.server_port=50050 -Djavax.net.ssl.keyStore=./cobaltstrike.store -Djavax.net.ssl.keyStorePassword=123456 -server -XX:+AggressiveHeap -XX:+UseParallelGC -classpath ./cobaltstrike.jar server.TeamServer %* +``` + +![img](./books/img/17.png) + diff --git "a/books/Cobal_Strike_\350\207\252\345\256\232\344\271\211OneLiner_Evi1cg's_blog.pdf" "b/books/Cobal_Strike_\350\207\252\345\256\232\344\271\211OneLiner_Evi1cg's_blog.pdf" new file mode 100644 index 00000000..09f121e0 Binary files /dev/null and "b/books/Cobal_Strike_\350\207\252\345\256\232\344\271\211OneLiner_Evi1cg's_blog.pdf" differ diff --git "a/books/Cobalt strike3.0\344\275\277\347\224\250\346\211\213\345\206\214 _ Evi1cg's blog.pdf" "b/books/Cobalt strike3.0\344\275\277\347\224\250\346\211\213\345\206\214 _ Evi1cg's blog.pdf" new file mode 100644 index 00000000..169ce7ac Binary files /dev/null and "b/books/Cobalt strike3.0\344\275\277\347\224\250\346\211\213\345\206\214 _ Evi1cg's blog.pdf" differ diff --git "a/books/Cobalt_Strike_Spear_Phish_Evi1cg's blog CS\351\202\256\344\273\266\351\222\223\351\261\274\345\210\266\344\275\234.md" "b/books/Cobalt_Strike_Spear_Phish_Evi1cg's blog CS\351\202\256\344\273\266\351\222\223\351\261\274\345\210\266\344\275\234.md" new file mode 100644 index 00000000..a96f317c --- /dev/null +++ "b/books/Cobalt_Strike_Spear_Phish_Evi1cg's blog CS\351\202\256\344\273\266\351\222\223\351\261\274\345\210\266\344\275\234.md" @@ -0,0 +1,105 @@ +Cobalt Strike Spear Phish | Evi1cg's blog + +![img](./img/01.jpg) + +## 0x00 简介 + +关于 Spear phish 和发件人伪造的工具有很多个,比如 [gophish](https://getgophish.com/)、 [SimpleEmailSpoofer](https://github.com/lunarca/SimpleEmailSpoofer)、命令行工具 swaks 等,每个工具都有其特点,当然 Cobalt Strike 也有此功能。官方介绍[戳我](https://cobaltstrike.com/help-spear-phish)。今天主要来介绍一下 CS 里面的此功能怎么使用。 + +## 0x01 CS Spear Phish + +CS 的 Spear Phish 位置在: + +![img](./img/02.jpg) + +一张图说明功能: + +![img](./img/03.jpg) + +使用此功能的前提是需要有一个 smtp 服务器来供我们来转发邮件,当然可以使用公共 smtp 服务,另外也可以参考[《Something about email spoofing》](https://evi1cg.github.io/archives/Email_spoofing.html) 中提到的方法来搭建。 +这里的使用很简单,首先构造目标列表,使用: + +中间的分隔符为 [tab], 可以不添加 name + +添加好以后就是这个样子: + +![img](./img/04.jpg) + +下面,要配置发件模板,这里配置很简单,只需要复制一份原始邮件即可,比如一份密码重置邮件: + +![img](./img/05.jpg) + +选择显示原始邮件,并将其内容保存。 + +在这里如果要伪造发件人,需要修改`From:` + +![img](./img/06.jpg) + +否则就不需要做什么别的修改。之后,配置对应的`Mail server`,就可以进行发送邮件了,这里需要注意一点, 为了绕过 SPF 的检查,`Bunce to`需设置为与`Mail server`同域,如`Mail server`为 `mail.evi1cg.me`,`Bunce to`可设置为 [`admin@evi1cg.me](mailto:`admin@evi1cg.me)`。 + + +之后点击`Send`则可发送邮件,收到的邮件与模板一致。 + +![img](./img/07.jpg) + +另外查看 SRF 为`PASS`状态: + + + +![img](./img/08.jpg) + +另外,CS 也有发送附件的功能,但是原版本的 CS 发送附件有一个 Bug,即如果附件为中文名称,则会在最后的邮件中显示乱码附件: + +![img](./img/09.jpg) + +所以在这里我们需要对 CS 动刀了,经过调试,成功定位到`mail\Eater.java`,需要对此类中的`createAttachment`方法进行修改: + +``` +private BodyPart createAttachment(String name) throws IOException { + File file = new File(name); + String namez = file.getName(); + String filename = new String(namez.getBytes("utf-8"),"ISO8859-1"); + Body body = (new StorageBodyFactory()).binaryBody((InputStream)(new FileInputStream(name))); + Map temp = new HashMap(); + temp.put("name", filename); + BodyPart bodyPart = new BodyPart(); + bodyPart.setBody(body, "application/octet-stream", temp); + bodyPart.setContentTransferEncoding("base64"); + bodyPart.setContentDisposition("attachment"); + bodyPart.setFilename(filename); + return bodyPart; +} +``` + +这样就可以解决附件乱码问题了: + +![img](./img/10.jpg) + +## 0x02 Web clone + +另外在这里还有一个与 Web Clone 结合的地方,首先,我们先 Clone 一个需登录的网站,如网易邮箱: + +![img](./img/11.jpg) + +这里可以选择开启键盘记录功能。 + +开启 Clone: + +![img](./img/12.jpg) + +设置 spear phish: + +![img](./img/13.jpg) + +Embed URL 选择刚刚克隆的 url,发送邮件,此时用户点击重置按钮,则会跳转到 Clone 的站点: + +![img](./img/14.gif) + +此时,用户输入会被记录: + +![img](./img/15.gif) + +emmm. 大概就介绍这么多吧。 + +原文地址: + diff --git a/books/Remote NTLM relaying through CS _ Evi1cg's blog.pdf b/books/Remote NTLM relaying through CS _ Evi1cg's blog.pdf new file mode 100644 index 00000000..b27390b3 Binary files /dev/null and b/books/Remote NTLM relaying through CS _ Evi1cg's blog.pdf differ diff --git "a/books/cobalt strike \345\277\253\351\200\237\344\270\212\346\211\213 [ \344\270\200 ] - klion's blog.pdf" "b/books/cobalt strike \345\277\253\351\200\237\344\270\212\346\211\213 [ \344\270\200 ] - klion's blog.pdf" new file mode 100644 index 00000000..f26d9f32 Binary files /dev/null and "b/books/cobalt strike \345\277\253\351\200\237\344\270\212\346\211\213 [ \344\270\200 ] - klion's blog.pdf" differ diff --git "a/books/\346\270\227\351\200\217\346\265\213\350\257\225\347\245\236\345\231\250Cobalt Strike\344\275\277\347\224\250\346\225\231\347\250\213.pdf" "b/books/\346\270\227\351\200\217\346\265\213\350\257\225\347\245\236\345\231\250Cobalt Strike\344\275\277\347\224\250\346\225\231\347\250\213.pdf" new file mode 100644 index 00000000..064e2a24 Binary files /dev/null and "b/books/\346\270\227\351\200\217\346\265\213\350\257\225\347\245\236\345\231\250Cobalt Strike\344\275\277\347\224\250\346\225\231\347\250\213.pdf" differ