Latest Publications

Bootable live BackTrack on USB key

BackTrack is the highest rated and acclaimed Linux security distribution to date. BackTrack is a Linux-based penetration testing arsenal, that aids security professionals in the ability to perform assessments in a purely native environment, dedicated to hacking.

In this example, we will create a bootable live version of BackTrack on an USB key, that can be used to boot a computer without installing.

We boot up a computer with Ubuntu, visit the website of BackTrack, download the latest release and confirm the MD5 values. In this example, we will be using BackTrack 4 R1 Release ISO. We insert a 4 GB USB key, right click the desktop icon and format it to the FAT file system. We start Ubuntu Software Center and install 7zip, which is the Unix port of 7-zip, that archives with very high compression ratios. We also install UNetbootin, which can be used to make bootable live USB keys. 7zip is used by UNetbootin.

We start UNetbootin, type in our operating system account password, select image, confirm the USB device and click OK. The creation proces takes some time. When succesful, we right click and unmount the USB key file system, retract the USB key, insert it into a test computer, power up, choose USB boot priority and boot the live version of BackTrack. In this example, the boot priority is set by pressing F12 during power up.

Configuring BackTrack Linux for internet access

In this example, we will configure a computer, that is running a live boot BackTrack Linux operating system, manually for internet access.

We bring the network interface eth0 up. We assign the static internet protocol (IP) address 192.168.1.120 to it. We create a default route to the local router 192.168.1.1. This router is connected to the internet. We configure the operating system to use the domain name server 192.168.1.1.

ifconfig eth0 up
ifconfig eth0 192.168.1.120
route add -net 0.0.0.0 gw 192.168.1.1 eth0
echo "nameserver 192.168.1.1" > /etc/resolv.conf

There are other ways to do this, such as using the dynamic host configuration protocol (DHCP), other commands, automated scripts or graphical user interface (GUI) dialogs.

In the following example, we use the GUI network configurator dialog.

startx

We click the KDE menu, Internet and “Set IP address”. The “Network configurator” dialog appears. We set “Device” to eth0, “IP Address” to 192.168.1.120, “Subnet mask” to 255.255.255.0, “Default gateway” to 192.168.1.1 and “Primary DNS” to 192.168.1.1. We click Assign.

How to reject spam and mail from domains

In this example, we will configure a Sendmail mail server on a FreeBSD operating system to reject mail from a domain.

We edit the access control file, which controls the operation of the mail server based on networks, domains, mail address users and mail addresses.

cd /etc/mail
nano access

We add two domains from which we do not want to accept mail.

example1.com REJECT
example2.com ERROR:"550 We do not accept mail from spammers."

We update the access control database and restart the service.

makemap hash access.db < access
make restart

We test the rejection.

telnet localhost 25
helo example1.com
mail from: example1@example1.com

At this time, the mail server rejects the mail and returns a standard error message. The message can not be delivered.

telnet localhost 25
helo example2.com
mail from: example2@example1.com

At this time, the mail server rejects the mail and returns our custom error message. The message can not be delivered.

We repeat the procedure for the remaining backup mail servers.

How to connect to a local host from a local host using internet address

If your network router does not allow you to connect to a local host from a local host using the internet address, it is possible, that your router or firewall does not have the network address translation (NAT) loopback option activated. This is not unusual for standard ADSL broadband routers. Unfortunately, this option is not always available from the web interface to the router. The command line interface (CLI) should be used.

In the following example, we use the CLI to a ZyXEL router and activate the NAT loopback option.

telnet 192.168.1.1
ip nat loopback on
exit

That’s it. Now, we can connect to a local host from a local host using the internet address.

Administration of users of a MySQL database server

There are many ways to administrate the users of a MySQL database server. However, a simple way for the system administrator of the MySQL server is to use the shell.

In the following example, we will create a new user. The user will be named ‘ann’. The user will be allowed to log on from localhost, which is the same host as the host, that MySQL is running from. The password will be ‘access’. The database will be named ‘ann’. The user will be granted all privileges, which is recommended for use with content management systems. The user will not be allowed to login from other hosts. The user will not be allowed to create, use or drop databases of other names or users.

mysql -uroot -p mysql
grant all on ann.* to 'ann'@'localhost' identified by 'access';
quit;

In the following example, we confirm the privileges for a user.

show grants for 'ann'@'localhost';

In the following example, we test the user account, create the database and log out.

mysql -uann -p
create database ann;
quit;

In the following example, we obtain a list of the users of the database.

mysql -uroot -p mysql
select User,Host from user order by User;

In the following example, we will delete the database ‘ann’ and the user ‘ann’ from the users of the database and log out.

drop database ann;
drop user ann;
quit;