Open WebHTB on bridges (Ubuntu) 23686 views, 2 replies
Installation with distro ubuntu 10.10 and kernel 2.6.35-22-generic-pae
Is more complicated than Fedora but is working fine, installing in Fedora support for https you must do just sthis: yum -y install mod_ssl, for Ubuntu see Step 8
Step 1: Install dependencies
#text-editor,unzip,chkconfig (for enabling webhtb at startup without configuring your rc.local)
apt-get install mc unzip chkconfig
#php
apt-get install php5 php5-cli
#database
apt-get install mysql-server php5-mysql
#ssh
apt-get install openssh-server libssh2-*
#bridging utilites
apt-get install bridge-utils
#apache and ssl
apt-get install apache2 openssl ssl-cert
#everything
apt-get install mc unzip chkconfig php5 php5-cli mysql-server php5-mysql openssh-server libssh2-* bridge-utils apache2 openssl ssl-cert
Step 2 :Activate apache server, mysql server and openssh server at linux start-up
chkconfig apache2 on
chkconfig mysql on
chkconfig ssh on (at ubuntu its enabled by default)
Step 3: set apache server, mysql server and opensshserver at linux
#start-up
service apache2 start
service mysql start
service ssh start (at ubuntu its started by default)
Step 4:activate "short_open_tag"
pico /etc/php5/apache2/php.ini
search for: short_open_tag = Off and switch that to "On" insetad of "Off"
service apache2 restart
step 5:configuring your bridge
#condition :
1. eth0 or any other, goes to internet
2. eth1 or any other, goes to hub/switch/computer
after installing bridge-utils open your rc.local with your favorite text-editor
pico/etc/rc.local
#your computer name
hostname webhtb
#activating forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward
#addbridge
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
#adding ip for eth0 and eth1
ifconfig eth0 0.0.0.0
ifconfig eth1 0.0.0.0
ifconfig eth0 promisc up
ifconfig eth1 promisc up
brctl sethello br0 1
brctl setmaxage br0 4
brctl setfd br0 4
#adding ip to bridge interface (br0)
ifconfig br0 10.128.2.120 up
#adding internet gateway
route add default gw 10.128.xxx.xxx
Step 6: download your webhtb
cd /var/www/
wget http://www.webhtb.ro/downloads/WebHTB_V2.9.bz2
Step 7: extract your webhtb, setup directory location and make startup for webhtb
-extracting
still on /var/www
tar -jxvf WebHTB_V2.9.bz2
-directory locating
cd /var/www/webhtb/docs/
pico webhtb
search this line dir="/var/www/html/webhtb" and change into dir="/var/www/webhtb"
-startup for webhtb
cp -r /var/www/webhtb/docs/webhtb /etc/init.d/
cd /etc/init.d/
chkconfig /etc/init.d/webhtb on
Step 8: make certificate
mkdir /etc/apache2/ssl
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf
/etc/apache2/ssl/apache.pem
it will ask for hostname and insert localhost
Step 9: enable https module and adding certificate to virtual host
a2enmod ssl
/etc/init.d/apache2 force-reload
#add certificate to virtual host
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
pico /etc/apache2/sites-available/ssl #add script below before “” : at the end of the line
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/9f129ada (your file name on /etc/apache2/ssl/ when you make certificate)
#and change port default 80 into 443 at the first line
pico /etc/apache2/sites-available/default, add this script at the end of line before “
SSLCertificateFile /etc/apache2/ssl/apache.pem
restart your apache
# /etc/init.d/apache2 force-reload
# a2ensite ssl
and restart again your apache
# /etc/init.d/apache2 restart
Step 9: set permisions
cd /var/www/
chown -R www-data.www-data webhtb/
Step 11: install webhtb
open your favorite browser and navigate to:
https://your_server_ip/webhtb/setup/index.php