Sarah Palin has accused Barack Obama of "palling around with terrorists," marking a shift to a nastier tone in the White House race.