The CDC (Center for Disease Control) has a list and information about health in Peru and health in Ecuador.
You'll want to make sure your MMR, Polio and other regular ones are up to date. Tetanus too, because it's just annoying to have to get in a foreign country if you do injure yourself.
Scroll down the list, and you'll see Hep A, B, Typhoid are also required. Rabies is suggested (although if you get bitten you'll still need another one after) and Yellow Fever is recommended for certain areas, including at altitude (read Inca Trail).
There's currently a focus on measles there, so I'd make extra sure it's up to date.
And of course, find out what type of anti-malaria is appropriate. Remember some brands (in the UK at least) cost 100 times as much (I kid you not), but are only 5% more effective (90 vs 95). Some are more effective against Asian or African variants. Some people react to different ones. So discuss it with your travel doctor first.
On a personal note, take the strongest DEET and anti mosquito/bug spray you've got. At Machu Picchu, I've never been bitten so many times in my life - I had 40-60 bites on each leg alone! Sainsbury supermarket spray was NOT adequate.
Still totally worth it tho ;)