forked from Mr-xn/Penetration_Testing_POC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ^<host^> ^<password^> [/path/to/c2.profile] [YYYY-MM-DD] | ||
echo ^<host^> is the default IP address of this Cobalt Strike team server | ||
echo ^<password^> 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) | ||
|
Binary file not shown.
Binary file not shown.
105 changes: 105 additions & 0 deletions
105
books/Cobalt_Strike_Spear_Phish_Evi1cg's blog CS邮件钓鱼制作.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`可设置为 [`[email protected]](mailto:`[email protected])`。 | ||
|
||
|
||
之后点击`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. 大概就介绍这么多吧。 | ||
|
||
原文地址:<https://evi1cg.me/archives/spear_phish.html> | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.