Perhaps the terrorists stabbed the flight attendants to get a cockpit key, to force one of them to open the cockpit door, or to lure the captain or first officer out of the cockpit.
It could be, that the terrorists stabbed the flight attendants to lure the captain or first officer out of the cockpit.