7.0.4 iCloud password forgot
Ask your friend to recover the password via https://iforgot.apple.com/ and then to follow the steps documented in What to do before selling or giving away your iPhone, iPad, or iPod touch.