Subscribe:
    Subscribe Twitter Facebook
    Showing posts with label Linux. Show all posts
    Showing posts with label Linux. Show all posts

    Wednesday, February 8, 2012

    How to Install Skype on Ubuntu Linux ???

    Many People feel unsecured while chatting on Skype in windows platform due to the FUD (Fully Undetectable Viruses) threat. Hence today in this tutorial i will tell you how you can run Skype in Linux Platform which is almost 98% secure from RAT and other malicious viruses.

    Here we Have two methods of installing Skype in Ubuntu Linux

    1. Through Ubuntu Software Center
    2. Manual Method 

    Skype Through Ubuntu Software Center 
    For this just  go to Ubuntu Software Center and in search type Skype , Ubuntu 11.10 Support Skype 2.0 Version for Linux. Click on install and in few minutes you are ready to use the Skype.

    Installing Skype Through Manual MethodThis is the easiest method to install from the command line. There are three commands that you must use to install Skype correctly.
    Open your terminal and copy paste this commands
     
    sudo apt-get install libqt4-gui
    wget -c -O /tmp/skype.deb http://www.skype.com/go/getskype-linux-ubuntu
    sudo dpkg -i /tmp/skype.deb


    Now you can see the Skype on your menu bar and you are ready to use Skype no need to worry about RAT and other trojan.

    Sunday, May 23, 2010

    How to configure firewall in linux by using iptables

    How to configure firewall in linux by using iptables - Video Tutorial

    Wednesday, January 6, 2010

    Make a BackTrack Linux Flash Drive in Windows

    How to Make a BackTrack Linux Flash Drive using Windows. BackTrack is a Live Linuxdistribution based on SLAX that is focused purely on penetration testing. Distributed by remote-exploit.org, BackTrack is the successor to Auditor. It comes prepackaged with security tools including network analyzers, password crackers, wireless tools and fuzzers. Although originally designed to Boot from a CD or DVD, BackTrack contains USB installation scripts that make portable installation to a USB device a snap. In the following tutorial, we cover the process of installing BackTrack to a USB flash drive from within a working Windows environment.



    BackTrack Desktop Screenshot:
    BackTrack in action running from USB
    How to install BackTrack to a USB device:
    Note: USB installation of BacktTack performs like the Live CD. Currently a persistence BackTrack feature is outside the scope of this tutorial.
    1. Download the (Portable Backtrack) USB BackTrack (Extended)version
    2. Extract the Boot and BT3 folders to the root of your USB device
    3. Navigate to the Boot folder on your "USB device" and clickbootinst.bat (click continue if the following error appears)
    4. BackTrack Error
    5. Follow the onscreen instructions to make the device bootable
    6. Once the USB install script has finished, reboot your computer and set your BIOS or Boot Menu to boot from the USB device

    How to boot OS from a USB drive


    1. Download Win32 Disk Imager

    Win32 Disk Imager a free piece of software that does the whole job for you. You can download it from here. Extract the zip file. After that, plug in your USB drive and run Win32DiskImager.exe.

    2. Copy the image file to your USB drive

    1. Click the blue folder icon and select your image file.
    2. In the Device area, select the USB drive you want to copy the image to. WARNING: All data on this drive will be deleted. Please make very sure you select the proper drive letter (verify with Explorer).
      USB 01
    3. Click Write.
    4. Win32 Disk Imager copies the file’s contents onto your USB drive. Check the progess with the progress bar.

    3. Proceed to the boot section below


    Linux

    1. Find out which device is your USB drive

    Plug in your USB drive. Open up a terminal window and type fdisk -l. You’ll see an overview of all your disks and partitions. Identify your USB drive by looking for its size. In my example below, my USB drive has a size of 65 MB and is called /dev/sda. Please make sure you identify the correct one as all data on it will be lost in the following steps. Consider yourself warned. I will refer to the USB drive as /dev/USB from now on to avoid confusion.
    USB 03

    2. Copy the image file to your USB drive

    Type dd if=image.img of=/dev/USB into your console where image.img is your image file and /dev/USB is your USB drive. Use a USB drive with a capacity of at least 4 GB.

    3. Proceed to the boot section below

    Boot

    Once you are done copying your image onto your USB stick, you can boot from it. Switch off your computer and plug in your USB stick. Switch on your computer and enter the boot menu (F11 or F12 on most machines). Select your USB drive as boot device. That’s it.

    Other Methods


    Method 1 :


    Here we assume that you are using either Vista or Windows 7 to create a bootable USB.

    1. Insert your USB (4GB+ preferable) stick to the system and backup all the data from the USB as we are going to format the USB to make it as bootable.
    2. Open elevated Command Prompt. To do this, type in CMD in Start menu search field and hit Ctrl + Shift + Enter. Alternatively, navigate to Start > All programs >Accessories > right click on Command Prompt and select run as administrator.
    3. When the Command Prompt opens, enter the following command:
    DISKPART and hit enter.
    LIST DISK and hit enter.
    Once you enter the LIST DISK command, it will show the disk number of your USB drive. In the below image my USB drive disk no is Disk 1.
    4. In this step you need to enter all the below commands one by one and hit enter. As these commands are self explanatory, you can easily guess what these commands do.
    SELECT DISK 1 (Replace DISK 1 with your disk number)
    CLEAN
    CREATE PARTITION PRIMARY
    SELECT PARTITION 1
    ACTIVE
    FORMAT FS=NTFS
    (Format process may take few seconds)
    ASSIGN

    EXIT
    Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.
    5. Insert your Windows DVD in the optical drive and note down the drive letter of the optical drive and USB media. Here I use “D” as my optical (DVD) drive letter and “H” as my USB drive letter.
    6. Go back to command prompt and execute the following commands:
    D:CD BOOT and hit enter. Where “D” is your DVD drive letter.
    CD BOOT and hit enter to see the below message.
    BOOTSECT.EXE/NT60 H:

    (Where “H” is your USB drive letter)
    7. Copy Windows DVD contents to USB.
    You are done with your bootable USB. You can now use this bootable USB as bootable DVD on any computer that comes with USB boot feature (most of the current motherboards support this feature).
    Note that this bootable USB guide will not work if you are trying to make a bootable USB on XP computer.



    Method 2 - Make your flash drive bootable using Bart's mkbt util:
    http://www.nu2.nu/mkbt/ | Alt: mkbt20.zip
    Put a bootable floppy disk in your A: drive or create one using Windows.
    Download mkbt20.zip and unpack to to new temp folder you create.
    Go to the temp folder.
    Extract the bootsector from the bootable floppy disk. eg Open a DOS Window and go to the directory where you extracted MKBT. Type:

    mkbt -c a: bootsect.bin
    The boot sectors from the bootable floppy disk have just been saved to a file in the temp folder you created.
    Format the flash drive in FAT or FAT16.
    Copy the bootsector to the flash drive. Open a DOS Window and go to the folder where you extracted MKBT. Type:
    mkbt -x bootsect.bin Z:
    "Z" represents the flash drive drive Letter. So if your flash drive has another drive letter, then change the "Z" accordingly.
    Now you can [grin] "should" be able to copy the utils you need to the pen drive.



    Tuesday, November 24, 2009

    Automatically mount your Linux partition in Windows



    Linux drive image
    You can automatically mount your Linux partition in Windows and have read/write functionality with a freeware application called Ext2Fsd. I will take you through the process of mounting your Linux partition using Windows XP.
    After you install Ext2Fsd you need to mount the Linux partition. Mount the Linux partition by opening Command Prompt and typing the following:
    mount 0 1 L:

    Note: the “0″ above is a zero.
    If you get a response like the following, the mount worked and you will be able to access your Linux partition in My Computer.
    Mount Linux image
    I will explain the above commands. The mount command is pretty obvious, and mounts your partition. The zero references your hard drive. If you are like most users and only use one hard drive, then you will want to leave the zero. If you use multiple hard drives then you will need to change that number appropriately.




    The 1 following the zero references the specific partition on your hard drive that Linux resides on. If you are like most users, your Linux partition is the first partition on your hard drive (so you can use GRUB by default) and you will not need to change this number. If Linux is your second or third partition, then you will need to change the number appropriately.
    Lastly, the “L:” is just a notation to give your hard drive a letter in My Computer. I like to use L because it “stands” for Linux. You can give your drive whatever letter you like, however, do not choose C because it will freeze your Windows partition (however, no permanent damage will occur).
    Linux bat image


    In order to automatically mount your partition when you log into Windows you will need to create a batch file. Open a file in notepad and type the following command (you can download my batch file if you prefer):
    mount 0 1 L:
    Save the file with the name linuxpartition.bat. Exit Notepad and right-click linuxpartition.bat and create a shortcut. Drag the shortcut into your Startup folder and your Linux partition will be automatically mounted when you start Windows.
    Startup image



    even I have tried it and the easiest is the fs-driver.
    works great. just install it and no need to type anything at all at the command line


    Wednesday, October 7, 2009

    Restoring Lost Partition Table

    People usually ask

    How do I restore my lost partition table? 
    I accidently deleted my partition table, how do I recover my data? 
    How to recover deleted partitions and data in them? 
    Recover data from deleted drives.

    Note : If you’ve formatted and/or added new data to the drive, or carried on with an OS installation, chances of recovery are very less.
    Most people end up deleting their partition table while they try to install a new OS for the first time, I personally know a couple of them who ended up deleting their partition table while they tried to install Linux for the first time, (more on that later), Now what I am going to introduce to you a tiny tool called “gpart” which will help you restore your deleted partition table.
    Things you’ll need.

    An Ubuntu or similar, live CD (actually any Linux live CD / USB will do, but I am demonstrating here using Ubuntu 9.04 (Jaunty Jackalope)
    A working internet connection or this file (35.8 KiB)
    Patience!

    Here is the step by step procedure for restoring your lost partition table, and hence your lost data

    Boot using your live cd, I am using Ubuntu 9.04, Jackalope here.
    You will need this file (35.8 KiB), or if you’re using another version of Ubuntu or a different Linux distro, the name of the package you need is gpart.
    You can install these packages using apt-get as well, from the terminal, if you have a working internet connection, here is the procedure for that



     Open the repository file by typing the following at the terminal :
    sudo gedit /etc/apt/sources.list
     Add the following line to it :
    deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe
     Install gpart by typing the following commands in the terminal :
    sudo apt-get update
    sudo apt-get install gpart



    Once you’ve downloaded and installed it, (it’s a binary file, just double click and go)
    Open up terminal from the applications menu at the top
    And type in the following command to detect the lost partitions : sudo gpart /dev/sda [This might take some time]

    This command assume that the drive is detected as /dev/sda if this is the only drive you’ve got, 99% chances are that it will be detected like this, otherwise change the /dev/sda parameter accordingly.
    This command will output the detected partitions that might have been lost due to some reasons, if they’re correct, and then this partition table needs to be written to the disk, use the following command for it.

    sudo gpart /dev/sda -W /dev/sda



    After the partition table has been successfully written [after considerable time], you will be asked to restart the computer, if everything goes well, you will be presented with your lost partition table and data on the next restart!
    Now, if you’re using terminal for everything, here is a short-cut.


     ubuntu@ubuntu:~$ sudo gedit /etc/apt/sources.list
    [You will have to add the following line to the end of the file that is opened: deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe, save and close this file.]
    ubuntu@ubuntu:~$ sudo apt-get update
    ubuntu@ubuntu:~$ sudo apt-get install gpart


    ubuntu@ubuntu:~$ sudo gpart /dev/sda
    [you will have to verify if the detected partition data is correct before proceeding, this command is supposed to take some time]


    ubuntu@ubuntu:~$ sudo gpart /dev/sda -W sudo gpart /dev/sda
    [Restart if this command is completed successfully, This command may take considerable time.]

    Restoring Grub Boot Loader




    Method 1: The Usual Way....
    After Installing WindowsXP, Boot a Linux Rescue Disk and Re-Install Grub with the command. "grub-install"

    read man grub for more info.

    typically....

    CODE

    mount /dev/your_boot_partiton /boot
    grub-install --root-directory /boot /dev/hda



    Method 2: The Easy, 733T haX0r Linux GuRu Way....

    The Boot Sector is Stored on the first 512 Bytes of the physical Disk.

    so... Backup your boot sector to a file like so...

    CODE

    dd if=/dev/hda of=/BootSectorBackup.bin bs=512 count=1


    Copy the backup file to a floppy disk / whatever.

    Install Windows XP.

    Boot a Linux Rescue Disk.

    then Copy your Origonal Boot Sector Over whatever Garbage WindowsXP put there with the command

    CODE

    dd if=/BootSectorBackup.bin of=/dev/hda bs=512 count=1




    If at all in Doubt... Use Method 1..
    If you Make a Mistake With Method 2, you can waye boodbye to your Partiton Table... File System, and look forward to a full re-partiton and re-format.

    In case of Any problem use below methods

    If you can boot from CD, simplest method is to mount linux partitions, then chroot to it, then run grub-install.
    TIP: fdisk -l will display all partitions at all drives.

    Method 3:

    In general, for any distro, even you havn't live CD, restoring can be done in such steps:
    1) Find any working linux sustem
    2) Create GRUB boot floppy:
    # cd /usr/share/grub/i386-pc
    # dd if=stage1 of=/dev/fd0 bs=512 count=1
    1+0 records in
    1+0 records out
    # dd if=stage2 of=/dev/fd0 bs=512 seek=1
    153+1 records in
    153+1 records out
    3) Boot from that floppy, then (quote from GRUB info page):

    Once started, GRUB will show the command-line interface (*note
    Command-line interface:. First, set the GRUB's "root device"(1)
    (*note Installing GRUB natively-Footnote-1: to the partition
    containing the boot directory, like this:

    grub> root (hd0,0)

    If you are not sure which partition actually holds this directory,
    use the command `find' (*note find:, like this:

    grub> find /boot/grub/stage1

    This will search for the file name `/boot/grub/stage1' and show the
    devices which contain the file.

    Once you've set the root device correctly, run the command `setup'
    (*note setup::

    grub> setup (hd0)


    For more information type info grub


    The RHEL installer provides the GRUB boot loader, GRUB (the GRand Unified Boot-loader).

    /boot/grub/grub/grub.conf has a format of global options followed by boot stanzas. Here is a sample grub.conf:


    timeout=5
    splashimage=(hd0,0) /grub/splash.xpm.gz
    password --md5 $1$/iX9y$Bkskfdsd4443gnff
    default=0
    title Red Hat Enterprise Linux AS (2.6.9-648_EL)
    root(hd0,1)
    kernel /vmlinuz-2.6.9.EL ro root=/dev/VolGroup00/LogVol00

    initrd /initrd-2.6.9-648.EL.img
    title Windows XP Pro
    rootnoverify (hd0,0)
    chainloader +1


    IF ggrub-install fails for some reason try the following:

    1. type the command grub and press enter

    2. type root (hd0,0)

    3. type setup (hd0)

    4. type quit



    IF still problem occures, then reinstall the grub by

    /sbin/grub-install /dev/hda or use these three commands:

    Restore Lost Partitions to a Deleted or Corrupt Partition Table using Edgy LiveCD


    This HOWTO will tell you how to recover your lost partitions if the partition data on your hard drive got wiped by some malicious program (windows in my case). If the new/incorrect partitions have been formatted, then you've probably lost data. If all that got wiped was the partition table, then this should help you recover all of your data! I searched in the Tutorials and Tips forum and couldn't find anything quite like this, so I thought I'd write it up. If someone knows of a better thread, point me to it! 

    I have tested this on a Dapper install using an Edgy LiveCD.

    All that is needed is an Edgy LiveCD, a cd drive you can boot from, and a working internet connection. A dapper cd would most likely work, but I have not tested it.
    WARNING: This HOWTO is most likely to be used at your own risk, as I'm not sure if I'll be able to test it on future distributions (nor do I feel like destroying my partition info to do so).

    1.) Enable your computer to boot from the cd drive. You may have to enter your computer's BIOS to do this.

    2.) Boot from the Edgy LiveCD.

    3.) Assuming the LiveCD loaded just fine, enable the universe and multiverse repositories by System -> Administration -> Software Properties and checking the appropriate boxes.

    4.) Open up a terminal (Applications -> Accessories -> Terminal), and type

    Code:
    sudo apt-get install gpart
    Yes, gpart, not gparted. gpart is a program that will scan your drive for existing partitions, and output the cylinders that they are on.

    5.) In the terminal, run

    Code:
    sudo gpart /dev/hda
    or substitute whichever drive you are looking at (hdc, sda, etc.) and note the output. Mine looks like:

    Code:
    sudo gpart /dev/hdc
    
    Begin scan...
    Possible partition(Linux ext2), size(149660mb), offset(0mb)
    Possible extended partition at offset(149660mb)
       Possible partition(Linux swap), size(2965mb), offset(149660mb)
    End scan.
    
    Checking partitions...
    Partition(Linux ext2 filesystem): primary
    Partition(Linux swap or Solaris/x86): primary
    Ok.
    
    Guessed primary partition table:
    Primary partition(1)
       type: 131(0x83)(Linux ext2 filesystem)
       size: 149660mb #s(306504072) s(63-306504134)
       chs:  (0/1/1)-(1023/254/63)d (0/1/1)-(19078/254/63)r
    
    Primary partition(2)
       type: 130(0x82)(Linux swap or Solaris/x86)
       size: 2965mb #s(6072504) s(306504198-312576701)
       chs:  (1023/254/63)-(1023/254/63)d (19079/1/1)-(19456/254/60)r
    
    Primary partition(3)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    
    Primary partition(4)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    The "size" line is telling you first the number of mb of the partition, then the number of sectors (#s) and then the actual sectors that the partition is on (s). The last set of numbers (actual sectors the partition is on) is what we want. Write those down! With those in hand,

    5.a) Now we have to restore the partition table. We'll use parted.

    Code:
    sudo parted /dev/hda
    again substituting the drive you're interested in for hda.

    You should be at a prompt that looks like

    Code:
    (parted)
    5.b) At that prompt, type

    Code:
    unit s
    to make sure that parted is using units of sectors.


    5.c) Just in case we want to undo any changes, type "print", and be sure to write down the start and end sectors of all of the partitions on the disk! NOTE: The reason you don't want to use this method to get the start/end sectors of the partitions you're trying to restore is that parted just reads the partition table on the disk itself, even if it is incorrect or corrupt. If parted throws up errors about nonexisting partitions or a corrupt table, then there is no need for this step.

    6.) Now we actually restore the partitions! Still at the (parted) prompt, type

    Code:
    rescue
    , and you will be prompted for the start and end sectors of the partition you want to rescue. In my example, these numbers would be 63 for the start and 306504134 for the end of the first partition.

    7.) Repeat step 6 for all partitions that need to be recued.

    8.)
    Code:
    quit
    to exit out of parted.

    That's it! You should have access to all of your old partitions, and you can check this by mounting the various partitions in the live cd.

    9.) If you find out you messed with the partition table on the wrong disk, and you followed step 5.c), you can use steps 6-8 to restore the partition table you just wiped, using the numbers you wrote down from the print command in parted rather than the output from gpart.

    NOTE: If your partition table was wiped, it's quite possible (as it was in my case) that your MBR got killed as well, and you'll need to restore grub. You can try starting here: How to install Grub from a live Ubuntu CD, though I'll admit the first method failed for me. If the admins let this HOWTO through, I'll add on what I did to get GRUB back.

    Thursday, October 1, 2009

    Reset forgotten root password under Linux

    Method : 1

    You can reset forgotten root password under Linux by booting system into single user mode or emergency mode (also known as rescue mode).

    My boot loader is GRUB (see LILO boot loader below)
    )Following is the procedure to reset root password if you are using GRUB as a boot loader:

    Select the kernel
    Press the e key to edit the entry
    Select second line (the line starting with the word kernel)
    Press the e key to edit kernel entry so that you can append single user mode
    Append the letter S (or word Single) to the end of the (kernel) line
    Press ENTER key
    Now press the b key to boot the Linux kernel into single user mode
    At prompt type passwd command to reset password:
    You need to mount at least / and other partitions:
    # mount -t proc proc /proc
    # mount -o remount,rw /

    Change the root password, enter:
    # passwd

    Finally reboot system:
    # sync
    # reboot


    My boot loader is LILO
    At LILO boot loader type linux single and press [ENTER] key:
    Boot: linux single

    When you get the # prompt you will need to type passwd root to reset password:
    # passwd

    Reboot system:
    # sync
    # reboot

    Method : 2


    If you don't have a LiveCD, or the system doesn't have CDROM drive, you can reboot the system into single user mode to reset the password. Simply pass the options "init=/bin/sh" to the kernel from the bootloader menu. When the system boots it will drop you into a root shell. The disk will be mounted read-only so remount it read-write with
    mount -o rw,remount /dev/ROOT
    (be sure to change ROOT to your actual root partition). Edit /etc/shadow and remove the encrypted password. Reset the root password with passwd and reboot the system.
    You should now be able to login with the new password.

    Bidvertiser