Breaking Unix Root Password

September 30, 2007 at 8:23 am (Operating Systems, Security, Tips n Tricks)

Well if you come to the real sense, this is not exactly called as hacking. The trick is just removing root password without administrator login.

This is a way to clear the root password when you don’t have access to the vi editor.


Flavors: AT&T, BSD

If no one has access to the root password on a system and it is a matter of urgency to get into that system, you can boot miniroot and clear the password out of the root account. This can be done even when the vi editor is inaccessible. To do this on a system using the /etc/shadow file, use the ed editor with 13 dots and your problems are solved:

# cp /etc/shadow /etc/shadow.bak

# ed /etc/shadow

Line 1: While in the ed editor, go to the first line of the file.

Line 2: Switch the first occurrence of a field that has 13 characters with nothing. This is the password field.

Line 3: Write out the file.

Line 4: Quit.

You’re finished! You swapped out the 13 characters of root’s password field with nothing and cleared the password. You can now bring the system to single user and change the root password. The same basic commands can be used on the /etc/passwd file for those platforms that don’t support shadow passwords. The result is the same. 😀


Permalink Leave a Comment

Remove the —- Dashes —- (Unix)

September 29, 2007 at 4:35 pm (Operating Systems, Tips n Tricks)

A method of removing files that begin with dashes “-“.

There will be times when you stumble on a file at the top of the directory that contains dashes. Many users sometimes “fat finger” the keys and accidentally create a file with dashes.

-rwxrwxrwx  4 root          512 Aug 24 21:01 -F
-rwxrwxrwx  4 root          512 Aug 24 21:01 ---wow
drwxrwxrwx  4 root          512 Aug 24 21:01 .
drwxr-xr-x 19 root         7680 Jul  2 10:41 ..

If you attempt to remove them through normal methods, UNIX will attempt to use them as command-line options and the command will break out with an error:

# rm -F
Illegal option – F
Usage: rm [-fir] file…

# rm ---wow
Illegal option -- -
Illegal option -- -
Illegal option -- w
Illegal option -- o
Illegal option -- w
Usage: rm [-fir] file…

So how do you get rid of these files? There are a few ways to perform this task. The files can be removed by a file manager, by hiding the dashes, by fighting a dash with a dash, or by deleting the directory.

Example One: Using File Manager

Flavors: Those with a GUI-based file manager.

Most GUI-based UNIX interfaces today are packaged with a file manager. The theory behind this interface is to simplify the life of a system administrator. Again, I said in theory—this isn’t always the case.

File manager programs are pretty intelligent. They recognize file types and remove this misnamed file without any problems. If you feel that critical files are in danger from removing this file manually then use the file manager to remove the file.

Example Two: Hiding in the Directory

Flavors: AT&T and BSD


rm "./file"

This example uses a method of hiding the dash from the rm command.

$ rm ./-F
$ rm "./---wow"

By placing the ./ (dot, slash) in front of the filename, you hide the option and treat it as part of the file. The lines remove the file (not the option) from the current directory. Whenever in doubt, quotation marks (" ") help define the file and should be used.

Example Three: Fighting a Dash with a Dash

Flavors: AT&T and BSD


rm –- file

In this method you fight a dash with a dash.

$ rm -- -F
$ rm -- ---wow

The double dash before the file will treat it as a file and not as an option. It is similar to example two. It treats what UNIX thinks is an option as a file.

Example Four: Brute Force—rm -r

Flavors: AT&T and BSD


rm -r directory

This is the brute-force approach to solving this problem and should be used only as a last resort. If the file in question is in a nonsystem partition or directory, you may be safe to use this.

$ mv /usr/people/jdoe /usr/people/tmp/jdoe
$ rm -r /usr/people/jdoe
# mkdir /usr/people/jdoe
$ cp -pr /usr/people/jdoe/[A-Za-z]* /usr/people/jdoe

Line 1: Move all the contents of the directory, with the exception of the file in question, to another area.

Line 2: Go up one level and remove all the contents of that directory.

Line 3: Remake the directory.

Line 4: Copy the original data back.


You will destroy your system if you attempt to execute this procedure on a directory that the system uses, such as: /, /etc, /usr, /bin, /sbin.


The potential for deleting the wrong files exists for even the most experienced administrator. Use these methods and you shouldn’t have to rely on your backups to restore any unnecessarily deleted files. You will also not have to stay at work any later than you have to.

Real World Experience

There is nothing worse for an administrator than to be tested by your users. Every once in a while a user will attempt to play a practical joke and see whether you fall into the trap. Here is how it works.

While cruising around in systems and viewing the long listing of various directories with ls, I sometimes notice something very odd at the root level of the directory tree, a file called -r *.

-rw-------  1 root          147 Jan 19  1996 -r *
drwxr-xr-x 22 root         1024 Aug 21 21:16 .
drwxr-xr-x 22 root         1024 Aug 21 21:16 ..
-rw-------  1 root          147 Jan 19  1996 .Xauthority
-rw-r--r--  1 root          366 Sep 30  1994 .Xdefaults
-rw-r--r--  1 root          260 Jul 24  1997 .cshrc

Some admins get sucked into this prank and do a rm -r * and wipe out their system. Examples one and two will remove this file, but remember to put quotes around the entire file.

# echo "" > "-r *"

# rm ./"-r *"
# rm – "-r *"

Permalink 1 Comment

Ergonomic Keyboard

September 28, 2007 at 3:34 am (Hardware, New Technologies)

With all the keyboards out there that try so hard to figure out what’s ergonomic for you- and fall- It’s no surprise that someone finally had a brainwave and decided to let you decide what’s comfortable for you. Presenting the Ergodex DX1, a keyboard that comes with 25 keys that can be placed anywhere at any angle you like, in any sequence you like. If you find that you want to move a particular key, kust a tad to the left.. move it. The keys, numbered 1 to 25, have no wires, or any type of batteries.

You can record pre-defined macros per key, on the fly, and make your own macros. There are four basic types of macros to choose from: Single key, multi-key, text blocks and a file launcher. All this management is made easier by the Ergodex Manager software that’s bundled. If yu want to, you can replace your keyboard with this masterpiece, but it is recommended to use it for special tasks only! It costs 200$ for the total package, which is worth every paisa. 😀


Permalink Leave a Comment

RSA Crypto Challenge For Indians

September 27, 2007 at 3:27 am (General, Security)

If you are interested in security stuff, here is an interesting news for you. RSA India has launched a crypto challenge wherein we need to code an attack for given security mechanism. The algorithm to be cracked makes use of simple substitutions, permutations and hashes.

So try the code at

and see if you can make it. Exciting prizes like HP pavilion laptop, MS X-Box and T-shirts. 🙂

Permalink 1 Comment

Create Shortcuts For Shutdown and Rebooting

September 26, 2007 at 5:33 pm (Operating Systems, Tips n Tricks)

Shutting down and rebooting are a way long process. Here is a trick that can help you. Right click produces a option to create a shortcut. In the option of setting the link, type shutdown and finish the process. You get an icon to shutdown your PC. If you want to restart, type shutdown -r -t 01 -c “Rebooting your PC” This will reboot with prompting of message in quotes at that time. Here are more options for the same job.. 🙂


What it does


Shuts down the PC.


Logs off the current user.

-t nn

Indicates the duration of delay, in seconds, before performing the action.

-c messagetext

Displays a message in the System Shutdown window. A maximum of 127 characters can be used. The message must be enclosed in quotation marks.


Forces any running applications to shut down.


Reboots the PC.

Permalink Leave a Comment

Web And Database Port Listing

September 26, 2007 at 4:57 pm (General, languages)

If you are about to peep into web technology, here is something which will interest you. The whole of web architecture is divided on basis of ports. A particular port offers particular service. These ports can be standard or can be manually assigned for user defined services. Here is the port listing for some standard applications…




Oracle SQL*Net


Hyper Text Transfer Protocol (HTTP)


HTTP Proxy, Alternative HTTP Port, Cobalt Server Administration Port


Secure Socket Layer (SSL)


Microsoft SQL Server over NetBIOS


UnixWare/Netscape FastTrack Server




Oracle WebCache Listener


KaZaA File Sharing Server (HTTP-like protocol)


Lotus Domino (Notes)


Microsoft SQL Server 2000


Microsoft SQL Server over TCP/IP Redirector




Microsoft SQL Server 7


Compaq Insight Manager, Compaq Survey Utility


HTTP Proxy (Squid, NetCache, etc.)




Oracle WebCache Listener


Oracle WebCache Listener


Oracle WebCache Listener


Sybase 11.0 (jConnect)


Sybase 12.x




VNC HTTP Console Port #1


VNC HTTP Console Port #2


VNC HTTP Console Port #3


Gnutella (HTTP-like protocol)


Gnutella (HTTP-like protocol)


BEA WebLogic


BEA WebLogic


HTTP Proxy, Alternative HTTP Port, HP Web JetAdmin Version 6.0


BEA WebLogic


Apache Tomcat Administration Server (non-HTTP protocol)


HTTP Proxy, Alternative HTTP Port


HTTP Proxy, Alternative HTTP Port


Netscape Enterprise Server Administration Server

If you are interested in running your own service, you need to make an entry to the lookup table which is maintained at the server hosting the services. Generally RMI, RPC, Sockets Streaming, CORBA etc. kinds of applications find a great use of ports and their usage.

Permalink Leave a Comment

Make Network Browsing Faster

September 23, 2007 at 8:34 am (General, Tips n Tricks)

If you are on n network and are tired of waiting for ages for all the network shares to load, this is a tip you will love. There are four basic things you need to do in order to speed up network access:

1. Remove all shortcuts in My Network Places. These are automatically generated, and if a few of them aren’t shared anymore, Windows will keep searching for them anyway. So just select them all and delete them.

2. Stop windows from automatically generating these shortcuts to these shared folders. Otherwise you will just end up having to delete the shortcuts you open My Network Places. This is a registry hack, so make sure you backup your registry. First, go to Start > Run, type in “regedit” and press [Enter]. Navigate to HKEY_Current_User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\. Here, create two new DWORD values (if they don’t already exist) called “NoRecentDocsNetHood” and “UseDesktopIniCache“, and set them to “1“.

2. Have everyone on your network increase the send buffer for network data. Tell everyone who shares files or folder to go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\. Create a DWORD value called “SizRepBuf“, and assign its Hex value to “FFFF“.

4. Just stop using My Network Places for folders you access on a regular basis, and instead, map the drive by doing to Tools>Map Network Drive in Windows Explorer.

Permalink Leave a Comment

Disable Automatic Update For Better Performance

September 22, 2007 at 3:58 am (General, Tips n Tricks)

If you have NTFS, here’s a Registry hack for increasing its performance. Whenever you view a directory on an NTFS volume, the filesystem updates the date and timestamp to show the last time the directory was accessed. If you have a very large NTFS volume, this continual updating process can slow system performance. To disable automatic updating, run the Registry Editor and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Filesystem. Look for NtfsDisableLastAccessUpdate. If it’s not present, create it as a DWORD. Set the value to 1.

Permalink Leave a Comment

Converting Hard Drives To NTFS

September 22, 2007 at 3:56 am (Operating Systems, Tips n Tricks)

To use XP compression or encryption, you have to use NTFS. But if you instead have a previous filesystem, such as FAT32, you’re not left out you can convert it to NTFS. To convert a volume to NTFS, use XP’s convert utility. To convert a volume to NTFS, at a command prompt, type:

convert d: /fs:ntfs

where d: is the volume you want to convert.

You can also use a number of parameters along with the utility:

This runs the utility in verbose mode, which provides information about the volume being converted.

This sets the security privileges on the converted disk so that its files and folders can be used by anyone.
Use this parameter if you’re on a network and want to make sure another user cannot disrupt the conversion process by trying to access the drive while you’re converting it. This parameter dismounts the drive from the network.
So, enjoy better compression facilities with NTFS if you are working with windows XP…

Permalink 2 Comments

End Task In Windows XP Automatically

September 21, 2007 at 6:54 pm (Operating Systems, Tips n Tricks)

Windows waits too long before killing a non-responsive task?

To remedy this, you can start automatic handling of end tasks. Wherein, the tasks will be implicitly terminated on a certain interval


1. In the Registry Editor , go to HKEY_CURRENT_USER\Control\Panel\Desktop\, change the value of “AutoEndTasks” key to “1“.

2. Change the “WaitToKillAppTimeout” key’s value to the number you want. The default is 20000 ms. This is the interval as the name specifies. 🙂

Permalink Leave a Comment

Next page »