【安全牛学习笔记】实验环境

来源:互联网 发布:刻录软件nero免费下载 编辑:程序博客网 时间:2024/06/01 08:51

准备实验环境

  渗透非授权系统的弊端

  搭建自己的实验环境


安装虚拟机

微软最新版软件

   http://msdn .microsoft.com/en-ca/subscriptions/aa336858

windows虚拟机

   http://dev.modern.ie/tools/vms/

安装自己的虚拟机

   Xp

   Win7

   2003


选择"Download software"



linux虚拟机

   http://www.turnkeylinux.org

   Ubuntu

       Lamp安装

Metasploitable2

    http://downloads.metasploit.com/data/metasploitable/metasploitable-linux-2.0.0.zip

    问题:/var/www/mutillidae/config.inc

       dbname=owasp10


EtherPad:在线协作无缝编辑文档

EtherPad是一个基于Web的实时协同文档开源编辑服务平台,是第一个基于网络的文字处理器。可以真正实现实时在线文档编辑。EtherPad为所有参与用户实现了新的和富有成效的合作的方式。


--------------------------------------------------------------------------------------------------------

【实例一】ubuntu安装Apache

一、命令行安装Apache

打开"终端窗口",输入"sudo apt-get install apache2"-->回车-->输入"root用户的密码"-->回车-->输入"y"-->回车,安装完成


二、默认的网站根目录的路径

Apache安装完成后,默认的网站根目录是"/var/www/html",在终端窗口中输入"ls /var/www/html"-->回车-->在网站根目录下有一个"index.html"文件,在ie浏览器中输入"127.0.0.1"-->回车,就可以打开该页面。


三、Apache的第一个配置文件apache2.conf的路径

在终端窗口中输入"ls /etc/apache2"-->回车-->有一个"apache2.conf"的配置文件。


四、Apache的第二个配置文件000-default.conf的路径

在终端窗口中输入"ls /etc/apache2/sites-available"-->回车-->有一个"000-default.conf"的配置文件。


五、修改网站的根目录

1、在终端窗口中输入"sudo vi /etc/apache2/apache2.conf"-->回车-->找到"<Directory /var/www/>"的位置-->更改"/var/www/"为新的根目录就可以了。

2、在终端窗口中输入"sudo vi /etc/apache2/sites-available/000-default.conf"-->回车-->找到"DocumentRoot /var/www/html"的位置-->更改"/var/www/html"为新的根目录就可以了,这里我把它更改为"/var/www/"。


六、重启Apache

在终端窗口中输入"sudo /etc/init.d/apache2 restart"-->回车-->"输入root用户密码"-->回车-->重启成功


--------------------------------------------------------------------------------------------------------

【实例二】一、首先,安装Apache2,安装命令:sudo apt-get install apache2


二、安装完成后,进入到/etc/apache2中(根据自己的实际安装目录),这边我配置文件在/etc/apache2中。

 我们看到没有想象中的httpd.conf配置文件,这里要说明的是apache2的配置文件是apache2.conf,而不是http.conf。

 打开apache2.conf。写入两条语句

ServerName localhost

DirectoryIndex index.html index.htm index.php

这里的ServerName localhost是为了防止最后开启apache2服务的时候会提示DNS出错。

DirectoryIndex index.html index.htm index.php是默认目录的写法。保存退出。

可以在apache2.conf中加入  AddDefaultCharset GB2312 

   设置默认字符集,定义服务器返回给客户机默认字符集(由于西欧UTF-8是Apache默认字符集,因此当访问有中文的网页时会出现乱码,这时只要将字符集改成GB2312,再重启Apache服务即可)

Listen 192.168.1.1:80       设置监听ip是192.168.1.1的地址和端口为80

Listen 192.168.1.2:8080     设置监听ip是192.168.1.2的地址和端口为8080

Alias /down    "/sofТWare /download"   

创建虚拟目录(创建名为down的虚拟目录,它对应的物理路径是:/sofТWare /download)

Alias /ftp     "/var/ftp"                

创建虚拟目录(创建名为ftp的虚拟目录,它对应的物理路径是:/var/ftp)

<Directory "/var/www/html">       

设置目录权限

(<Directory "目录路径">此次写设置目录权限的语句</Directory>)

      Options FollowSymLinks        page:116

      AllowOverride None

</Directory>


三、需要说明的是,在apache2中,根设置(默认主目录)在 /etc/apache2/sites-АVailable/default中,我们打开default,进行配置。

如图,这里我们的默认主目录设置的路径是/var/www,文档最上方的VirtualHost后方的*代表通配符,即表示所有本机ip地址,监听端口为80,ServerName填写你注册的域名,没有可以不填。保存退出。


四、至此,基本配置已经全部完成,查看本机ip地址。输入启用apache2的命令:/etc/init.d/apache2 restart.并在浏览器中输入本机ip地址。成功!

--------------------------------------------------------------------------------------------------------

【笔记】

安装apache


ifconfig

dhclient

sudo dhclient eht0

[sudo] password for yuanfh: xxxx

sudo reboot

ifconfig

sudo apt-get install ssh

netstat -antol | grep :22


在PuTTY Configuration设置  192.168.1.109:22

输入账号密码连接终端


ifconfig

sudo apt-get install apache2

sudo apt-get install apache2 apache2-utils

你系统继续执行吗?[y/n] y

netstat -antol | grep :22

ps aux | grep apache

http://192.168.1.109

sudo service apache2 restart    报错

sudo vi /etc/apache2/conf-available/fqdn.conf

ServerName localhost

sudo a2enconf fqdn

sudo service apache2 restart


------------------------------------------------------------------------------------------------------

安装mysql


usdo apt-get install mysql-server libapache2-mod-auth-mysql1.mysql php5-mysql

按Y

设置mysql账号密码


mysql_insatll_db   创建数据库的目录结构


mysql_secure_installation   数据库安全配置

Enter current password for root (enter for none):    //输入root安全密码按"n"

Change the root password? [y/n] n      

Remove anonymouus users? [y/n] y    //匿名用户 Y

Disall root login remtely? [y/n] y     //root远程登陆 Y

Remove test datebase and access to it? [y/n] n 测试数据库  N,如果生产坏境的话需要散掉,如果渗透坏境的话可以留着

Reload privilage tables now? [y/n] y 权限  Y

完成配置

mysql -u root -p    验证一下

输入密码

mysql>xxxxxx

--------------------------------------------------------------------------------------------------------

安装php


sudo apt-get insatll php5 php5-mysql php-pear php5-script php5-mcrypt php5-curl

安装完成


cd /var/www/html/

/var/www/html/$ ls

/var/www/html/$ sudo vi 1.php

<?php phpinfo(); ?>

sudo rm 1.php

sudo init 0  关机

--------------------------------------------------------------------------------------------------------


由于msf很多漏洞代码是英文版本的,有些在中文版本的win上不能显示,最好呢还是下载英文版本的win。

搭建服务器


模拟真实网络

M0n0wall防火墙

    http://m0n0.ch/wall/downloads.php


metasploit资源占用的非常的少



m0n0安装命令

m0n0wall console setup

*******************

1) Interfaces: assign network ports   //接口:分配网络端口

2) Set up LAN IP address              //建立局域网IP地址

3) Reset web GUI password             //web GUI重置密码

4) Rest to factory defaults           //其他工厂默认值

5) Reboot system                      //重新启动系统

6) Ping host                          //Ping主机

7) Install on Hard Drive              //安装在硬盘上


Enter a number: 7


do you want to proceed? (y/n) y

取消硬盘m0n0wall_1.8.1.iso

重启


m0n0wall console setup

*******************

1) Interfaces: assign network ports   //接口:分配网络端口

2) Set up LAN IP address              //建立局域网IP地址

3) Reset web GUI password             //web GUI重置密码

4) Rest to factory defaults           //其他工厂默认值

5) Reboot system                      //重新启动系统

6) Ping host                          //Ping主机

7) Install on Hard Drive              //安装在硬盘上


Enter a number: 1


do you want to set up VLANs nows? (y/n)


Enter the parent interface name for the new VLAN (or nothing if finished):em0

Enter the VLAN tag (1-4091): 10

Enter the parent interface name for the new VLAN (or nothing if finished):em1

Enter the VLAN tag (1-4091): 11

Enter the parent interface name for the new VLAN (or nothing if finished):em2

Enter the VLAN tag (1-4091): 12

回车

Enter the LAN interface name or 'a' for auto-detection: em1

Enter the WAN interface name or 'a' for auto-detection: em0

Enter the Optional 1 interface name or 'a' for auto-detection for nothing if finshed): em2

回车

The interface will be assigned as follows:

LAN  -> em1

WAN  -> em0

OPT1 -> em2

The firewall will reboot after saving the changes.

do you want to proceed? (y/n) y

The firewall is rebooting now.

重启


m0n0wall console setup

*******************

1) Interfaces: assign network ports   //接口:分配网络端口

2) Set up LAN IP address              //建立局域网IP地址

3) Reset web GUI password             //web GUI重置密码

4) Rest to factory defaults           //其他工厂默认值

5) Reboot system                      //重新启动系统

6) Ping host                          //Ping主机

7) Install on Hard Drive              //安装在硬盘上


Enter a number: 2


Enter the new LAN IP address: 10.1.1.10


Subnet masks are entered as bit counts (as in CIDR notation) in m0n0wall.

e.g. 255.255.255.0= 24

     255.255.0.0  = 16

     255.0.0.0    = 8


Enter the new LAN subnet bit count: 24


DO you want to enable the DHCP server on LAN (y/n) y


Enter the start address of the clinet address range: 10.1.1.20


Enter the end address of the client address range: 10.1.1.100


m0n0wall console setup

*******************

1) Interfaces: assign network ports   //接口:分配网络端口

2) Set up LAN IP address              //建立局域网IP地址

3) Reset web GUI password             //web GUI重置密码

4) Rest to factory defaults           //其他工厂默认值

5) Reboot system                      //重新启动系统

6) Ping host                          //Ping主机

7) Install on Hard Drive              //安装在硬盘上


Enter a number: 3

 

do you wnat to proceed? (y/n) y


Description OPT1


IP address 10.1.2.10/24


设置防火墙规则

pules------> "+"------>

Protocol: any

Source: LAN subnet

保存


WAN------>勾选"Block private networks"


背靠背防火墙

Pfsense 

    http://pfsense.org/

该笔记为安全牛课堂学员笔记,想看此课程或者信息安全类干货可以移步到安全牛课堂


Security+认证为什么是互联网+时代最火爆的认证?


      牛妹先给大家介绍一下Security+

        Security+ 认证是一种中立第三方认证,其发证机构为美国计算机行业协会CompTIA ;是和CISSP、ITIL 等共同包含在内的国际 IT 业 10 大热门认证之一,和CISSP偏重信息安全管理相比,Security+ 认证更偏重信息安全技术和操作。

       通过该认证证明了您具备网络安全,合规性和操作安全,威胁和漏洞,应用程序、数据和主机安全,访问控制和身份管理以及加密技术等方面的能力。因其考试难度不易,含金量较高,目前已被全球企业和安全专业人士所普遍采纳。

Security+认证如此火爆的原因?

        

       原因一:在所有信息安全认证当中,偏重信息安全技术的认证是空白的, Security+认证正好可以弥补信息安全技术领域的空白 。

      目前行业内受认可的信息安全认证主要有CISP和CISSP,但是无论CISP还是CISSP都是偏重信息安全管理的,技术知识讲的宽泛且浅显,考试都是一带而过。而且CISSP要求持证人员的信息安全工作经验都要5年以上,CISP也要求大专学历4年以上工作经验,这些要求无疑把有能力且上进的年轻人的持证之路堵住。在现实社会中,无论是找工作还是升职加薪,或是投标时候报人员,认证都是必不可少的,这给年轻人带来了很多不公平。而Security+的出现可以扫清这些年轻人职业发展中的障碍,由于Security+偏重信息安全技术,所以对工作经验没有特别的要求。只要你有IT相关背景,追求进步就可以学习和考试。


       原因二: IT运维人员工作与翻身的利器。

       在银行、证券、保险、信息通讯等行业,IT运维人员非常多,IT运维涉及的工作面也非常广。是一个集网络、系统、安全、应用架构、存储为一体的综合性技术岗。虽然没有程序猿们“生当做光棍,死亦写代码”的悲壮,但也有着“锄禾日当午,不如运维苦“的感慨。天天对着电脑和机器,时间长了难免有对于职业发展的迷茫和困惑。Security+国际认证的出现可以让有追求的IT运维人员学习网络安全知识,掌握网络安全实践。职业发展朝着网络安全的方向发展,解决国内信息安全人才的匮乏问题。另外,即使不转型,要做好运维工作,学习安全知识取得安全认证也是必不可少的。


        原因三:接地气、国际范儿、考试方便、费用适中!

CompTIA作为全球ICT领域最具影响力的全球领先机构,在信息安全人才认证方面是专业、公平、公正的。Security+认证偏重操作且和一线工程师的日常工作息息相关。适合银行、证券、保险、互联网公司等IT相关人员学习。作为国际认证在全球147个国家受到广泛的认可。

        在目前的信息安全大潮之下,人才是信息安全发展的关键。而目前国内的信息安全人才是非常匮乏的,相信Security+认证一定会成为最火爆的信息安全认证。

 近期,安全牛课堂在做此类线上培训,感兴趣可以了解