Wednesday, April 6, 2011

Installing Firefox 4.0 (.deb Package) On Ubuntu 10.10

In this short guide I will show you how you can install the new Mozilla Firefox 4.0 browser (released March 22, 2011) on an Ubuntu 10.10 desktop. Fortunately, there's a Launchpad PPA repository that has Firefox 4.0 .deb packages, so we can easily install it through Ubuntu's package manager.


I do not issue any guarantee that this will work for you!


Open the Ubuntu Software Center (Applications > Ubuntu Software Center):


In the Ubuntu Software Center, go to Edit > Software Sources...:


Click to enlarge

Type in your password:


Click to enlarge

In the Software Sources window, go to the Other Software tab and click on the Add... button:


Click to enlarge

You are prompted to fill in the APT line of the Firefox 4.0 repository - enter the following line and click on the Add Source button:

ppa:mozillateam/firefox-stable


Click to enlarge

You should now see two new repositories on the Other Software tab (one for the Firefox .deb packages and the other one for the source packages). Click on the Close button to leave the Software Sources window:


Click to enlarge

Back in the Ubuntu Software Center, you should see that Ubuntu package database is being updated (it says In Progress in the left column).


Click to enlarge

Close the Ubuntu Software Center afterwards.

Installing Firefox 4.0 (.deb Package) On Ubuntu 10.10 - Page 2

View the original article here


This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

How To Set Up Kippo SSH Honeypot On CentOS 5.5

Kippo is a medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker. Kippo is inspired, but not based on Kojoney. If you need more information about Kippo please visit its official site on http://code.google.com/p/kippo/. This tutorial shows how you can compile and install Kippo on a CentOS 5.5 server.

I do not issue any guarantee that this will work for you!

As you already know, CentOS only comes with Python 2.4, so you need to install Python 2.6 by using the tutorial from the following link:

http://www.geekymedia.com/tech-articles/rhel5-centos5-rpms-for-python-2-5-and-2-6/.

Important Notes!:

1) Just install the RPMs for the version that you want. You will need at least the base python version package and the libs package.
2) To start Python 2.6, type python26 at your command line rather than python. (Your original Python 2.4 is still installed.)
3) If you are installing packages with setuptools, make sure to use the correct python version. (i.e. python26 setup.py install)

Twisted is an event-driven networking engine written in Python and licensed under the MIT license. Twisted projects variously support TCP, UDP, SSL/TLS, multicast, Unix sockets, a large number of protocols (including HTTP, NNTP, IMAP, SSH, IRC, FTP, and others), and much more.

cd /tmp
wget http://twistedmatrix.com/Releases/Twisted/10.2/Twisted-10.2.0.tar.bz2
tar -xvf Twisted-10.2.0.tar.bz2
cd Twisted-10.2.0
python26 setup.py build
python26 setup.py install

Zope is an open source web application server primarily written in the Python programming language.

cd /tmp
wget http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz
tar -xvf zope.interface-3.3.0.tar.gz
cd zope.interface-3.3.0
python26 setup.py build
python26 setup.py install

Pycrypto is a collection of cryptographic algorithms and protocols, implemented for use from Python.

cd /tmp
wget wget http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz
tar -xvf pycrypto-2.0.1.tar.gz
cd pycrypto-2.0.1
python26 setup.py build
python26 setup.py install

ASN.1 types and codecs (BER, CER, DER) implementation in Python programming language.

cd /tmp
wget http://sourceforge.net/projects/pyasn1/files/pyasn1-devel/0.0.12a/pyasn1-0.0.12a.tar.gz/download
tar -xvf pyasn1-0.0.12a.tar.gz
cd pyasn1-0.0.12a
python26 setup.py build
python26 setup.py install

Kippo doesnt run under root user! So we must create a regular user.

useradd kippouser

You need to download latest version of Kippo source package from http://kippo.googlecode.com.

su - kippouser
wget http://kippo.googlecode.com/files/kippo-0.5.tar.gz
tar -xvf kippo-0.5.tar.gz
cd kippo-0.5

vi kippo.cfg

## Kippo configuration file (kippo.cfg)#[honeypot]# IP addresses to listen for incoming SSH connections.## (default: 0.0.0.0) = any address#ssh_addr = 0.0.0.0# Port to listen for incoming SSH connections.## (default: 2222)ssh_port = 2222# Hostname for the honeypot. Displayed by the shell prompt of the virtual# environment.## (default: sales)hostname = sales# Directory where to save log files in.## (default: log)log_path = log# Directory where to save downloaded (malware) files in.## (default: dl)download_path = dl# Directory where virtual file contents are kept in.## This is only used by commands like 'cat' to display the contents of files.# Adding files here is not enough for them to appear in the honeypot - the# actual virtual filesystem is kept in filesystem_file (see below)## (default: honeyfs)contents_path = honeyfs# File in the python pickle format containing the virtual filesystem. ## This includes the filenames, paths, permissions for the whole filesystem,# but not the file contents. This is created by the createfs.py utility from# a real template linux installation.## (default: fs.pickle)filesystem_file = fs.pickle# Directory for miscellaneous data files, such as the password database.## (default: data_path)data_path = data# Directory for creating simple commands that only output text.## The command must be placed under this directory with the proper path, such# as:# txtcmds/usr/bin/vi# The contents of the file will be the output of the command when run inside# the honeypot.## In addition to this, the file must exist in the virtual# filesystem {filesystem_file}## (default: txtcmds)txtcmds_path = txtcmds# Public and private SSH key files. If these don't exist, they are created# automatically.## (defaults: public.key and private.key)public_key = public.keyprivate_key = private.key# Initial root password. Future passwords will be stored in# {data_path}/pass.db## (default: 123456)password = 123456# IP address to bind to when opening outgoing connections. Used exclusively by# the wget command.## (default: not specified)#out_addr = 0.0.0.0# Sensor name use to identify this honeypot instance. Used by the database# logging modules such as mysql.## If not specified, the logging modules will instead use the IP address of the# connection as the sensor name.## (default: not specified)#sensor_name=myhostname# Fake address displayed as the address of the incoming connection.# This doesn't affect logging, and is only used by honeypot commands such as# 'w' and 'last'## If not specified, the actual IP address is displayed instead (default# behaviour).## (default: not specified)#fake_addr = 192.168.66.254# MySQL logging module## Database structure for this module is supplied in doc/sql/mysql.sql## To enable this module, remove the comments below, including the# [database_mysql] line.#[database_mysql]#host = localhost#database = kippo#username = kippo#password = secret./start.sh

By default kippo output will be redirected to the file log/kippo.log. To see the Kippo logging data use the following command:

tail -f log/kippo.log

By default,Kippo is running on port 2222. If its running on Windows, port 22 is usually free and it's ok to run kippo on that port. On linux, port 22 is restricted for root only, except if you do this (quote from #twisted):

iptables -t nat -A PREROUTING -i IN_IFACE -p tcp --dport 22 -j REDIRECT --to-port 2222

Replace IN_IFACE with your real interface name such as eth0!

Connect to the Kippo server on port 2222 by using root as username and 123456 as password.

ssh 127.0.0.1 -p 2222 -l root

You must see the following banner after successful login:

sales:~#

The Honeynet Project: http://www.honeynet.org/
Honeypot: http://en.wikipedia.org/wiki/Honeypot_(computing)
Kippo Project: http://kippo.googlecode.com/
Iran Honeynet Project: http://www.honeynet.ir/
CentOS: http://www.centos.org/



View the original article here


This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

Make Browsers Cache Static Files With mod_expire On Lighttpd (Debian Squeeze)

This tutorial explains how you can configure Lighttpd to set the Expires HTTP header and the max-age directive of the Cache-Control HTTP header of static files (such as images, CSS and Javascript files) to a date in the future so that these files will be cached by your visitors' browsers. This saves bandwidth and makes your web site appear faster (if a user visits your site for a second time, static files will be fetched from the browser cache). This tutorial was written for Debian Squeeze.


I do not issue any guarantee that this will work for you!


I'm assuming you have a working Lighttpd setup on your Debian Squeeze server, e.g. as shown in this tutorial: Installing Lighttpd With PHP5 And MySQL Support On Debian Squeeze


You *could* enable mod_expire with the command lighty-enable-mod expire, however this gives you no control in which order Lighttpd modules are loaded, and as stated in the Troubleshoot section on http://redmine.lighttpd.net/wiki/1/Docs:ModExpire, it is strongly recommended to load mod_expire before all other modules.


Therefore we open /etc/lighttpd/lighttpd.conf...

vi /etc/lighttpd/lighttpd.conf


... and add mod_expire as the first module in the server.modules stanza:

server.modules = ( "mod_expire", "mod_access", "mod_alias", "mod_compress", "mod_redirect",# "mod_rewrite",)[...]

Restart Lighttpd afterwards:

/etc/init.d/lighttpd restart


The mod_expire configuration can be placed in the overall Lighttpd server configuration or inside a virtual host container.


In this example, I will place it in the overall server configuration (i.e., this configuration is active for all vhosts):

vi /etc/lighttpd/lighttpd.conf


On Lighttpd, Expires headers are set based on the directory where a file is located, not on the file type (this is different from Apache). For example, a valid mod_expire configuration would be as follows:

[...]expire.url = ("/images/" => "access plus 7 days", "/jquery/" => "access plus 2 weeks", "/js/" => "access plus 2 months", "/misc" => "access plus 1 days", "/themes/" => "access plus 7 days", "/modules/" => "access plus 24 hours")[...]

In the above example, all files from the /images/ directory (and its subdirectories) get an Expires header with a date 7 days in the future from the browser access time. Therefore, you should make sure that the directories you list in the expire.url directive really only contain static files that can be cached by browsers.


Restart Lighttpd after your changes:

/etc/init.d/lighttpd restart


You can use the following time units in your configuration:

yearsmonthsweeksdayshoursminutesseconds

Please note that you must use these time units in plural because otherwise Lighttpd will refuse to start. So you must not use access plus 1 day, but access plus 1 days instead (this is also different from Apache where both singular and plural are allowed).


It is possible to combine multiple time units, e.g. as follows:

"access plus 1 months 15 days 2 hours"


Also note that if you use a far future Expires header you have to change the component's filename whenever the component changes. Therefore it's a good idea to version your files. For example, if you have a file javascript.js and want to modify it, you should add a version number to the file name of the modified file (e.g. javascript-1.1.js) so that browsers have to download it. If you don't change the file name, browsers will load the (old) file from their cache.


Instead of basing the Expires header on the access time of the browser (e.g. "access plus 60 days"), you can also base it on the modification date of a file (please note that this works only for real files that are stored on the hard drive!) by using the modification keyword instead of access:

"modification plus 7 days"


It is also possible to include your mod_expire rules inside a condition, e.g. as follows:

[...] $HTTP["url"] =~ "^/images/" { expire.url = ( "" => "access plus 1 hours" )}[...]

This tells Lighttpd to add an Expires header to all files where the URL begins with /images/ (like http://www.example.com/images/subdir/1.png).


To test if your configuration works, you can install the Live HTTP Headers plugin for Firefox and access a static file through Firefox (e.g. an image). In the Live HTTP Headers output, you should now see an Expires header and a Cache-Control header with a max-age directive (max-age contains a value in seconds, for example 604800 is one week in the future):


Click to enlarge

View the original article here


This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.