Monday, March 31, 2008

A Comprehensive Guide to Nmap with Screenshots

What is Nmap?

Nmap (”Network Mapper”) is a free open source utility for network exploration or security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. Nmap runs on most types of computers and both console and graphical versions are available. (source)

First and foremost we will download, compile and install nmap from scratch under Linux. The latest Nmap sources available for download is 4.21ALPHA4 which you can download from here: http://download.insecure.org/nmap/dist/nmap-4.21ALPHA4.tar.bz2

However the stable version is 4.20 .

First we will download the latest source from it’s website:

Screenshot-1

Now we are going to go through the process Extracting the bzip2 file, “configure” it and “make install” it from the source. With this commands:

bzip2 -cd nmap-4.21ALPHA4.tar.bz2 | tar xvf -

cd nmap-4.21ALPHA4

./configure

make

su root

make install

During the process of installing I get this error:



nmapfe.c:114:2: error: #error “Your system does not appear to have GTK (www.gtk.org) installed. Thus the Nmap X Front End will not compile. You should still be able to use Nmap the normal way (via text console). GUIs are for wimps anyway :)”




Like it said GUIs are for wimps anyways. And besides we will be mostly using console for this demonstration.

You can look at the whole output from my console, during the installation here:

http://www.linuxhaxor.net/nmap_output.html

Nmap has a huge list of scanning options and scanning modes, here is the output list of options:

pavs@uberhaxor:~$ nmap

Nmap 4.21ALPHA4 ( http://insecure.org )

Usage: nmap [Scan Type(s)] [Options] {target specification}

TARGET SPECIFICATION:

Can pass hostnames, IP addresses, networks, etc.

Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254

-iL : Input from list of hosts/networks

-iR : Choose random targets

–exclude : Exclude hosts/networks

–excludefile : Exclude list from file

HOST DISCOVERY:

-sL: List Scan - simply list targets to scan

-sP: Ping Scan - go no further than determining if host is online

-P0: Treat all hosts as online — skip host discovery

-PS/PA/PU [portlist]: TCP SYN/ACK or UDP discovery to given ports

-PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes

-n/-R: Never do DNS resolution/Always resolve [default: sometimes]

–dns-servers : Specify custom DNS servers

–system-dns: Use OS’s DNS resolver

SCAN TECHNIQUES:

-sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans

-sU: UDP Scan

-sN/sF/sX: TCP Null, FIN, and Xmas scans

–scanflags : Customize TCP scan flags

-sI : Idlescan

-sO: IP protocol scan

-b : FTP bounce scan

–traceroute: Trace hop path to each host

PORT SPECIFICATION AND SCAN ORDER:

-p : Only scan specified ports

Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080

-F: Fast - Scan only the ports listed in the nmap-services file)

-r: Scan ports consecutively - don’t randomize

SERVICE/VERSION DETECTION:

-sV: Probe open ports to determine service/version info

–version-intensity : Set from 0 (light) to 9 (try all probes)

–version-light: Limit to most likely probes (intensity 2)

–version-all: Try every single probe (intensity 9)

–version-trace: Show detailed version scan activity (for debugging)

SCRIPT SCAN:

-sC: equivalent to –script=safe,intrusive

–script=: is a comma separated list of dirs or scripts

–script-trace: Show all data sent and received

–script-updatedb: Update the script database. Only performed if -sC or –script was also given.

OS DETECTION:

-O: Enable OS detection (try 2nd generation w/fallback to 1st)

-O2: Only use the new OS detection system (no fallback)

-O1: Only use the old (1st generation) OS detection system

–osscan-limit: Limit OS detection to promising targets

–osscan-guess: Guess OS more aggressively

TIMING AND PERFORMANCE:

Options which take

SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES

TCP stream sniffer and connection tracking

tcpick sniffer libpcap is a text that can track, reassemble and reorder TCP streams. Tcpick is capable of recording captured flows in different files or displays them in the terminal, it is useful to track files that are transmitted via ftp or http. You can see all the current in the terminal, when the connection is closed in different display modes like hexdump, hexdump + ascii, only printable charachters, raw mode and so on. Available in color also useful to read and understand the program output. In fact, you can manage multiple interfaces, including ethernet cards and ppp. It is useful to keep track of what users of a network are doing, and can be used with text tools like grep, sed, awk.



[ http://tcpick.sourceforge.net/ ]

To display the connection status: tcpick -i eth0 -v -C

2008-01-10-013736_1280x800_scrot.png

To display the payload and packet headers: tcpick -i eth0 -yP -C -h -a

2008-01-10-014003_1280x800_scrot.png

Sunday, March 30, 2008

Manage MySQL remotely with phpMyAdmin

Odds are, if you design Web sites with a database back end, you've worked with MySQL. You can manage this database from the command line, but it's not very user-friendly. Using the graphical tool phpMyAdmin helps, but not all Web hosting providers offer it or allow you to install it on the server. Fortunately, you can install it on your own box and manage several MySQL databases remotely at the same time, without having to install anything anywhere else.

phpMyAdmin is open source software tool, written (obviously) in PHP. It allows you to perform all kinds of MySQL administrative tasks over the Web by means of an easy graphical interface. If you need to do something that isn't provided by the interface, phpMyAdmin allows you to fall back to direct MySQL commands, so you're always able to perform any task, no matter how complex. The software is available for most distributions in more than 50 languages, and is licensed under the GPL.

Installation and setup

You must have Apache installed before you set up phpMyAdmin. For this article, I'll assume that Apache HTML files reside on /srv/www/htdocs (another common possibility is /var/www/html) and that Apache runs as user webmin belonging to group www. The configuration details for the HTML files are in the default-server.conf file, and the details for the user and group are in uid.conf.

If your distribution repositories include phpMyAdmin, you can install it by using your favorite package manager; in my case, since I prefer Smart, I just ran smart install phpMyAdmin. If your repositories don't provide the latest version, go to the phpMyAdmin downloads page and pick the version that suits you. (For international users, I recommend the all-languages.tar.gz file; if English is enough for you, try english.tar.gz.) After downloading the file, working as root, type in the following command:

tar zxf thePackageYouDownloaded.tar.gz -C /srv/www/htdocs && chown wwwrun.www -R /srv/www/htdocs/phpMyAdmin*

To change phpMyAdmin configuration, you must edit the file config.inc.php, which doesn't happen to be very friendly. You can browse the online documentation for it, but you just need to change a few lines. Open the file and locate a group of lines all starting with $cfg['Servers'][$i]; edit the following lines (note: they might not be together or in the order shown here) to suit your configuration:


$i++;
$cfg['Servers'][$i]['host'] = 'THE HOSTNAME OR IP ADDRESS OF THE MYSQL HOST';
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'THE MYSQL USER NAME';
$cfg['Servers'][$i]['password'] = 'THE MYSQL USER PASSWORD';

For each server you want to manage remotely, copy all the lines above, including $i++:, and paste them into the configuration file: you will end up having a similar group of lines for each server you will manage remotely. Note that whichever MySQL user you specify will need remote access rights to work with the corresponding database; these rights must be granted (for each database) by an administrator, but they should already be set.

phpMyAdmin allows for three authentication methods ('auth_type' in the configuration file). The "config" authentication method is the simplest -- it lets you connect to a server without entering anything; the user and password will be in the configuration file itself. (The other two methods, "cookie" and "http," force you to enter a username and password each time you want to connect to a database.) This may not be the safest, most secure, method, but since you will be accessing the remote server from your own machine, this isn't such a problem -- presumably, the server should already be secured. Still, you might want to protect your phpMyAdmin installation by using an appropriate .htaccess file.

andLinux - Run-Linux-Inside-Windows

andLinux is a complete Ubuntu Linux system running seamlessly in Windows 2000 based systems (2000, XP, 2003, Vista; 32-bit versions only). This project was started for Dynamism for the GP2X community, but its userbase far exceeds its original design. andLinux is free and will remain so, but donations are greatly needed.


andLinux uses coLinux as its core which is confusing for many people. coLinux is a port of the Linux kernel to Windows. Although this technology is a bit like running Linux in a virtual machine, coLinux differs itself by being more of a merger of Windows and the Linux kernel and not an emulated PC, making it more efficient. Xming is used as X server and PulseAudio as sound server.

andLinux is not just for development and runs almost all Linux applications without modification.



To start Linux applications, you may either use the XFCE Panel:

The XFCE Panel


Or, you may choose to use the andLinux Launcher, which ships with andLinux since Beta 1. It consists of:

  • quicklaunch icons (e.g. for the file manager or the terminal)

  • a start menu in the system tray (next to the clock) which can be adapted to your own needs

  • so-called Explorer shell extensions, i.e. context menu item, with which you can open a folder in the file manager / terminal or open a file with the text editor

  • file type associations at your choice (e.g. for KOffice files, .tex / .dvi / .ps / .pdf files)

  • andCmd.exe to run linux commands from Windows scripts

Now Open a folder with Konqueror or Konsole

 

and Open a file with Kate

Access Linux files from Windows with Linux Reader

Windows only: Dual-booters have long been able to get at their Windows-formatted files, but Windows certainly doesn't make it easy to go the other way 'round. Enter Linux Reader, a free Windows application that emulates the look and feel of the Windows XP Explorer and allows read-only access to ext2 and ext3-formatted drives, the most common formats for Linux installations. Linux Reader can also search through Linux images and mount images for browsing, and runs as a stand-alone application—for a driver-based reading tool, check out Ext2 Installable File System. Linux Reader is a free download for Windows 98 and later.

Linux Reader

Run Windows Apps Seamlessy Inside Linux

You love working inside your Linux desktop, but at the most inconvenient times you've got to reboot into Windows—whether to open a tricky Office file, try out a Windows application, or even just play a quick game. However, with some free tools and a Windows installation disk, you can have Windows apps running right on your Linux desktop and sharing the same desktop files. It's relatively painless, it takes only a little bit longer than a Windows XP install, and it works just like virtualizing Windows on a Mac with Parallels Coherence—except it's free. Here's how to set up Windows inside VirtualBox, and then get Windows apps running seamlessly inside your desktop.

Before getting started, make sure you have enough space on a hard drive for a Windows XP installation (meaning at least 5 GB) and enough memory to make two systems worthwhile.You can follow most of these steps if you want to try running Vista inside Linux, but your mileage might vary, of course (and check out this tip on making Vista's networking work).

If you're curious what the end result might look like, here's a screenshot from my quick installation. I would've loved to have gotten iTunes running, but I didn't have time to wait for all the post-XP-installation patches/upgrades to install to show you. (Click for larger image)

First off, we'll install VirtualBox. For most, that just involves heading to their package manager and installing all the virtualbox pacakges from the repositories; in Ubuntu 7.10 ("Gutsy Gibbon"), for example, you can use this terminal command

sudo aptitude install virtualbox-ose virtualbox-ose-modules-generic
If you don't see VirtualBox in your installation program, the app's downloads page has packages for just about every major distribution. After installing, give your username permissions to run VirtualBox (substituting "su" on some systems):
sudo usermod -G vboxusers -a [your username]

vbox_setup.jpgRestart your system for good measure, and now you should see "InnoTek VirtualBox" in your application menu—it was in "System Tools' in Gutsy. Get your XP CD ready and fire up VirtualBox. Choose "New" from the button menu, and then give your virtual system a name (WIndows XP usually works for me) and choose "Windows XP" from the bottom menu, then hit "Next." Decide how much RAM you'll dedicate to it in the next window, hit "Next," then, assuming you haven't done this before, hit "New" and follow the prompts to set up hard drive space for your virtual XP system. Make sure that partition is selected, hit "Next," then hit "Finish" to set up your new XP space.

xp_installing.jpgBack at VirtualBox's main screen, see if the "CD/DVD-ROM" menu is highlighted. If not, click it, and then check "Mount CD/DVD Drive," "Host CD/DVD Drive" (and make sure it points to your system's CD drive), and check yes for "Enable Passthrough." Hit OK, select your XP image from the left-hand column and hit "Start." You'll launch into the hopefully familiar XP installation routine; follow it through until you're at your Windows desktop.

vbox_drive.jpgNow you've got a working Windows inside a resizable box, but let's take this further. Remove your XP CD from the drive, head up to the "Devices" menu and choose "Unmount CD/DVD-ROM." In the same menu, choose "Install Guest Additions." VirtualBox should prompt you to download the Guest Additions ISO file, then select it to be mounted. This creates a virtual CD drive in XP, which you can get to through Start Menu->My Computer (it might take a moment to show up). Double-click the "CD drive" and follow the prompts to install the extra tools. Reboot once you're done for good measure, and restart the XP machine.

Once that's finished, you've got a "Seamless" option available in the "Machine" menu, or by holding down the "Host" key (Right Control by default) and hitting "L." Either way you run it, it drops the big window and deposits Windows' bottom taskbar on your Linux desktop. You can also ditch the main VirtualBox window at this point, if you'd prefer.

dual_taskbars.jpgThe Start panel's default bottom position can be a problem for GNOME-based systems, since you've already got an app-switching bar there. I recommend either moving your Start or GNOME menus to the left or right-hand sides, or setting your Start menu to double-height, which puts the Start button just above the GNOME bar. Either way, make sure you un-check the "Keep the taskbar on top of other windows" option on the Windows toolbar, or you might see a few graphical glitches. Otherwise, pretty neat, huh?

Now for the final piece: Synchronizing your Windows and Linux desktops. If you're running in Seamless mode, hold down the "Host" key and hit "Home" to bring back the virtual XP desktop. Select the "Device" menu and choose "Shared Folders." You'll be prompted to choose a folder from your Linux system; select your Desktop folder (usually found at /home/your username/Desktop). Head back to Windows, launch a command prompt (enter "cmd" into the "Run" dialog), and enter the following:

net use x: \\vboxsvr\Desktop
If it worked, you should see an X: network drive mounted in your "My Computer" window.

regedit_cropped.jpgNow for the final touch: Synchronizing the two desktops. In XP, hit the "Run" dialog and type in "regedit." Make a backup first (File->Export), and then navigate to HKEY_CURRENT_USER -> Software -> Microsoft -> Windows -> CurrentVersion -> Explorer -> User Shell Folders. Double-click to open the properties on the "Desktop" key you'll find there, and enter a new value of (without the quotes) "x:". You should see the change immediately—everything you put on your Linux desktop is shown in Windows and vice versa—handy for storing downloads grabbed in Windows.

If you'd rather do without the Start menu/panel integration and just want a few custom apps to open in their own windows, check out a helpful guide at Linux.com to getting this set up with some free tools and VMWare Server, which, while not quite as user-friendly as VirtualBox, is still a pretty nice package.


SOURCE : digg.com


Create-Encrypted-System-Partition-Under-Linux / Windows / Mac-OS-X

TrueCrypt is a software application used for on-the-fly encryption (OTFE). It is free and open source software. TrueCrypt is available for Microsoft Windows, Mac OS X, and Linux. This software can protect date. It encrypts data stored on a computer’s disk and transparently decrypts the information when a user requests it. No special action by the user is required.


TrueCrypt can create a hidden encrypted volume inside a standard encrypted one. As it's impossible to know if a hidden volume exists (hidden volume data cannot be distinguished from the random data normally filling the free space of a standard encrypted volume), this option helps you in situations in which you may be forced to reveal your password. See also Plausible Deniability in the TrueCrypt documentation.



Once you issue the TrueCrypt command through a console or by typing Alt-F2, both the main window and a tray icon show up. Creating encrypted volumes is simple. Press the Create Volume button to start the TrueCrypt Volume Wizard, and choose the options presented in the different steps: simple or hidden volume, partition or file container, encryption algorithm type (AES is the default) and hash algorithm (RIPEMD-160 by default), password (for which more than 20 characters is recommended), eventual filesystem options, and format.

 

TrueCrypt for Linux can encrypt an entire hard disk partition (or entire disk) or a file-hosted volume. Such virtual volumes are stored as a standard file, belonging to any filesystem, but host an independent encrypted virtual disk device. 

 

To access existing volumes, choose one of the free "slots" in the main window (slots correspond to the available unit drive letters on Windows and predefined mounting points in Linux), select the file or partition containing your encrypted volume, and press the Mount button. You'll be prompted for the volume password; insert the standard or the hidden volume password depending on which volume you want to mount. If the volume password is correct, you'll be prompted for the root password.

Since version 4.3a, TrueCrypt no longer supports the set-euid root mode of execution and requires you to enter the administrator password through the sudo command. Although this is helpful from a security point of view, it makes using TrueCrypt on a multiuser workstation difficult. By editing the sudoers file with visudo, you can allow users belonging to a specific group (let's call it, for example, "truecrypt") to execute TrueCrypt with administrative privileges but without knowing the root password. Just insert the following row:

%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt

 

 

This method works equally well with the older command-line version. Your mounted volume will then be available in the position /media/truecryptX, where X is the number of the slot you chose at the beginning, unless you specified an existing mount point in the Mount Options page.

 Although TrueCrypt 5.0 can open volumes encrypted through 64-bit block-encryption algorithms such as Blowfish, CAST-128, and Triple DES, it doesn't let you create new volumes with algorithms that are weaker than 128-bit block-encryption algorithms such as AES, Serpent, and Twofish.

 

The speed difference between accessing an on-the-fly encrypted volume and an unencrypted one is evident and particularly noticeable when copying large files on older computers. On an Athlon 1200 system the time required to complete a copy was almost doubled. Nonetheless, even on a so slow computer, you can still watch decrypted-on-the-fly, fullscreen, compressed videos without particular issues.

Once a volume is mounted, you can add it to your favorites. TrueCrypt keeps the volume position and mount point in a Favorites menu so that next time you'll need to provide only the correct password. In addition, you'll be able to mount, dismount, and open your favorite volumes in Konqueror simply through the tray icon's right-click menu.

 

If you create an encrypted partition or volume on a removable drive, you can access it from a different computer or different operating system (Windows, Mac OS X, and Linux). Of course, you need to be sure that the second operating system supports the filesystems used by the first. TrueCrypt also has a Traveler mode (available for Windows) to automatically start TrueCrypt or mount a specified TrueCrypt volume when the 'traveler disk' is inserted in Windows, without the need of installing the software.

 

You can still run TrueCrypt's command-line mode in version 5.0 through the -t switch, which needs to be specified as the first option. Unfortunately, the syntax has not been kept consistent with previous versions, and you need to answer more questions, such as what the eventual keyfile and hidden volume will be, before being able to mount your volume. Furthermore, when version 5.0 was first released, trying to use TrueCrypt in a pure console environment, even with the -t option, ended the program with the following error: "Error: Unable to initialize gtk, is DISPLAY set properly?" This was particularly annoying if you had no access to a graphical interface. Luckily, TrueCrypt Foundation corrected that problem one week later with the release of TrueCrypt 5.0a, which lets you use the console version of the utility properly.

 

The TrueCrypt Web site provides comprehensive documentation (which is almost entirely replicated in a PDF file included in every installation package), a FAQ page, and a forum with a dedicated Linux section. Solutions for distribution-specific issues usually can be found elsewhere on the Web.

TrueCrypt's new GUI proves more effective than the previous command-line version, because the tray icon speeds up the most frequent actions, especially if you automate TrueCrypt startup at login by adding a link into KDE Autostart folder (add the --background-task option to have it iconised by default).

 

Although TrueCrypt's license is open source but not GPL-compatible, version 5.0a is one of the simplest and safest cross-platform encryption utilities available.

Postfix and MS-Exchange Mail Server Affected by ORDB.org Spam Service

Since y’day I noticed one of our article related to ORDB.org spam blocker receiving lots of traffic. I received couple of calls from our clients because most emails was getting bounced via Exchange or Postfix mail server.

ORDB is now configured to return each IP as spam source

ORDB was a database of open relay email servers, provided until 2006 as a voluntary service to block spam. Now ORDB.org service has been re-activated and it is returning every IP address queried as being on its blacklist. I guess this was done to punish lazy sys admin / mail administrators ;)

If you or your mail server / gateway / firewall querying relays.ordb.org; please stop it immediately. If you query relays.ordb.org - mail server will rejecting all incoming mails from that server.

Symantec Mail Security for MS-Exchange Server - Spam Filter

Symantec Mail Security for Microsoft Exchange configuration in the list of Anti-spam blacklist servers including relays.ordb.org. Immediately remove the entry.

Remove ORDB.ORG from MS-Exchange Server Spam Filter

In Exchange Server 2003 you can find the feature for blacklist support within the global settings of your organization. Visit MS-Exchange System Manager > Global Settings > Message Delivery Properties -> Connection Filtering tab > Remove relays.ordb.org

Remove Linux / UNIX - Postfix Mail Server - Spam Filter

Open postfix configuration file and remove the following line:
reject_rbl_client relays.ordb.org,


Restart postfix mail server:
# service postfix restart


source:cybercitiz.biz

What are the differences between Windows and Linux?

Difference Between Linux and Windows

1) Linux is a open-source OS.People can change code and add programs which will help to use your computer better. It's designed as a reaction on the monopoly position of windows. you can't change any thing in windows. you can't even see which processes do what and build your onw extension. Linux wants the programmers to extend and redesign it's OS time after time, so it beats Windows or at least is as good as windows, but whit open-source, so you can see what happens and you can edit the OS

2) All the flavors of Windows come from Microsoft, the various distributions of Linux come from different companies (i.e LIndows , Lycoris, Red Hat, SuSe, Mandrake, Knopping, Slackware).

3) Linux is customizable in a way that Windows is not. For example,NASlite is a version of Linux that runs off a single floppy disk and converts an old computer into a file server. This ultra small edition of Linux is capable of networking, file sharing and being a web server.

4) For desktop or home use, Linux is very cheap or free, Windows is expensive. For server use, Linux is very cheap compared to Windows. Microsoft allows a single copy of Windows to be used on only one computer. Starting with Windows XP, they use software to enforce this rule (activation). In contrast, once you have purchased Linux, you can run it on any number of computers for no additional charge.

5) You have to log on to Linux with a userid and password. This is not true of Windows. Typically Windows 9x does not ask for a userid/password at boot time and, even if it does, this can be easily bypassed. In general, Windows NT, 2000 and XP do require a userid/password to log on. However Windows 2000 and XP can be configured with a default userid and password so they boot directly to the Windows desktop. Windows XP, 2000 and Linux all support different types of users. Windows XP Home Edition supports Administrator class users that have full and total access to the system and restricted users that, among other restrictions, can't install software. Windows XP Pro and Windows 2000 support additional levels of users and there are groups of system privileges that can be assigned to a particular user. In Linux, the user with full and total access is called root, everyone else is a normal user. The options for Linux security privileges don't seem to me to be as robust as in Windows 2000 and XP Pro, they are focused on files and directories (can you read, update and execute files). Linux has a concept of a group of users that Windows does not, but again the privileges associated with a group are all file/directory related.

6) Linux has a reputation for fewer bugs than Windows

7) Windows must boot from a primary partition. Linux can boot from either a primary partition or a logical partition inside an extended partition. Windows must boot from the first hard disk. Linux can boot from any hard disk in the computer.

8) Windows uses a hidden file for its swap file. Typically this file resides in the same partition as the OS (advanced users can opt to put the file in another partition). Linux uses a dedicated partition for its swap file (advanced users can opt to implement the swap file as a file in the same partition as the OS).

9) Windows uses FAT12, FAT16, FAT32 and/or NTFS with NTFS almost always being the best choice. Linux also has a number of its own native file systems. The default file systeAll the file systems use directories and subdirectories. Windows separates directories with a back slash, Linux uses a normal forward slash. Windows file names are not case sensitive. Linux file names are. For example "abc" and "aBC" are different files in Linux, whereas in Windows it would refer to the same file. Case sensitivity has been a problem for this very web page, the name of which is "Linux.vs.Windows.html". At times, people have tried to get to this page using "linux.vs.windows.html" (all lower case) which resulted in a Page Not Found error. Eventually, I created a new web page with the name in all lower case and this new page simply re-directs you to the real page, the one you are reading now (with a capital L and W). m for Linux used to be ext2, now it is typically ext3.

10) Windows and Linux use different concepts for their file hierarchy. Windows uses a volume-based file hierarchy, Linux uses a unified scheme. Windows uses letters of the alphabet to represent different devices and different hard disk partitions. Under Windows, you need to know what volume (C:, D:,...) a file resides on to select it, the file's physical location is part of it's name. In Linux all directories are attached to the root directory, which is identified by a forward-slash, "/". For example, below are some second-level directories: /bin/ ---- system binaries, user programs with normal user permissions /sbin --- executables that need root permission /data/ --- a user defined directory /dev/ ---- system device tree /etc/ ---- system configuration /home/ --- users' subdirectories /home/{username} akin to the Windows My Documents folder /tmp/ ---- system temporary files /usr/ ---- applications software /usr/bin - executables for programs with user permission /var/ ---- system variables /lib --- libraries needed for installed programs to run

11) Both support the concept of hidden files, which are files that, by default, are not shown to the user when listing files in a directory. Linux implements this with a filename that starts with a period. Windows tracks this as a file attribute in the file metadata (along with things like the last update date). In both OSs the user can over-ride the default behavior and force the system to list hidden files.

12) Windows started with BAT files (a combination of OS commands and optionally its own language) and then progressed to Windows Scripting Host (WSH) which supports two languages, JavaScript and VB Script. Linux, like all Unix variants, provides multiple scripting languages, referred to as shell scripts. In general, the Linux scripting languages are older and cruder than WSH but much more powerful than BAT files. They tend to use special characters instead of English commands and don't support objects (this only matters to programmers). One scripting language that can run on both Linux and Windows is PHP. It always has to be installed under Windows, it may have to be installed under Linux. PHP is typically found running on Linux based web servers in combination with Apache, but it is capable of running "client side" (on your computer).

13) Every computer printer ships with drivers for last last few versions of Windows (at the time it was manufactured). Running the printer on a very old or too new version of Windows may or may not work. Still, this a far better situation than with Linux which does not support as many printers as Windows. In an environment with many Linux users, shared network printers a tech support staff, this should not be an issue as you can limit yourself to well supported printers. Home users of Linux however, will no doubt suffer from the relatively poor support for printers.

14) Windows allows programs to store user information (files and settings) anywhere. This makes it impossibly hard to backup user data files and settings and to switch to a new computer. In contrast, Linux stores all user data in the home directory making it much easier to migrate from an old computer to a new one. If home directories are segregated in their own partition, you can even upgrade from one version of Linux to another without having to migrate user data and settings

Wednesday, March 26, 2008

10 Linux Commands You Probably Don’t Use

The following Linux command line tips are not typically used by your everyday Linux user.

Quickly Find a PID with pgrep

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.

pgrep ssh

This will list all PIDs associated with the ssh process.

Execute The Last Executed Command

The heading sounds a bit confusing but it’s exactly what it does.

!!

This will execute the last command you used on the command line.

Execute The Last Command Starting With..

If you want to execute a command a command from history starting with the letter S you can use the following:

!s

This will execute the last command used on the command line that started with s.

Run a Command Repeatedly and Display the Output

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds. watch is very similar to tail.

watch -d ls -l

This will watch the current directory for any file changes and highlight the change when it occurs.

Save Quickly in VI/VIM

If you’re in a hurry, you can save and quit the file you’re editing in vi by exiting insert mode, holding shift, and hitting z twice.

Quickly Log Out of a Terminal

You can quickly log out of a terminal session by using: CTRL+D

Navigate to the Last Directory You Were In

cd - will take you to the last directory you were in.

Make Parent Directories the Smart Way

mkdir -p /home/adam/make/all/of/these/directories/ will create all directories as needed even if they do not exist. Why waste time doing something silly like: mkdir make ; cd make ; mkdir all ; cd all ; mkdir of ; cd of … you get the point. Use mkdir -p!

Delete the Entire Line

If you’ve just typed a long string of commands that you don’t need to enter anymore, delete the entire line by using: CTRL+U.

Set the Time stamp of a File

touch -c -t 0801010800 filename.c will show the time stamp as 2008-01-01 8:00. The format is (YYMMDDhhmm).

How To Change PostgreSQL Root Password

Here is how to change the PostgreSQL root password from the Linux command line. Replace “root” with any user name to change any password. It is important to note that PostgreSQL does not have an actual “root” user name. The “postgres” user is the super-user for PostgreSQL.

# su postgres
# psql -d template1
template1=# ALTER USER postgres WITH PASSWORD '${POSTGRESQL_POSTGRES_PASSWORD}';

You can replace “postgres” with any user name.

Find out what ports are open on Linux

Heres a quick tip on how to find out what ports are open on your Linux computer without using a port scanner.

# netstat -anp --tcp --udp | grep LISTEN

Cheers!

How To Change MySQL Root Password

Here is how to change the mysql root password from the Linux command line. Replace “root” with any user name to change any password.

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpasswd'
# /etc/init.d/mysql start

Cheers!

Tuesday, March 25, 2008

Display Desired Folders In Windows Vista Start Menu.

On the RHS part of the Windows Vista Start Menu, you have the option of displaying User, Documents, Games, Music & Pictures Folders. While the first 3 are commonly use, most find little use for the last two folders; and would instead like to replace them with their oft accessed folders like Downloads or any other.
Well, in Vista too, you can replace the Music & Pictures Folders with the folders of your choice.

To do so, first, disable showing of, of the Pictures Folder & Music Folder, through Properties > Start Menu > Customize > Don't display this item/s.

Next download the two vbs scripts mentioned on WinVistaClub.

Click on the script and Run it.

Now, enter the path of the desired folder in the space provided. Click OK. Reboot.

Now click open the Start Menu > Rt Click > Properties > Start menu > Customize > Display this item/s > Apply > OK.

Your Vista Start Menu will display the desired folders for easy access !

how to configure Canon printer in Linux.

How to configure canon printer "ip 1800"in FC6. Install driver from this link:- http://rapidshare.com/files/81430066/cnijfilter-common-2.70-1.i386.rpm.html
nd after install 2nd main driver from this link:- http://rapidshare.com/files/81430976/cnijfilter-ip1800series-2.70-1.i386.rpm.html nd type in

Terminal:-
su -c 'system-config-printer'

Dial Up Connection Blues? MAKE UR DIAL UP GO ZOOMMMM!

MAKE UR DIAL UP RUN AT HIGH SPEED . Well most of us dial-up users have been plagued by the slow connection, connection drops etc.use this trick to enhance ur connection speed.


WARNING: FOLLOWING THIS TUT MAY DESTROY YOUR MODEM! 

So this Tut will be about making your dial-up a little tiny bit faster, which is considered, "High Speed" .




The ten easy steps :

1. Go to your start menu

2. Open your control panel

3. Open phone and modem options (XP users will have to click switch to classic view on the left hand side to see this option)

4. Select the Modems tab

5. Select your modem, and click properties

6. Click on the Advanced tab

7. Then you will see a box that says advanced settings. - And under it a TextBox that has "Extra initialization commands" in it.

8. In the TextBox put AXFX just how you see it in this text.

9. Click ok to close that box

10. Click ok again. NOTE: If AXFX does not work, try ATFX


I would also recommend u to use "NetScream" - a tool that optimizes your modem connection.Your internet connection can be optimized up to 200% or higher by using NetScream. NetScream also makes your dial-up connection more stable and less resistant to hang-up’s & disconnects. This means you can download and surf the internet faster then ever before. NetScream works on many 14.4/28.8/33.6/56 kb, cable and dsl modems. No installation or modification needs to be made to your hardware; NetScream does all the complicated settings for you instantly.

How to exceed your download limit on Rapidshare/Others

NOTE: complicated, and yes there are proxy sites to get around rapidshare, however there are none currently that'll get around rapidshare.com:

Okay, here is a quick tutorial on how to get around those annoying "Wait X minutes before downloading" messages, as well as the one-file-at-a-time limits that are frequent on Rapidshare and similar sites. This tutorial uses Opera (because it has the best download manager), but can probably be adapted for any browser

Step 1. Since this will slow down each download quite a bit, pick 4 or 5 Rapidshares that you've always wanted. This will give you the most speed boost.

Step 2. Start the biggest one as you normally would, by clicking the "Free" button.

Step 3. Go to
http://www.samair.ru/proxy/

and pick a proxy. configure your browser to use it. (In Opera, Tools/Preferences, Advanced tab, Network on the right, then click the Proxy Servers button.Before the colon is the IP, after is the port.

Step 4: Finally, test it for speed. If the proxy seems pretty fast, start the next download, and repeat Step 3&4 until you have all your files downloading. If it seems too slow, repeat step 3 until you find a fast one.That's all! Most of you will already know about this, but it's cool anyways.

save video using firefox

Wait for the flash video loading completely. Then open a new tab / window of Firefox and enter about:cache as an URL.
U must take note of the Firefox cache folder path specified in Cache Directory: and browse to this folder with Windows Explorer.

be aware that if the Storage In Use greater than or approaching Maximum Storage Size,
the video might not be cached completely or you’ll have to increase Maximum Storage Size.

So to set fire fox cache folder maximum storage size, click Tools - Option- Network- Cache.

its simple. there is also many firefox plugins available to save flash video.

How To Make Your Own Radio Station

Must HAVE Winamp (Any Version)
First, things First your speed has to be at least 256/64 kbps (which means Dial-up users, will have alot of latency, just dnt bother)
Second, your going to have to have a domain, an updated one with the current i.p active. (Could be anything e.g. My sig)
Now, Your gonna have to download the Shoutcast Files.
Go to www.shoutcast.com to get the files.

Ok After downloading these, installing Both of them in any order i dnt care. Go to START>PROGRAM FILES>SHOUTcast DNAS>EDIT SHOUTCAST DNS CONFIG.

Ok your gonna have to Configure it:
Go Down and where it says password: change (that means your gonna have to change it to whatever, make sure u remember)
The Portbase: change it to whatever port you want it Maxusers: (lets be realistic here, dnt put in 10000, like NXS's radio station) your bandwidth has to be extremely good, if your cable, 50 user max is ok, ADSL should stay below 10 users, and T1 connections should do whatever tickles there fantasy.

Open winamp, RIGHT CLICK>OPTIONS>PREFRENCES>DSP EFFECT> and choose the NULLSOFT SHOUTCAST.

Go to OUTPUT, and then click on Connection, Through the ADDRESS, type your address which you have done through www.no-ip.com, PORT NUMBER, whatever u did in the EDIT.txt, and your password.

Then go to Encoder, and choose your quality of your music. Go back to OUTPU>OUTPUT CONFIG> YELLOW PAGES. this is your advertisemant information. dow hatever you like there.

Now Connect. to check that your Radio os on-line go to http://(your address that you added in the prefrence)

enjoy!

Define-the-Slow-Link-Time-Out

Windows uses this value to define what should be classified as low speed and what is a high speed connection. The default time-out is 2000 milliseconds, any connection slower is considered a low speed link.


Open your registry and find or create the key below.

Create a new DWORD value, or modify the existing value, called "SlowLinkTimeOut" and set it according to the value data below.

Exit your registry; you may need to restart or log out of Windows for the change to take effect.


Registry Settings

System Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

Value Name: SlowLinkTimeOut

Data Type: REG_DWORD (DWORD Value)

Value Data: Time (milliseconds)

Display Network Error Statistics

This tweak allows you display error statistics on the Network Connection Status page for LAN and WAN connections. This information may be useful in diagnosing the network reliability.

Open your registry and find or create the key below.
Create a new DWORD value, or modify the existing value, called "ShowLanErrors" and set it according to the value data below.
Exit your registry; you may need to restart or log out of Windows for the change to take effect.

Registry Settings
System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\Connections\StatMon]Value Name: ShowLanErrors
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = enable error count)

Stop the system automatically rebooting after Windows Updates

NoNormally Windows Update will automatically reboot the system when you have your system configured to "Automatically download recommended updates for my computer and install them" and one or more of those updates requires a reboot. This settings changes the behavior so when users are logged in the system will not automatically reboot.

Open your registry and find or create the key below.
Create a new DWORD value, or modify the existing value, called "NoAutoRebootWithLoggedOnUsers" and set it according to the value data below.
Exit your registry; you may need to restart or log out of Windows for the change to take effect.

Registry Settings
System Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]Value Name: NoAutoRebootWithLoggedOnUsers
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = no effect, 1 = do not automatically reboot)

Open Favorites in a new window

This tweak adds an additional right-click menu item to your Favorites entries which allows you to choose to open the Favorite in a new window.

Open your registry.
Follow the instructions in this tweak to cause Internet Explorer to not re-use windows when opening shortcuts.

Then find the key [HKEY_CLASSES_ROOT\InternetShortcut\shell] in your registry and create a new sub-key called "Open in a new window", under the new key create another new sub-key called "command" and set the (Default) value to 'rundll32.exe shdocvw.dll,OpenURL %1'.

The change should take effect immediately.
Right-click on a Favorite and you should see an option called "Open in a new window".

Registry Settings
System Key: [HKEY_CLASSES_ROOT\InternetShortcut\shell\Open in a new window\command]
Value Name: (Default)
Data Type: REG_SZ (String Value)
Value Data: rundll32.exe shdocvw.dll,OpenURL %1

Way to increase speed with Samba

Try
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
Speed increase of 10x for me, YMMV.

How to put a secure layer between a FTP-daemon and the network?

ssh + ftp passive mode :Use ssh's port forwarding, combined with ftp's passive mode. man ssh.

sftp? :Last time I installed ssh2, I think it came with a client/server package calledsftp. Or maybe someone dropped crack in my mountain dew. You should be able totunnel it through ssh if not.
ftp://ftp.psy.uq.oz.au/pub/Crypto/SSLapps/ :
try here for various ssl based apps
ftp://ftp.psy.uq.oz.au/pub/Crypto/SSLapps/

Secure FTP: A few ways :As a previous poster suggested, use ssh with port forwarding. You might want to seethe SSH FAQ:
http://www.uni-karlsruhe.de/~ig25/ssh-faq/

As it points out, this will leave the data connection open to sniffing/hijacking.If you only care about the integrity of the files you transfer, then verifyingagainst (securely obtained) md5 checksums should do the trick. If you want toencrypt the datastream, you'll need to be a bit more fancy.

If it's possible, consider the use of 'scp' instead of ftp; you'll get protectionof both control and data, since it's built into ssh.

Another option (if you control the clients as well) is to use ssh2's "sftp" client.Beware the licensing issues with ssh2, however.If you really trust the clients, it's also quite easy to set up a VPN between theclient and server, and then FTP directly. The ways to go about this depend on theOS you're using, so I'll leave it as an exercise to the reader.

secure FTP :
You can use SSH to encrypt the control connection (i.e. secure your passwords), butit is a pain to also encrypt the data.If you want everything to be safely encrypted, your choices are:(1) Use scp (part of ssh) to do the transfers. Works like rcp, can also copy overwhole directories recursively.There are also free versions of scp out there for win and mac.(2) Use a SSL-ified FTP server and program. (check www.ssleay.org for a link).Problem: I don't know of any SSL FTP programs out there for win or mac

IPsec as an option :
If they are both Linux, then look at:
http://www.flora.org/freeswan/
Not only will your FTP be encrypted, but so willyour Telnet, HTTP, and even your pings. The goodthing about this would be that you don't need anyspecial client or server applications.

Isn't this what SSL is for ?
:Look in
ftp://ftp.uni-mainz.de:/pub/internet/security/ssl/SSLapps/ for some SSL-awaretelnet/ftp clients and servers.
Kerberized FTP :
I'm pretty sure that MIT's athena distribution provides a modified version of FTPwhich has kerberos support. This allows for secure authentication, but I'm not sureif the anything else is encrypted. If authentication is all that you need to besecure you might want to check it out. Kerberos can be a pain to get working, butonce it is working it's really nice (i.e., you enter a password once and all yourkerberos enabled programs never bug you for a password).Ssh port forwarding would probably also work, but everybody else has alreadysuggested that so I figured I'd throw out a different option.

GSSFTP :If you download MIT Kerberos 5
( http://web.mit.edu/kerberos/www/ ),
it includes GSSFTP which is a Kerberized FTPservice. Unless you have a Kerberos infrastructure at your location, however, thismay be an excessively complicated solution for you.

sendfile (for something completely different) :
If security is a big concern, and your ftp site is really only for a select groupof people, you may wish to consider the sendfile suite of utilities based on theSAFT (?) protocol. Basically, it's akin to email or instant messaging systems butwith files and with decent security involved (you can filter out spurious sendersof files, no passwords need pass over the 'net).Something to give a shot for those of you wanting to give your friend, who's toolazy/paranoid/poor to set up an ftp server, a file.

SSL/TLS FTP :
You can use an industry standard encryption and authentication protocol with FTPsupported by various clients.First, go to http://www.openssl.org/ . OpenSSL is based on SSLeay and is the basisfor open source SSL communications in unix. You'll want to grab openssl and compileit and install it. It provides a number of useful programs including md5 & sha forgenerating checksums on files and a whole suite of other cipher routines.Next visit http://www.psy.uq.oz.au/~ftp/Crypto/ and go find an FTP server andclient pair which have SSL support. There are also a few general proxy deals whichcan handle it with any standard FTP server.Now there are a few ways to do authentication, you can do normal authentication orauthentication based on certificate which requires a CA server (things likeverisign will work if you want to shell out some cash, but you can also build yourown CA).The great thing about SSL is it can autodetect encryption support. So you can takea standard telnet server, make a few minor modifications to get it SSL capable andconnect to it using SSL capable telnet client or a vanilla telnet client and it'lluse the strongest security possible.No need for silly third party daemons or special ports. Although the official TLSservice ports are different from their unencrypted couterparts.This is good if you are behind a corporate lan which doesn't like allowing anythingbesides telnet, ftp, and web traffic through their proxy.

CIPE - Crypto IP Encapsulation :
CIPE - encrypted IP over UDP tunneling"This is an ongoing project to build encrypting IP routers. The protocol used is aslightweight as possible. It is designed for passing encrypted packets betweenprearranged routers in the form of UDP packets. This is not as flexible as IPSECbut it is enough for the original intended purpose: securely connecting subnetsover an insecure transit network. The implementations mentioned below are actuallyin use in such an application."The newest version of CIPE is available onhttp://sites.inka.de/~bigred/devel/cipe.htmlor ftp://sites.inka.de/sites/bigred/devel/cipe.html
It also works well for getting around those pesky universtity firewalls.

Secure FTP ? :Have a look at:
SSL tunnel:
http://mike.daewoo.com.pl/computer/stunnel/.

How to verify .rpm files vs. installation : addition

Really simple. rpm -V should be run as root for the most accurate reports.
Specifically, users cannot verify the checksums of files they cannot read.
So if you do 'rpm -Va' as a normal user it'll look like many SUID root binaries have
been changed. They probably haven't, you just don't have read perms; rpm can't
calculate the checksum and warns you because it can't vouch for the checksum.

Monday, March 24, 2008

Give ur USB a background

Copy this code to ur text editor,then save it as "desktop.ini"
[.ShellClassInfo]
IconFile=%SystemRoot%\system32\SHELL32.dll
IconIndex=127
ConfirmFileOp=0


[{BE098140-A513-11D0-A3A4-00C04FD706EC}]
Attributes=1
IconArea_Image="your_picture.jpg"
IconArea_Text="0xFFFFFF"
VeBRA sources - don't delete the tag above, it's there for XXXXX purposes - [ExtShellFolderViews] {BE098140-A513-11D0-A3A4-00C04FD706EC}={BE098140-A513-11D0-A3A4-00C04FD706EC} {5984FFE0-28D4-11CF-AE66-08002B2E1262}={5984FFE0-28D4-11CF-AE66-08002B2E1262} [{5984FFE0-28D4-11CF-AE66-08002B2E1262}]
PersistMoniker=Folder.htt
PersistMonikerPreview=%WebDir%\folder.bmp

2.Put "desktop.ini and your_picture.jpg in ur USB Drive then Hidden it.

3.Refresh .and enjoy with new background.

source
digit mag