Archive for April, 2004

Gentoo Linux 2004.1 announced

Wednesday, April 28th, 2004

According to Gentoo

The Gentoo Linux Release Engineering team is proud to announce the release of Gentoo Linux 2004.1. Gentoo Linux 2004.1 highlights many bugfixes that enhance the usability and quality of all the release components. Much work has been done to improve the overall quality of the release, such as providing GPG signatures for security and online listings of what files are included in the installation stages, PackageCDs, and LiveCDs for each architecture. Additionally, Catalyst v1.0.7 [7], the Gentoo Linux release meta-tool, has undergone numerous improvements that have solidified its codebase.

For more information read the press release note.

updating ~/.bashrc and /etc/profile files

Monday, April 26th, 2004

If you have made changes to ~/.bashrc or to /etc/profile, they will only be affective if you login again. You can use the following to avoid this:

source ~/.bashrc

or…

source /etc/profile

Which kernel to load

Monday, April 26th, 2004

I have 3 kernels compiled on my machine and I can select which one to load in memory interactively. When you are in the grub menu select linux..option and then press edit. You will get option like this:

kernel /kernel-2.4.18-14 ro root=/dev/hda5

Now use the TAB key and select among the available kernels you have and press boot.

Linux kernel vulnerability

Sunday, April 25th, 2004

According to NetSecurity

The ip_setsockopt() function code is a subroutine of the setsockopt(2) system call. This function allows manipulation of various options of the IP socket. The MCAST_MSFILTER option can be used to provide the kernel with a list of multicast addresses to be received on the socket. This code has been introduced with the 2.4.22/2.6.1 kernel releases. Proper exploitation of this vulnerability leads to local privilege escalation giving an attacker full super-user privileges. Unsuccesfull exploitation of the vulnerability may lead to a denial-of-service attack causing machine crash or instant reboot.

This bug has been fixed in the 2.4.26 and 2.6.4 kernel releases.

References:

Apache as an open proxy?

Sunday, April 25th, 2004

If you have seen entries in your access.log file like this one…

a.b.c.d – - [24/Apr/2004:23:00:00 +0200] “GET http://www.google.com/” 200 46124

This means that a.b.c.d is trying to access www.google.com using your Apache as a proxy. As you can see the response status 200 indicates success and the data returned is 46124 bytes long.

If you don’t want your server to be used as a forward proxy make sure that ProxyRequests directive is set to Off, even better do not load mod_proxy module.

Despite the fact the entry shown in the previous example says that the request succeded, this is not necessarily true. Try the following to test your server:

telnet www.yoursite.com 80
GET http://www.google.com/

Watch the access.log file. If you see the code status 200, compare the bytes returned by Apache (the last field in the log entry) with your homepage size (your index.html). If they match, Apache is serving your homepage instead of forwarding the request to google. If they don’t, probably your Apache is an open forwarding proxy.

References:

GRUB: menu options selection

Tuesday, April 20th, 2004

If you are at…

grub> root ([TAB]

Type “(” + TAB keys and this will give you the options that can be in this option place. The same goes for…

grub> setup ([TAB]

Transfer data or login from Windows to Linux machine

Tuesday, April 20th, 2004

If you want to transfer files from Windows to Linux machines you can use the pscp utility. Other related utilities can be found on this page . Here you will also find the putty utility that can be used to login to Linux machines and create ssh tunnels.

Usefull screen command

Monday, April 19th, 2004
  1. if you are doing installation on remote machine through ssh, there may be a chance that your ssh connection break up and your installation terminates, to avoid this problem after doing ssh to host run #screen and do your installation work.
  2. if you want to download/long compilation, and then exit from ssh connection without termination download/compilation you can do:

screen -S your_screen_name

Now start downloading/compilation. To exit without teminating download/compile session press CTRL+A then D, it will only detach you from screen. Now after that you want to check the status you do:

screen -x

choose the screen name you gave above:

screen -x your_screen_name

Editing remote files with OpenSSH

Sunday, April 18th, 2004

As you know, the main feature of OpenSSH is to establish secure connections to remote machines, so you get interactive sessions against them. However, OpenSSH also allows you to execute commands on remote machines. You can execute commands and have the output returned to the screen without logging in to the remote machine.

To execute a command remotely simply type:

ssh user@remote_host ‘ls -al /etc’

However, some commands require a terminal to run properly. For example, if you want to edit a remote file using vi you probably will try something like this:

ssh user@remote_host ‘vi /etc/passwd’

And you’ll get warnings like this:

Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

To avoid such warnings and cleanly edit your remote files type the following:

ssh -t user@remote_host ‘vi /etc/passwd’

The -t option will… (from OpenSSH man pages)

Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

Listing bash variables

Saturday, April 17th, 2004

If you want to quickly see the environment variables defined in bash, simply type the following in the prompt:

$<TAB><TAB>

Type $ and then hit the TAB key twice.

Other useful commands to see these variables are:

export

or…

export | cut -d ‘ ‘ -f 3-

or…

set | less