Friday, October 28, 2011

Setup transparent net access over insti proxies

If you are a student at an institute that forces you to cross a damn proxy server for accessing internet, you must be fed up of entering your username and password time and again in browsers, as well as configuring each new application you install, to use the proxy. And if an application doesn't have any proxy configuration option, then you can't use that application! For example you can't install the Android Development plugin for eclipse. This is very irritating. And, some campuses add to this torture further by using crappy NTLM authentication.
Here in IIT Madras exactly this condition prevails. But here I present a step by step walk through to get rid of this situation. Welcome to transparent proxying!

What is transparent proxy?
A transparent proxy(correctly called intercepting proxy) intercepts your requests and forwards to the destination without letting your applications know that there is a proxy between you and internet. This is done with some intervention from iptables in Linux. So what are the advantages? You need not configure each and every application with the proxy address, port, username and passwords. You can keep the setting "Direct connection to internet" in every application and every darn-so-ever app will work flawlessly!!!! Cool?? Eh?? Lets start.

Configure a transparent proxy on your notebook
I assume you are using a recent version of Ubuntu. Even older ones will do :) The steps should work for any Linux distro provided you use appropriate distro specific commands.

Before installing software you should have a working internet connection. You may setup proxy in /etc/apt/apt.conf for the time being to install required software for now. You need to put the proxy details in apt.conf as follows for https, https and ftp:

Acquire::http::Proxy "http://<username>:<password>@<proxy-address>:<port>


An example:

Acquire::http::Proxy "http://cs11m039:bleeeep@proxy.iitm.ac.in:3128";
Acquire::https::Proxy "https://cs11m039:bleeeep@proxy.iitm.ac.in:3128";
Acquire::ftp::Proxy "ftp://cs11m039:bleeeep@proxy.iitm.ac.in:3128";


If you are not from computer science background then I should tell you that, to edit /etc/apt/apt.conf you should open terminal then type sudo gedit /etc/apt/apt.conf

Step 1: 
If your campus doesn't require NTLM authentication then you can simply install and configure squid to setup transparent proxying. The details for that are beyond the scope of this post and I may cover that sometime later or you may search the net for other writers who might have posted the same.
IIT Madras campus network has NTLM. So I need to install cntlm. It works as a proxy and performs NTLM authentication on your behalf so you don't need to enter username and password everytime ypu lauch the browser. Type the following command and press enter:
sudo apt-get install cntlm 
Now edit /etc/cntlm.conf file and edit these lines to reflect your settings:

Username cs11m039
Domain iitm
Password password
If you have different proxies in institute and hostels then you can specify them all in these lines



Proxy 10.93.0.38:3128
Proxy 10.93.0.34:3128
Edit socks proxy details too

SOCKS5Proxy 3128
SOCKS5User cs11m039:password

Leave all other settings as default. Instead of cs11m039, put your username and instead of password put your password. Instead of domain as iitm put your institutes NTLM domain. For SOCKS5Proxy put the port number of proxy.

Now restart cntlm by typing:

sudo service cntlm restart

Now open any browser and set the http proxy as 127.0.0.1 and port 3128. Try opening google.com. If it works, means you got cntlm installed perfectly. Proceed to next step. Else, double check your configuration. Make sure cntlm got installed. Also make sure if your computer is even turned on!!!!! If all else fails, write a comment here and I may reply if I feel like.(:P)

Step 2:
Install tinyproxy.
sudo apt-get install tinyproxy

Open its configuration file

sudo gedit /etc/tinyproxy.conf 

Edit these lines:
Port 8888
Upstream 127.0.0.1:3128
Comment the line that says Allow 127.0.0.1 by adding a leading # symbol before Allow.
Don't touch any other line.

Step 3:
Open /etc/default/tinyproxy and put this inside and close the file:


case "$1" in
  start)
    iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 8888
    ;;
  stop)
    iptables -t nat -F OUTPUT
    ;;
  restart)
    start-stop-daemon --stop --quiet -t --exec $DAEMON > /dev/null || exit 0

    iptables -t nat -F OUTPUT
    iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 8888
    ;;
esac


Now restart tinyproxy by typing sudo service tinyproxy restart 
Disable proxy settings in the browser and try opening a website. If you followed all the above steps correctly then the website should open. Also, you may now safely truncate the /etc/apt/apt.conf file and it will work. All your apps like installing software in Eclipse will work too without any problems.

This is how your internet is working now:

Your application requests for internet access which is received by Linux kernel and due to the iptables rule setup above the request is redirected to port 8888 where tinyproxy is running. Tinyproxy intercepts the non-proxyified request and makes it http-proxy request compliant then forwards it to upstream proxy which is cntlm running on port 3128. Cntlm then performs NTLM authentication and contacts the insti proxy server to serve your request.

User application<==>Kernel(iptables)<==>tinyproxy intercepting proxy<==>cntlm authentication proxy<==>insti squid proxy<==>The internet

Happy browsing!

Update
On 3rd November, IIT Madras ditched the NTLM authentication and implemented rather insecure HTTP Basic authentication with OpenLDAP. Now you don't require cntlm if you want to setup transparent proxy.

In step 1 above don't install cntlm. Just install polipo by:
sudo apt-get install polipo

Then open its configuration file by:
sudo gedit /etc/polipo/config

And set these values:
parentProxy = "hproxy.iitm.ac.in:3128"
parentAuthCredentials = "username:password"

where username and password should be your username and your password for OpenLDAP.Also make sure to comment the lines that stand for SOCKS proxy.
Also set its listening port to 3128, so that tinyproxy doesn't need to be reconfigured. And don't forget to uninstall or disable cntlm(if it is installed) from startup because both polipo and cntlm will try to capture port 3128 for listening and you may face issues.




Thursday, September 29, 2011

My experience with CentOS 6

And finally I decided to switch to 64 bit computing! Motivated by my Parallel Computer Architecture course (in which I'm underperforming) I decided to install CentOS 6 X86_64 version. IIT gives enough internet speed in the campus (if only you know how to tap into :P) that I ended up downloading the two bin-DVD ISOs as well as LiveCD and LiveDVD ISOs totalling around 8GB in less than 2 hours from http://ftp.jaist.ac.jp/pub/Linux/CentOS/6.0/isos/x86_64/. Then I used the cool dd command to replicate the LiveDVD ISO onto my pen drive.

dd if=CentOS-6.0-x86_64-LiveDVD.iso of=/dev/sdb bs=1K

Don't forget to
umount /dev/sdb1
before issuing the above command.

So, after getting the bootable pen drive I restarted my notebook and pressed F12 to alter the boot order to select the pen drive instead of hard disk. The LiveDVD environment booted and I clicked on autologin letting it boot to GNOME by default. The interface was pretty fast. In fact much faster than Ubuntu because there is not much of eye candy at your disposal in CentOS by default. One irritation I had, was that I couldn't click by tapping the touchpad. I had to press the touchpad's left button to make the clicks. After some fiddling I found out in System>Preferences>Mouse in the Touchpad tab the option to Enable mouse clicks with touchpad. Then I enabled Desktop Effects and tested the Desktop on a cube of Compiz that pumps in zeal in linux fanboys and jeal in Windoze fans! Everything seemed to work perfectly, and I decided to go ahead and replace my Backtrack 5 installation with CentOS6. I launched the Install to hard drive installer and chose create a cutom layout in disk partitioning to specify my own partition to install and selected the Backtrack 5 partition and formatted it. After clicking the final install button, to my utter dismay the installer blurted something very nasty! The installation media is corrupt and installer can't proceed! Damn!!!!!!!!!!
I rebooted to find that my Backtrack 5 partition was wiped out. I booted into Ubuntu and used dd to replicate the bin-DVD1.iso image into my USB pen drive. After a wait of around 15 minutes my bin-DVD1 installer was ready. I rebooted and chose USB boot after F12 but this time it said: Operating system not found!!! Damn again!
After booting back to Ubuntu I replicated the LiveCD.iso into USB disk and re-booted into the LiveCD environment without any issues. I checked my system information and was proud to see 4GB of installed RAM! Both my 32-bit OSes viz. Windoze and Ubuntu 11.04 let me use only 3GB(approx.) RAM because of that damn memory mapping for I/O devices. Anyways I launched the installer and started following the wizard. During the bootloader setup screen I saw only Windoze was detected and named as Other. I added an entry for Ubuntu as well and edited the Other to read Windoze. I proceeded with the installer and after setting up all configs pressed the final install button. To my surprise, the install took less than 3 minutes!!!! Yes!! Thats right!
Then I rebooted and after a couple of formalities booted straight into lean and thin and clean upto the brim desktop environment of GNOME with very basic set of apps like GIMP, OpenOffice etc. Next thing I did was to install the multimedia codecs. I issued the following command
yum install gstreamer-plugins-base gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-ffmpeg
For a user switching from Ubuntu it was nice to see that the package names are consistent across distros. Anyways I noticed that the gstreamer plugins from the base set and good set were already installed and yum started downloding the rest of them.
Then I installed vlc media player by
yum install vlc
When I tried typing gcc and g++ on the terminal I got command not found. Same happened for java but python was installed and worked. They don't provide everything in the CD due to space constraint. So I went ahead to install these myself. yum install g++ didn't work.
After some fiddling I noticed that I could hear sound when I plugged in the earphones but after plugging them out I couldn't hear any sound through speakers. Exactly same problem I faced in last october with Ubuntu and had posted at http://www.techbite.in/2010/10/realtek-alc888-sound-issues-in-ubuntu.html but I couldn't use the same solution for CentOS because there was no /etc/modprobe.d/alsa-base.conf in CentOS. I tried the locate command but in vain. If you know how to solve this issue please comment here.
Next I updated /etc/fstab and entered the entries for auto mounting of my Windoze partitions and Ubuntu partition. But before that I had to installl ntfs-3g because that would let my CentOS access NTFS partitions.
Anyways I went ahead with my installation streak and downloaded flash plugin 11 rc from Adobe's site for 64 bit architecture and extracted it and copied the libflahplayer.so to ~/.mozilla/plugins directory and my firefox started to show YouTube videos after a restart. My installation streak is still going on and the apps waiting in the queue for installation are:
compiz
w3m
aria2c
chrome
opera
nmap
g++
lftp
openssh
ettercap
apache
php
mysql
audacious
skype
gnuplot
vidalia

After the installation of these I'll have a relaxed sleep because I have a 4 day holiday!! That will be enough for me to spend nice time with CentOS6.

Update(Sep29 9:30AM IST):
I added these two lines to /etc/modprobe.d/dist-alsa.conf to got the sound from speakers working after a restart.
alias snd-card-0 snd-hda-intel
options snd-hda-intel model=auto
Other issues I faced so far are
1. Upon trying to install byobu-3.21-1.el6.noarch.rpm it says it needs python 2.6. But I already have python 2.6.5 installed
2. To run the ADT plugin for eclipse I require 32 bit libs support. Can't figure out how to do that. In Ubuntu 64 bit, one just have to install ia32-libs using apt-get.
3. Can't install audacious through yum. It says audacious-plugins package not found.
4. Installed compiz but can't find ccsm
5. Can't find aria2 through yum. I guess I've to hunt for a manual download of rpm instead.

Update(Oct 1 07:30PM IST)
I downloaded JDK 7 from here http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html and installed it. It worked perfectly. But after that I used yum to install Eclipse IDE which in turn installed OpenJDK and made it the default java. I hate OpenJDK and want only Sun JAVA. I tried:
update-alternatives --config java
But Sun Java wasn't listed there. There were two javas listed there. One was Open JDK 1.6 and other was gcj 1.5. I played some hide n seek and found out that Sun Java was installed in /usr/java/ and there were three directories there named jdk1.7.0, latest and default. Then after some fiddling with the man page of update-alternatives command I issued these three commands:

update-alternatives --install "/usr/bin/java" "java" "/usr/java/default/bin/java" 3
update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/default/bin/javac" 3
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/default/bin/javaws" 3

And then running this:
update-alternatives --config java
showed me Sun Java as the third option. Then I set it as the default java and my problem was solved.

To get started with server administration in CentOS if you have some basic Linux background, you should read the CentOS Server Administration Cookbook.

Thursday, August 11, 2011

M.Tech CS - Admissions through GATE - Analysis 2011

Intro
This blog post has content specific to those:

  • who belong to CS
  • who are under 460 rank in GATE
  • who are in General category
If you don't belong to the category described above, you may still read on because you may find some interesting information in this post.

If you are just preparing for GATE, you should solve more and more questions. And for that I would recommend GKP Publisher's Question Bank. Although there are some mistakes in the book for solutions to some problems, but I recommend this book solely for the huge collection of problems it has.

GATE CS has become very competitive and the competition is increasing every year at an alarming rate. In GATE 2009 only 41000 candidates appeared in CS. The number increased to 107086 in 2010, mostly contributed by recession and lack of job opportunities in IT sector. In 2011 amazingly the number of candidates rose to 136291(last rank was 136027 but exact number of candidates who appeared in the exam was 136291) although recession had retreated and jobs were available in plenty. This shows the increasing interest of Indian youth towards masters degree.

GATE - Who takes it? Why?

Now lets know who are the people who opt to pursue M.Tech and why?

Broadly, there are three kinds of people who want to pursue M.Tech from IITs. The first kind is like me, who want better placement opportunities in reputed companies like Microsoft, Google, Cisco, Directi, Intel, Facebook, Yahoo! , Adobe etc. which are unavailable to most students who haven't done B.Tech from NITs or some other better colleges other than IITs. It is considered that these companies not only give you a well paid and reputed job that doesn't insult your talent but also give a great life and corporate culture. After doing B.Tech from private engineering colleges most of the students are absorbed by TCS, Wipro, Infosys and a couple of other mass recruiters. Once you land in these companies and get under some nasty manager you will realize that a labour working hard carrying bricks in the sun has a better life than you. Sometimes in these companies, you'll feel that the people above you are no match for your talent and still they are making more money(being there for more time than you) than you and also load you with stuff to do in a day that would require at least a week! This high profile bureaucracy prevailing in these companies and the plight of newly entered Software Engineers can't be felt by those who have never been victims of this, and can't be expressed by those who are already facing this thanks to their lack of time. Also you are trained like dogs and put to any job profile according to their wish. The field you are put into may be the one you hated most during your B.Tech, for example Testing. So, for these students M.Tech from IITs apparently, is the only saviour.
The second category of students is the one who want to pursue M.Tech then after making pretty sum of money and enjoying vibrant lifestyle, want to pursue Ph.D and then enter the academic field with cravings for being professors in top institutions.
The third category consists of the people who are dedicated to research only. They want to do researches through out their life, put forward some remarkable new findings, get them popular enough to find place in some textbooks. So our next generations when don't understand their algorithms/formula/theorems abuse them saying who on earth on what unlucky day gave this freaking theorem I can't mug up to vomit in my exam!!!!
There is another narrow overlapping category consisting of people who missed IIT-JEE by a few marks, and now want to fulfill their dream of being an IITian, through the GATE way!

The top institutes analyzed

I would focus on the eight best institutes according to the candidate's choices. All the IITs are the best and saying that one is better than other would be like writing an algorithm to sort an array of equal elements!!!! All of them are the best. But here I would like to rank them according to the students' tastes. The taste of students is driven by the specializations they want to pursue and the no. of professors in that specialization in particular IIT, lifestyle at the institute, placements and a couple of other aspects like regional inclination for example most north Indian people prefer IIT Delhi over Madras and south Indians do the other way round.


 IISc
Indian Institute of Science, Bangalore is the undisputed champion when it comes to research. It ranks first in India in terms of research output. Getting into it is equally tough. There are two flagship programs for Computer Science graduates. The ME in Computer Science program is open only for direct admission. If you have an All India Rank of under 45 in GATE then you may expect a direct admission call in this program. Another program called ME in Systems Science and Automation requires you to pass their own written test and interview. The candidates are shortlisted based on GATE scores and called for written test and interview. I am not sure upto how much rank they call for this program.
The third program for CS graduates is M.Sc Eng. For this program too you should have a good GATE score. But generally upto around 1000 rank people are called for written test and interview. IISc is highly mathematics inclined. If maths is not your cup of tea then it is almost impossible to get into SSA or M.Sc Eng. even though you have a very very high GATE score. The interviews and written are generally maths oriented.
Research wise IISc is the best. But placements in IISc are not considered to be as great as compared to top IITs like Bombay, Madras and Delhi. Although no one remains unplaced after going through IISc for 2 years rigorously but not all companies that visit IITs are aware of IISc. Moreover in IITs the placements are managed professionally and each IIT has a separate placement cell whose sole purpose is to get companies. But in IISc, professors do it in their spare time.
If you want to apply for IISc then do it early because last date for application submission is generally 2 or 3 days after declaration of GATE result(15 March) i.e. 17 or 18th March.

IIT Bombay
IIT Bombay's flagship program for CS graduates is M.Tech in Computer Science(TA). This program accepts only direct admits. In 2011 last GATE rank offered admission in 4th list in general category is 104. In 2010 it was above 125. GATE score cutoff is 868 for general category in 4th list in 2011. IIT Bombay is the most popular choice for toppers who get under 100 rank. Backed by highly paid placement offers, the vibrant lifestyle of Mumbai and a very large Computer Science faculty group, IIT-B houses top performers of GATE.
Here is the admission summary of 2011.
So, if you are under hundred rank in GATE you can be sure to get admitted there.
There is also an RA program which is of 3 years where you are assigned on some project and you have to serve for 20 hours a week instead of 8 hours in TA. In return you get Rs.1000 extra as stipend.
The admission offer lists of IIT Bombay are declared first, among all IITs.
In IIT-B there are other interdisciplinary programs like Geoinformatics where you can get in even if you are not in top 100. There you may take CS branch electives and get placed in software development field. But I wont get into details for these workarounds to get inside IIT Bombay. I'll talk only about programs of excellence in top institutes.
IIT Bombay is best choice if you are just course and placement oriented and not much of research oriented.

IIT Kanpur
IIT Kanpur is 2nd best choice for research oriented people. It is considered that, after IISc the name of IIT-K is taken for research.
IIT-K has 38 seats for general(as of 2011). They first declare a direct admit list. You can make into this list if you are under 70 rank in GATE. But generally around 5-6 highly motivated students take direct admission here. Rest join IIT-B. To fill the rest seats IIT-K conducts a written test and interview. They called upto 460 rank(in 2011) for written. The written comprised of aptitude questions which has very high percentage of application of probability distributions. If you are not good at probability distributions you may not get through the written test. 93 people( from all categories) were selected in written test. I was also one of them(luckily). Then you have to get through an interview. If you have high marks in written test then interview is pretty formal. But if you have lower marks then it is tougher and even if you answer their 50% questions and show good approach in trying to solve the problem you will get through the interview. I couldn't get through the interview. I had a very low score in written(just above the cutoff) because I am very bad at probability distributions. They asked me just 2 questions and they were sure that I am not worth IIT-K :P
I am also not that research oriented and so I knew IIT-K M.Tech isn't my cup of tea.
I met a senior and he advised me to join IIT-D or M instead of IIT-K if placements is my only aim. He also threw some light on doing M.Tech from IIT-K. According to him, it is quite tough in academics and building good CGPA is a very difficult task here. Also, if the professors are not satisfied with your thesis work, then your M.Tech may get extended for 6 months at a time. It is like a mini Ph.D.
So, join IIT-K if you are highly motivated towards research and dare to take on.

IIT-D
IIT Delhi is a great institute for placement oriented students. Being in the national capital surrounded by IT hubs of north India i.e. Noida and Gurgaon results in great placements. IIT Delhi has 4 programmes for CS students. MCS is the flagship programme which is M.Tech in Computer Science. JCA is an interdisciplinary programme run by maths department along with CS department which is Computer Applications. Computer Technology(EET) programme is another interdisciplinary course run by EE and CS departments. Placements are great in all these programmes. VDTT i.e. VLSI Design: Tools and Technology is also a great programme for people with inclination towards electronics. It has very high paying placement offers. Apart from this there is also MS but it has a very few seats.
The admission to all these courses is through an interview. There is no written test. You are shortlisted through GATE score and have to crack an interview to get into these. VDTT course also involves an interview with your sponsoring company which will pay all your fees and other expenses during your M.Tech and you may even get PPO(pre placement offer) if you perform well.
In 2011 cut off for MCS and MS have been GATE score 760. For other courses it was lesser. In JCA 750 was the cutoff for interview and 850 and 75% or 8.5 GPA would get you a direct admit in JCA. For VDTT the cut off for CS was 700. For EET too the criteria was similar to JCA. All courses have great placements but preference wise you should opt for MCS>JCA>EET. And if you want to do something in VLSI field then VDTT is a great option.
IIT Delhi has world class faculty for Algorithms. Prof. Naveen Garg is renowned in this field. Moreover Computer Networks, Computer Vision and Graphics are great here with very good professors. If you are interested in Databases then IIT Delhi is not for you because no good professors for databases are there.
Those who want to know about JCA may read this blog post written by an alumni of M.Tech CS at IIT Delhi who is currently working for Amazon:

http://mtech-admission-iits.blogspot.com/2011/01/jca-computer-applications-at-iit-delhi.html 

Or this blog post by a current student of JCA

http://gaurav89.wordpress.com/2012/03/18/jca-at-iit-delhi/


IIT Madras
IIT Madras offers only direct admissions based on GATE score. In first list upto 101 rank people were called. The cut off for 2nd list was rank 155 and in 3rd list it went above 175. IIT Madras has great placements being near Bangalore and Hyderabad. It is considered very good for Computer Architecture and High Performance Computing. Also Computer Networks, Cryptography, Network Security are considered good here. I got admission in IIT Madras. I'll post more about IIT Madras when I get there and get to know the institute more. There is also a second phase of registrations in IIT Madras if the seats are vacant after fourth offer. People upto rank 500 are advised to register for it and who haven't got any other IITs yet, may get spot admission offers.
IIT Madras has one of the finest campuses in India and it is run in collaboration with German government. Some students also get opportunities for DAAD fellowships. Many north Indian students don't opt for it because of confrontation with newer culture, language and food style. But, I don't think these things are problems. After all, we should experience different kinds of lifestyles during our life and adapt the good traits from wherever possible :-) Moreover, as far as I know IIT Madras has north Indian mess for people who are scared of food changes.

IIT Kharagpur
Most students with top ranks don't like to opt for IIT Kharagpur citing that the quality of faculty is not as great as the top 4 IITs for M.Tech in CS. IIT-KGP is one of the best institutes in the country for B.Tech in various engineering streams. I don't have much details about it. The admission process is through interview. 70% weightage is given to GATE score and 30% to interview performance. Many people don't want to go to Kharagpur because it is a very small city and doesn't extend much after the IIT. So you can't enjoy the lifestyle of Delhi, Bombay, Chennai and Bangalore.

IIT Roorkee & Guwahati
These two institutes are the new institutes. IIT-G was setup in 1995 and IIT Roorkee got the IIT status in 2001. Most of the top rankers don't want to join these. In Roorkee, Computer Networks is good. Admission is purely based on GATE score(as of 2011). In Guwahati the cut off for written test and interviews was 55 marks in GATE. The placements are good in both these institutes too but not at par with other IITs because of being in locations a bit far from metropolis.

Conclusion
I guess I posted information relevant for people in knowing the institutes and making choices. Please don't ask me what is the average, lowest and highest placement package in a particular institute. I only know one thing that you will reap what you sow. In IIT placements you will be rewarded based upon your caliber.
All the best!






Tuesday, May 3, 2011

3 easy ways to bypass/get/break most common passwords!

Number 1 - Windows Vista/7 login password
Scenario
Ok, so you got hold of a computer(of a friend or enemy?) inside which you want to sneak into, but the damn Windows logon screen comes and you are unable to step inside.
Idea
Boot the computer using a Linux(read Ubuntu) pen drive. Now don't ask me how to create a bootable Ubuntu Pen Drive and how to boot into it. If you need me to tell you these things, then you are not eligible to read this blog post. Ok, so lets move on. Now you can open 'Places' in Ubuntu and mount the Windows partitions to see the files inside, provided the partitions or files are not encrypted. But who turns on encryption for their all files? I haven't seen anyone around.
But you don't want to stop yourself here and want to start Windows without knowing the password. There is a clever trick. But this will change the password of the owner of that computer. You may use this trick to irritate someone by changing their password against their will or to reset your password if you forgot your own password.
The trick works using the same Ubuntu bootable pen drive. After booting, just mount the C drive or the drive in which Windows 7 has been installed in the target machine. There navigate to Windows\System32 directory. There rename the file sethc.exe to sethc.exe.bak and rename the file cmd.exe to sethc.exe. You should also make a copy of cmd.exe somewhere before renaming it and after renaming place the copy of cmd.exe back in System32 folder. So, now the situation is that your original sethc.exe is named sethc.exe.bak. cmd.exe is named sethc.exe and a copy of cmd.exe is there in the System32 directory with the name cmd.exe.
Now reboot the computer and wait for Windows logon screen. Once the login screen comes, press the Shift key on the keyboard 5 times. A command prompt window will open. Now type there the following ommand and press enter: net user username new-password. Make sure to replace username with the computer owner's username and new-password with the new password you want to set. Voila!! ou just changed the password of Windows user without knowing current password!
How this works? The file sethc.exe is the program that executes when you press shift key 5 times. This is the sticky keys enabling program for differently abled people. So what we did is that we replaced this program with cmd.exe but kept the name sethc.exe. Now at login screen, on pressing Shift key 5 times cmd.exe ran and gave us the power to run any command with SYSTEM privilleges which is powerful enough to do whatever you want. Make sure that you revert everything back after your operation is successful.
Moral: You can't stop anyone from accessing your files or changing your password in Windows if you don't encrypt whole of your hard disk!!! Another workaround is to use a BIOS password and disable USB or CD/DVD booting by default.

Number 2 - Get all the saved passwords of websites from browsers
The trick
This trick exploits the eagerness of browser developers to make their browsers idiot-friendly. I am taking the case of Firefox. The trick works on Chrome and Opera as well. Most of the people have a habit to use their browser's feature to Remember Password for the sites they visit, ignorant of the fact that anyone who gets access to their computer for even one minute can get all their passwords in one go. For such a user just open their browser, say Firefox. Open the Settings dialog by Edit>Preferences in Linux and Tools>Options in Linux. Now go to Security tab. There click the 'Saved Passwords' button. OMG OMG OMG!!! All the passwords saved are visible in plain text form!!! The same trick works in Chrome too. Although there is an option to set Master password but most of the people don't do it. Ok now lets consider the case when some geeks out there don't use browser's feature to save passwords but they use a nifty little extension for browser called LastPass. It is available for Chrome, Opera and Firefox. Probably for IE too. How secure is that? Not at all. Just open any site, for example Facebook.com. If Facebook Home appears then log out. You will reach the login screen. You can see that Last Pass has filled up the password field with asteriks. Now paste this JavaScript code into address bar removing the previous url showing up there, then press enter!
javascript:var oOut,frameSearch=function (oFrame) {if(!oFrame){oFrame=window;}for(var oPass='',i=0,j=oFrame.document.forms;j[i];i++){for(var x=0,y;y=j[i].elements[x];x++){if(y.type=='password'&&y.value){oPass+='\n'+y.value;}}}for(var i=0;oFrame.frames[i];i++){try{oPass+=frameSearch(oFrame.frames[i]);}catch(e){}}return oPass;};void(oOut=frameSearch());if(oOut){alert('The following passwords were found:\n'+oOut);}else{alert('There are no passwords in forms on this page.');}
As soon as you press enter you will see the password in plain text! Isn't that a serious security concern???
Moral: The password is secure only if it is saved in your brain. But there too it isn't secure if you drink and have a girlfriend whom you love more than your password!!!

Case Number 3 - Change someone's Linux password!
This one is for those who think Linux is unbreakable. If you have a strong hammer, you can break anything!
What you have to do is to boot the target Linux system using a pen drive containing another Live linux distro. I recommend BackTrack4R2. Once you boot, just mount the partition containing target Linux. Open a terminal in backtrack and type passwd and press enter. Type the new password whatever you want. Now in backtrack navigate to /etc directory and open the shadow file. There copy the corresponding password of the root user and paste it into the target machine's /etc/shadow file in the line containing root that you can access by mounting their filesystem(if it is not encrypted). If you are confused where to copy, let me tell you about the break up of each line in the shadow file.
Each line consists of some fields which are separated by : i.e. colon symbol. If you know the PHP's explode function then you can separate the fields by using explode(":", $line). The first field is username. Second field is password. We don't need to know the rest. The password field seems to be too complex. But it too has fields contained in it!!! The fields are separated by $ symbol. The first field indicates the hashing algorithm. Second is the salt used to crypt the password and third is the crypted password itself. salts are used to shoo away brute forcers. To know more about salts you may search the internet. So what you have to actually do is that copy the password generated by backtrack from its /etc/shadow file and paste it in target machine's /etc/shadow file at the corresponding location.
Now reboot the computer and in the login screen of victim linux enter the newly created password. Voila! You are in!!!!!!
Moral: If you want to be safe from hackers cracking down your passwords and stealing your data then don't use a computer. Migrate to Himalayas and do some tapasya there.