[hidecontent type="logged" desc="隐藏内容:登录后可查看"]
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall
/opt/metasploit-framework/bin/msfconsole
安装后,您可以从终端窗口启动 msfconsole ,或者根据您的环境,它可能已经在您的路径中,您可以直接运行它。首次运行时,一系列提示将帮助您设置数据库并将 Metasploit 添加到本地 PATH(如果尚未添加)。
这些包集成到您的包管理器中,可以使用msfupdate
命令或您的包管理器进行更新。首次启动时,这些包将自动设置数据库或使用您现有的数据库。
$DownloadLocation
并且不会在脚本运行后被删除。
[CmdletBinding()]
Param(
$DownloadURL = "https://windows.metasploit.com/metasploitframework-latest.msi",
$DownloadLocation = "$env:APPDATA/Metasploit",
$InstallLocation = "C:\Tools",
$LogLocation = "$DownloadLocation/install.log"
)
If(! (Test-Path $DownloadLocation) ){
New-Item -Path $DownloadLocation -ItemType Directory
}
If(! (Test-Path $InstallLocation) ){
New-Item -Path $InstallLocation -ItemType Directory
}
$Installer = "$DownloadLocation/metasploit.msi"
Invoke-WebRequest -UseBasicParsing -Uri $DownloadURL -OutFile $Installer
& $Installer /q /log $LogLocation INSTALLLOCATION="$InstallLocation"
[/hidecontent]