How to completely reset a used iPhone without the password?

I'm helping a friend reset his new to him iPhone 4. He recently bought it from someone over the web. The previous owner stated he had already reset the iPhone but the iPhone still has his Apple ID. And to reset it completely I need the owners previous password. Can someone please help me?

Well you can use the withed00r ios 6 hack or you can go to the apple store with proof thqt its yours to get it reset. There's also other ways but they might be too complicated for you

You can't. Your friend got taken.

Or he stole it. In which case it's a walking brick and is also traceable.

If he did truly buy it from someone over the web he should have the contact info for that person and contact them for the password. Otherwise you can either have it professionally unlocked/jailbroken by someone off ebay or craigslist. Or you could talk to Apple, the wireless provider likely won't be able to help you as its the apple ID that is the problem. If that person doesn't respond the phone is probably stolen or something and you can check that by calling the wireless provider it works with and give them the IMEI or MEID or ESN (they're the same thing for corresponding providers) which can be found in settings, general, and then about.

Put the phone in restore mode. ( Google that)

Connect to iTunes and restore to factory settings

You can't. Impossible. You would have to contact that person and get the password. And since you have no paper trail Apple will not help you.