If you deposited the money to the account of the friend of the person whom you claim to be the actual beneficiary then you can proceed only against the transferee, but to succeed in the court you have to prove that there was an agreement between both of you whereby and whereunder the money was to be repaid to you in entirety or part thereof, failing which it will be futile to go to court. The actual legal expense may be more than the amount you intend to recover.