[msf]CentOS VPS创建pptpd 并搭建msf
2024-08-30 12:58:04
安装pptpd服务
vps下
下载 centos 6 一键安装包
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/across/master/pptp.sh
给予权限
chmod +x pptp.sh
运行VPN一键安装包:
./pptp.sh
增加一个新用户,删除用户,修改密码等可以使用编辑:
vim /etc/ppp/chap-secrets
接下来安装msf
首先
yum update yum upgrade
开始安装Metasploit需要的所有依赖包,命令如下:
yum groupinstall 'Development Tools' yum install sqlite-devel libxslt-devel libxml2-devel java--openjdk libpcap-devel nano openssl-devel zlib-devel libffi-devel gdbm-devel readline-devel nano wget
安装Ruby安装命令如下:
cd /usr/src wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz tar zxvf yaml-.tar.gz cd yaml- ./configure --prefix=/usr/local make && make install
接着,下载并且安装Ruby的最新版本
cd /usr/src wget http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz tar zxvf ruby-.tar.gz cd ruby- ./configure --prefix=/usr/local --with-opt-dir=/usr/local/lib make && make install
安装Nmap,这个是Metasploit中并不包含的,但是扫描过程又需要的工具。具体命令如下:
cd /usr/src svn co https://svn.nmap.org/nmap cd nmap ./configure make make install make clean
CenOS中附带的Postgresql版本比较低,在这里安装Postgresql的最新版本,目前最新版本为PostgreSQl9.4,具体命令如下:
exclude=postgresql* wget http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm rpm -ivh pgdg-centos94-9.4-1.noarch.rpm
要安装Postgresql,必须使用的yum文件有几个,命令如下:
yum update yum install postgresql94-server postgresql94-devel postgresql94
现在开始初始化服务器并将其配置为自动启动,命令如下:
service postgresql-9.4 initdb service postgresql-9.4 start chkconfig postgresql-9.4 on
因为编译ruby所必须的gem时,需要把新安装的加入路径,这样编译器就能找到库和二进制文件,接下来需要执行几个命令:
echo export PATH=/usr/pgsql-9.4/bin:\$PATH >> /etc/bashrc source ~/.bashrc
接下来,切换到Postgresql用户,这样就可以创建我们将要用于Metasploit的用户名和数据库了,命令如下:
su - postgres
好了,现在开始创建用户和数据库,这些都将在database.yml中使用到。命令如下:
createuser msf -P -S -R -D createdb -O msf msf exit exit
为了允许我们创建的用户能够连接Postgresql,我们需要设置一下pg_hba.conf文件,命令如下:
vim /var/lib/pgsql/9.4/data/pg_hba.conf
需要的添加的内容如下(暂时不加):
local msf msf md5 hostmsf msf 127.0.0.1/8 md5 hostmsf msf ::1/128 md5
截个图:
设置好了之后,重启服务:
service postgresql-9.4 restart
现在开始安装Metasploit框架,前面的包安装成功之后,我们需要再安装一些Metasploit依赖的Ruby库,命令如下:
gem install wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler
使用Git下载最新的Metasploit,命令如下:
cd /opt git clone https://github.com/rapid7/metasploit-framework.git cd metasploit-framework
为了在终端下也能运行,这样就不仅仅只在Metasploit的文件中运行。我们需要创建软链接。命令如下:
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
在终端下,进入Metasploit的文件中,使用Bundler Gem来安装合适的Gem版本:
bundle install
又是一个漫长的过程,截图如下:
创建Metasploit框架将要使用的database.yml,命令如下:
vim /opt/metasploit-framework/database.yml
database.yml中的具体内容如下(暂不添加):
production: adapter: postgresql database: msf username: msf password: host: 127.0.0.1 port: 5432 pool: 75 timeout: 5
再次执行以下命令,这样就能通过Armitage和msfconsole在当前shell中创建和加载环境变量:
echo export MSF_DATABASE_CONFIG=/opt/metasploit-framework/database.yml >> /etc/bashrc source ~/.bashrc
最后,让我们运行已经安装的Metasploit,命令如下:
msfconsole
图示如下:
Blog地址:
尝试安装LNMP--参考(http://www.freebuf.com/sectool/127125.html)虽然dns隧道很慢不好用
wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz && tar zxf lnmp1.2-full.tar.gz && cd lnmp1.2-full && ./install.sh lnmp
域名购买 http://www.xinnet.com 新建解析
等待一段时间。
参考
http://blog.csdn.net/churximi/article/details/51510457
最新文章
- 转:看看 Delphi XE2 为 VCL 提供的 14 种样式
- Matlab中使用脚本和xml文件自动生成bus模块
- 关于学习C++编程语言对中国软件发展的的一些思考!
- 使用RBTool自动提交code review请求
- [GDAL]GEOS和Proj4编译
- (spring-第11回【IoC基础篇】)BeanWrapper--实例化Bean的第四大利器
- 【转】七个例子帮你更好地理解 CPU 缓存
- POJ3164 Command Network(最小树形图)
- Deployment of VC2008 apps without installing anything
- ASP.NET Core 运行原理解剖[3]:Middleware-请求管道的构成
- JS排序
- 计蒜客NOIP模拟赛(2) D2T1 劫富济贫
- 在 Web 页面中使用离线地图
- PCIE\AURORA\SRIO协议对比
- 一款好用的wangEditor编辑器
- python之vscode配置开发调试环境
- eclipse windowbuilder palette 空白
- java的关于流程结构做的几个案例
- 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope
- security自动登陆
热门文章
- Invalid regular expression: unmatched parentheses
- android menu事件
- ActiveMQ(一) 转
- Linux性能查看与分析--命令行工具介绍
- configuration默认设置
- MySQL 权限生效
- git apply、git am打补丁.diff 和 .patch【转】
- caioj1465&;&;poj1024: 【AC自动机】地图匹配
- YTU 2425: C语言习题 输出月份
- DedeCMS模板中用彩色tag做彩色关键词