Working with the right Realtor who knows how to navigate those issues and is working in your best interest is your first step.
Enlist a Realtor that has experience negotiating on foreclosed properties. The larger banks have specific docs and criteria to present offers and they will not look at yours if not presented in the appropriate format. That same agent also has the experience to guide you as to which finance vehicle to use, help create a punch list of deferred maintenance items for repair, contacts of competent trades people to hire and most importantly compare the property with like properties to conclude the offering price and the potential value in repaired shape. Nothing more discouraging than to put real money and sweat into a foreclosed home only to end up with a property whos cost is more than any potential future value. Good luck.