[Installing Metasploit Framework on CentOS_RHEL 6]在CentOS_RHEL 6上安装Metasploit的框架【翻译】...

[Installing Metasploit Framework on CentOS_RHEL 6]在CentOS_RHEL 6上安装Metasploit的框架【翻译】

 

标记声明:蓝色汉子为翻译上段英文内容,黄色文字为执行命令。英文水平有限,如有疏漏还请指出。文章出处 博客园-初行

All command in the guide need to be ran as root. To switch to root and have all the proper variables run:

在本教程中的所有命令需要使用root账户。切换到root账户保证所变量正确执行:

su -

 

Installing Dependencies

安装依赖关系

We start by making sure that we have the latest packages by updating the system using yum:

首先,我们要确保我们所使用yum更新系统拥有最新的软件包:

yum update

yum upgrade

 

Now that we know that we are running an updated system we can install all the dependent packages that are needed by Metasploit Framework:

现在我们知道,我们正在运行一个更新过的系统,我们可以安装所有需要通过Metasploit的框架的依赖包:

yum groupinstall 'Development Tools'

yum install sqlite-devel libxslt-devel libxml2-devel java-1.7.0-openjdk libpcap-devel nano openssl-devel zlib-devel libffi-devel gdbm-devel readline-devel nano wget

 

Installing Ruby 1.9.3

安装Ruby1.9.3

CentOS/RHEL is a solid operating system but sadly it does not tend to run the latest in term of packages so we have to compile and install by hand the YAML and Ruby 1.9.3 software.

CentOS/ RHEL操作系统非常的稳定,但遗憾的是它对最新的软件包不能很好支持,所以我们要手动编译和安装YAML和Ruby1.9.3。

First we download and install the latest version of YAML.

首先我们下载并安装最新的YAML版本。

cd /usr/src

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz

tar zxf yaml-0.1.4.tar.gz

cd yaml-0.1.4

./configure --prefix=/usr/local

make && make install

 

Now we download and install the latest version of Ruby 1.9.3

现在,我们下载并安装Ruby1.9.3的最新版本

cd /usr/src

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz

tar xvzf ruby-1.9.3-p374.tar.gz

cd ruby-1.9.3-p374

./configure --prefix=/usr/local --with-opt-dir=/usr/local/lib

make & make install

 

Installing Nmap

安装Nmap

One of the external tools that Metasploit uses for scanning that is not included with the sources is Nmap. Here we will cover downloading the latest source code for Nmap, compiling and installing:

其中一个是Metasploit的使用扫描的外部工具,Nmap不包含在源中。在这里,我们将介绍用于下载Nmap的最新的源代码,编译和安装:

cd /usr/src

svn co https://svn.nmap.org/nmap

cd nmap

./configure

make

make install

make clean

 

Configuring Postgre SQL Server

配置Postgre的SQL Server

The version that comes with CentOS/RHEL is quite old so we need to modify our system to install the latest from PostgreSQL directly. Open /etc/yum.repos.d/CentOS-Base.repo and add to the [base] and [update] sections:

CentOS/ RHEL中附带的版本很老,所以我们需要修改我们的系统可以直接安装最新的PostgreSQL的。打开/ etc / yum.repos.d/ CentOS-Base.repo,并加入到[base]和[updatge]部分:

exclude=postgresql*

 

Now we can install the Postgres official repository for CentOS 6 x64:

现在我们可以安装Postgres的官方库在CentOS6 x64的:

wget http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm

rpm -ivh pgdg-centos92-9.2-6.noarch.rpm

 

for X86 download: http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm

X86版本的下载地址:

 

Fot RHEL 6 x64

对于REHEL 6 x64版本

wget http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm

rpm -ivh pgdg-redhat92-9.2-7.noarch.rpm

 

for x86 download http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm

X86版本的下载地址:

 

To install Postgres and the necessary files we use yum:

要安装Postgres,我们必须使用的yum文件:

yum update

yum install postgresql92-server postgresql92-devel postgresql92

 

Now we initialize the server and configure it for automatic startup:

现在我们初始化服务器并将其配置为自动启动:

service postgresql-9.2 initdb

service postgresql-9.2 start

chkconfig postgresql-9.2 on

 

For when we compile the necessary gem for ruby we need to add the new install to our path so the compiler can find the binaries and libraries:

因为当我们编译所需的ruby gem包时我们需要添加新安装路径到我们的环境变量(path),这样编译器可以找到二进制文件和库:

echo export PATH=/usr/pgsql-9.2/bin:\$PATH >> /etc/bashrc

source ~/.bashrc

 

We start by switching to the Postgres user so we can create the user and database that we will use for Metasploit

首先,我们切换到Postgres用户,这样可以创建我们将使用的Metasploit用户和数据库。

su - postgres

 

Now we create the user and Database, do record the database that you gave to the user since it will be used in the database.yml file that Metasploit and Armitage use to connect to the database.

现在,我们创建用户和数据库,并记录您给了用户,因为它会在Metasploit和Armitage 用于连接到数据库的database.yml文件要使用的数据库。

createuser msf -P -S -R -D

createdb -O msf msf

exit

exit

 

To allow the user we created to connect to Postgres we need to add to /var/lib/pgsql/9.2/data/pg_hba.conf file the following lines above the rest of the other configured settings:

要允许我们创建的用户连接到Postgres,我们需要添加以下行到/ var/lib/pgsql/9.2/data/pg_hba.conf文件上面的其他设置的其余部分:

local msf msf md5

hostmsf msf 127.0.0.1/8 md5

hostmsf msf ::1/128 md5

 

Restart the service:

重新启动服务:

service postgresql-9.2 start

 

Installing Metasploit Framework

安装Metasploit的框架

Once the packages have been install we need to install the required Ruby libraries that metasploit depends on:

一旦包已经安装,我们需要安装所需的Ruby库的Metasploit取决于:

gem install wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler

 

We will download the latest version of Metasploit Framework via Git so we can use msfupdate to keep it updated:

我们将下载的Metasploit Framework的最新版本通过Git的,所以我们可以使用msfupdate保持更新:

cd /opt

git clone https://github.com/rapid7/metasploit-framework.git

cd metasploit-framework

 

Lets create the links to the commands so we can use them under any user and not being under the framework folder:

让我们创建于命令的链接,这样我们就可以使用它们在任何用户,而不是根据框架文件夹为:

bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'

ln -s /opt/metasploit-framework/armitage /usr/local/bin/armitage

 

From the Metasploit-Framework folder lets use the Bundler Gem to install the properly supportted Gem versions:

从Metasploit框架文件夹允许使用Bundler Gem安装正确的被支持 gem版本:

bundle install

 

Lets create the database.yml file that will contain the configuration parameters that will be use by framework:

让我们创建一个被框架使并用包含配置参数的database.yml文件:

nano /opt/metasploit-framework/database.yml

 

Copy the YAML entries and make sure you provide the password you entered in the user creating step in the password field for the database:

复制YAML项目,并确保您提供您创建的步骤在密码字段为数据库中的用户输入的密码:

production:

 adapter: postgresql

 database: msf

 username: msf

 password: 

 host: 127.0.0.1

 port: 5432

 pool: 75

 timeout: 5

 

Create and environment variable so it is loaded by Armitage and by msfconsole when running and load the variable in to your current shell:

由Armitage创建环境变量并,msfconsole运行时加载变量到当前的shell:

echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/bashrc

source ~/.bashrc

 

First Run

首次运行

Now we are ready to run Metasploit for the first time. My recommendation is to run it first under a regular user so the folders create under your home directory have the proper permissions. First time it runs it will create the entries needed by Metasploit in the database so it will take a while to load.

现在,我们已经准备好运行Metasploit的第一次。我的建议是先以普通用户身份下运行它,因此文件夹你的home目录下创建具有适当的权限。首次运行时会在数据库中创建所需的Metasploit项目,以便将需要一段时间来加载。

msfconsole

 

原文地址:http://www.darkoperator.com/msf-centosrhel/

Linux三层真相:内核、发行版与工具链的实战认知框架 Linux不是单一概念,而是由内核、发行版和生态工具链构成的协同系统。内核提供进程、内存与设备驱动等底层能力;发行版(如Ubuntu、Rocky、Kali)基于同一内核,通过包管理(APT/ DNF/Pacman)和预置策略适配不同场景;工具链(如df、systemctl、docker)则是调用内核能力的接口,每条命令背后都映射特定子系统。这种分层结构决定了Linux的技术价值:高度可定制、强场景匹配、云原生就绪。它广泛应用于服务器运维、嵌入式开发、渗透测试及AI基础设施等领域。理解这三层关系,才能摆脱‘背 阅读详情

相关推荐

Linux与Windows操作系统选型实战指南:从开发到运维的决策框架

操作系统选型本质是工作流匹配问题,而非抽象优劣比较。Linux基于POSIX标准与内核可定制性,提供细粒度控制、原生容器支持和高自动化运维能力;Windows则依托NT内核与Active Directory生态,在GUI管理、.NET集成、硬件驱动兼容及企业级应用(如SQL Server、Exchange)方面具备深度黏性。技术价值体现在:Linux支撑Kubernetes、AUTOSAR实时调度、Redis高性能部署等场景;Windows保障AD域控、SSIS数据集成、Visual Studio全栈开发等

460

Metasploit Framework载荷生成过程源码分析

摘要 在Metasploit中,一段编码载荷的总体生成流程是: 将不同汇编代码片段组成载荷汇编代码,并编译成机器码。 生成解码器存根。 将原始载荷机器码按4字节对齐,并用编码器编码。 生成nop雪橇。 最终shellcode:nop雪橇 + 解码器存根(除去最后的0-4个字节, 这些拼到payload中来对齐) + 编码后的payload。 编码器: 用于消除载荷中的坏字节(如’\x00’), 以及为载荷编码。而去除坏字节的方式即是进行编码,而非传统的将push 0替换成xor ecx, ecx和p

Niatruc的博客 1424

Linux文件搜索核心:find与locate的原理、盲区与协同策略

Linux文件搜索并非简单命令调用,而是涉及VFS内核交互、索引机制与权限模型的系统工程。find基于实时遍历与系统调用实现精确匹配,适用于开发调试、安全分析等强时效场景;locate依托mlocate数据库实现毫秒响应,但受更新延迟、PRUNEPATHS过滤和大小写敏感等限制。二者本质是‘实时精确’与‘极速模糊’的技术互补,需结合使用——如先用locate -i快速定位路径,再以find验证时效性与执行深度操作。理解其底层差异(如readdir()扫描 vs n-gram索引)、典型盲区(/tmp默认被排

weixin_33912246的博客 476

如何在Linux,Ubuntu,Debian,CentOS,Fedora,RHEL中安装和配置Vsftpd Ftp服务器

File Transfer Protocol or FTP is very popular file and data transfer protocol in IT. FTP is simple and fast protocol and used to provide files for download or upload. Linux distributions provides diff...

cunjiu9486的博客 265

CentOS7部署l2tp/IPsec服务

1、安装必要的工具 yum install vim net-tools wget unzip -y 2. 下载安装脚本 wget -O StackScript.zip http://files.cnblogs.com/files/think8848/StackScript.zip 3. 解压文件 unzip StackScript.zip 4. 执行...

weixin_30539835的博客 2770

Wider Face+YOLOV7人脸检测

使用Wider Face数据集训练YOLOV7

chen_znn的博客 8407

centOS6中安装metasploit

一、安装metasploit 1.安装ruby 》》yum -y install ruby 2.根据官方文档执行,安装支持包 》》yum -y install xorg-x11-server-Xvfb 3.进入/opt文件,官网按配置下载最新的Metasploit (32x & 64x ) 》》cd /opt 》》wget http://downloads.metasplo...

Kevin's Blog 3749

ROS新手必看:如何用URDF快速搭建UR5机械臂模型(附完整代码)

本文为ROS新手提供了一份详细的UR5机械臂URDF建模实战指南。通过解析URDF核心概念,逐步讲解如何定义link与joint,并整合官方网格文件,最终构建出完整的、可在RViz中可视化与控制的UR5模型。文章还介绍了模型验证、调试技巧以及如何添加碰撞与惯性属性,为后续的物理仿真与算法开发奠定坚实基础。

pz89012345的博客 498

“找不到pip命令”错误解决方案Pip和Pip3对于Linux,Debian,Ubuntu,CentOS,Mint

Linux and opensource world mainly use package management software for installing, updating, and removing software. Python is using pipor pip3for Python package management. pipis Python2 package man...

cunjiu9486的博客 9315

IT运维必备 开源Urbackup 备份系统部署教程 实战操作

手动添加ip方式检查是否在线 ,linux需要按上述步骤6配置server端地址 不然一直不会进去状态栏。安装依赖sudo apt install -y libcrypto++-dev。补充客户端手动触发备份命令 (一般在服务端操作即可,特殊情况客户端进行操作)修改ubuntu主机名 建议修改为ip 方便上线以ip命名上线。默认客户端安装完毕大概几分钟之内服务端会自动上线。配置客户端指向server端地址。(2)ubuntu 客户端设置。新起一个远程窗口查看配置状态,配置客户端备份文件目录。

qq_34981755的博客 1281

Autosar 下电过程-基于ETAS工具

本文介绍基于ETAS工具对应的BIP包的下电过程,仅供参考。在最后调用SBC下电时,需要理清楚SBC的休眠流程,否则可能会出现休眠又唤醒情况。后面有空会介绍9471的休眠流程。

赞的博客 812

获取redhat/centos服务器端详细信息 shell代码

为什么80%的码农都做不了架构师?>>> ...

weixin_33840661的博客 198

运行codex时出现登录失败:failed to start login server: 以一种访问权限不允许的方式做了一个访问套接字的尝试。 (os error 10013) 解决方案

的本质是Windows 系统端口保留策略而非代码 bug。推荐使用方案一(调整动态端口范围),一劳永逸解决。如果你安装了 Docker Desktop 或启用了 WSL2,调整端口范围后记得检查相关服务是否正常运行。

一键难忘的博客 4158

2019 MySQL 8 安全安装避坑指南

1. 安装vmware centos的虚拟机 -省却安装vmware虚拟机管理的部分 -centos7下载地址: 官方:https://www.centos.org/download/ 镜像文件地址:http://mirrors.nju.edu.cn/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso 2. ...

wujiandao的专栏 1万+

Nuxt - 项目打包部署及上线到服务器流程(SSR 服务端渲染)

Nuxt-项目打包部署及上线到服务器流程,详细介绍Nuxt项目上线部署,服务端渲染(ssr)项目及nuxt项目部署过程,nuxt项目打包上线,Nuxt项目的部署教程,NuxtJS项目部署方案,Nuxt如何部署到线上,nuxt项目部署篇,Nuxt项目搭建到Nuxt项目部署,Nuxt项目从开始到部署,详细教程。服务器部署nuxt项目,nuxt服务端部署上线,在服务器上部署nuxt项目,NuxtJS项目——命令和部署。......

🏆 前端领域优质创作者 1万+

YOLOv8改进策略【损失函数篇】| 2024 引进Focaler-IoU损失函数 加强边界框回归 (Focaler-DIoU、Focaler-GIoU、Focaler-CIoU)

本文记录的是改进YOLOv8的损失函数,将其替换成。现有研究通过利用边界框之间的几何关系来提高回归性能,但忽略了困难样本和简单样本分布对边界框回归的影响。不同检测任务中困难样本和简单样本的分布不同,对于简单样本占主导的检测任务,关注简单样本的边界框回归有助于提高检测性能;对于困难样本比例较高的检测任务,需要关注困难样本的边界框回归。,提高检测器在不同检测任务中的性能。实现的。

Limiiiing的博客 1222

centos 6.4安装metasploit

以前用backtrack上面直接由现成的metasploit,现在改用centos只能自己安装了。首先到官网下载http://www.rapid7.com/products/metasploit/download.jsp。 关闭防火墙, 安装ruby  yum -y intall ruby 根据官方文档:sudo yum install xorg-x11-server-Xvfb 下载好软件

平淡不平凡 4948

视图库对接系列(GA-T 1400)四、视图库对接系列(本级)注册

在之前的步骤中,我们已经把项目大体的架构已经写出来了。那我们就来实现注册接口。GA-T 1400中的步骤如下:这里的话,我们实现的简单点, 我们不进去鉴权,也就是设备或平台找我们注册的话,我们直接返回成功,不进行验证。如果需要鉴权的话可看我的另外一篇文档。

qq_37716298的博客 1044

VS Code + KXApp 开发 iOS 报错排查指南,工程、签名、真机、补全、配置

在 VS Code 里用 KXApp 开发 iOS,报错常不在代码而在环境。本文按失败阶段分五类排查:工程没出现 Xcode 视图(查 .xcodeproj 与 xcode-select)、构建失败(No profiles、Team 签名、CocoaPods 用 .xcworkspace)、真机调试失败(信任、开发者模式、设备未准备好)、没补全或 No such module(等索引、清 clangd 冲突)、设置保存不了(装 xcodeproj gem),每类给现象、日志通道和修法。

2501_91590906的博客 204

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

GEM5架构解析

kkk12344的专栏 216

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

【混合缓存】五种同步通道与它们的失效模式:为什么 Pub/Sub 不可靠反而是对的(五)

本文剖析混合缓存同步层的五种实现(Redis Pub/Sub、RocketMQ、Kafka、RabbitMQ、NATS),指出选型关键不在延迟、吞吐或运维成本,而在于“丢、重、乱”三种失效形态。核心结论:同步消息仅传递“失效指令”,而非数据本身,因此“重”与“乱”因幂等性无害,唯有“丢”需兜底。通过分析各通道在消息丢失场景下的表现,揭示其本质差异——真正决定系统可靠性的,是“何时丢”及“靠什么兜底”。最终强调:同步层只需低延迟通知,可靠性由时间上界(如forceExpiryTime)保障,无需通道保证完全可

tantan的小记录 441
上一篇: Linux内核源码分析--内核启动之zImage自解压过程
下一篇: unittest 简单实现 pyunit 单元测试
weixin_34128839
博客等级 码龄11年 6480粉丝 1211原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值