��澶�瀹�楠���澧�
娓���������绯荤���寮�绔�
��寤鸿��宸辩��瀹�楠���澧�
瀹�瑁�������
寰�杞����扮��杞�浠�
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��瀹��跺������妗e�婧�缂�杈����″钩�帮���绗�涓�涓��轰�缃�缁�����瀛�澶����ㄣ����浠ョ��姝e���板���跺�ㄧ嚎��妗g�杈���EtherPad涓烘������涓��ㄦ�峰���颁��扮����瀵�����������浣����瑰���
--------------------------------------------------------------------------------------------------------
��瀹�渚�涓���ubuntu瀹�瑁�Apache
涓����戒护琛�瀹�瑁�Apache
��寮�"缁�绔�绐���"锛�杈���"sudo apt-get install apache2"-->��杞�-->杈���"root�ㄦ�风��瀵���"-->��杞�-->杈���"y"-->��杞�,瀹�瑁�瀹���
浜���榛�璁ょ��缃�绔��圭��褰���璺�寰�
Apache瀹�瑁�瀹�����锛�榛�璁ょ��缃�绔��圭��褰���"/var/www/html"锛��ㄧ�绔�绐��d腑杈���"ls /var/www/html"-->��杞�-->�ㄧ�绔��圭��褰�涓���涓�涓�"index.html"��浠�,��ie娴�瑙��ㄤ腑杈���"127.0.0.1"-->��杞�,灏卞��浠ユ��寮�璇ラ〉����
涓���Apache��绗�涓�涓���缃���浠�apache2.conf��璺�寰�
�ㄧ�绔�绐��d腑杈���"ls /etc/apache2"-->��杞�-->��涓�涓�"apache2.conf"����缃���浠躲��
����Apache��绗�浜�涓���缃���浠�000-default.conf��璺�寰�
�ㄧ�绔�绐��d腑杈���"ls /etc/apache2/sites-available"-->��杞�-->��涓�涓�"000-default.conf"����缃���浠躲��
浜���淇��圭�绔����圭��褰�
1���ㄧ�绔�绐��d腑杈���"sudo vi /etc/apache2/apache2.conf"-->��杞�-->�惧��""��浣�缃�-->�存��"/var/www/"涓烘�扮���圭��褰�灏卞��浠ヤ���
2���ㄧ�绔�绐��d腑杈���"sudo vi /etc/apache2/sites-available/000-default.conf"-->��杞�-->�惧��"DocumentRoot /var/www/html"��浣�缃�-->�存��"/var/www/html"涓烘�扮���圭��褰�灏卞��浠ヤ�锛�杩�������瀹��存�逛负"/var/www/"��
��������Apache
�ㄧ�绔�绐��d腑杈���"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���板����绔��d负80
Listen 192.168.1.2:8080� � �璁剧疆����ip��192.168.1.2���板����绔��d负8080
Alias /down� � "/sof孝Ware /download"
��寤鸿������褰�锛���寤哄��涓�down��������褰�锛�瀹�瀵瑰����╃��璺�寰���锛�/sof孝Ware /download锛�
Alias /ftp� � �"/var/ftp"
��寤鸿������褰�锛���寤哄��涓�ftp��������褰�锛�瀹�瀵瑰����╃��璺�寰���锛�/var/ftp锛�
璁剧疆��褰�����
锛�姝ゆ�″��璁剧疆��褰�������璇��ワ�
Options FollowSymLinks� � � � page:116
AllowOverride None
涓�����瑕�璇存������锛���apache2涓�锛��硅�剧疆锛�榛�璁や富��褰�锛��� /etc/apache2/sites-�Vailable/default涓�锛���浠���寮�default锛�杩�琛���缃���
濡��撅�杩�����浠���榛�璁や富��褰�璁剧疆��璺�寰���/var/www,��妗f��涓��圭��VirtualHost���圭��*浠h〃����绗�锛��宠〃绀烘��������ip�板��锛�����绔��d负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,濡�����浜у��澧���璇���瑕��f��锛�濡���娓�����澧���璇���浠ョ����
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
sudo rm 1.php
sudo init 0� �虫��
--------------------------------------------------------------------------------------------------------
�变�msf寰�澶�婕�娲�浠g�����辨��������锛���浜��ㄤ腑��������win涓�涓��芥�剧ず锛���濂藉�㈣���涓�杞借�辨��������win��
��寤烘���″��
妯℃����瀹�缃�缁�
M0n0wall�茬��澧�
http://m0n0.ch/wall/downloads.php
metasploit璧�婧����ㄧ����甯哥��灏�
m0n0瀹�瑁��戒护
m0n0wall console setup
*******************
1) Interfaces: assign network ports� �//�ュ�o�����缃�缁�绔���
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� �//�ュ�o�����缃�缁�绔���
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� �//�ュ�o�����缃�缁�绔���
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� �//�ュ�o�����缃�缁�绔���
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/