Russian lawmakers have passed a sweeping new anti-terrorism bill that would allow the military to attack planes and ships used in terrorist acts , even if hostages are aboard .