HowTo Open WebHTB on bridges (Ubuntu)

Open WebHTB on bridges (Ubuntu) 18189 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


apt-get install php5 php5-cli


apt-get install mysql-server php5-mysql


apt-get install openssh-server libssh2-*

#bridging utilites

apt-get install bridge-utils

#apache and ssl

apt-get install apache2 openssl ssl-cert


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


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


#your computer name

hostname webhtb

#activating forwarding

echo "1" > /proc/sys/net/ipv4/ip_forward


brctl addbr br0

brctl addif br0 eth0

brctl addif br0 eth1

#adding ip for eth0 and eth1

ifconfig eth0

ifconfig eth1

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 up

#adding internet gateway

route add default gw

Step 6: download your webhtb

cd /var/www/


Step 7: extract your webhtb, setup directory location and make startup for webhtb


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


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

change into

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:


Posted Reply

Good job !

Posted Reply

thanks a lot :)

Leave a Comment

You must be logged to post comments !

Try WebHTB Proffesional