Throughout history, the world has developed various forms of technology to protect airliners from terrorist attack or the attempt at such. On November 23, 1996 the crash of Ethiopian Airlines Flight 961 occurred. The cause of the crash "was no accident". A history channel television show states "it's (flight 961) was being hijacked by three desperate Ethiopian men seeking political asylum. They have stormed the cockpit and claim to have a bomb." The video also mentioned "before 9-11, Ethiopian Airlines Flight 961 was the deadliest hijacking in aviation history. The video also points out "at that time (November 23, 1996) cockpits were much more accessible. Now, they are protected by bulletproof doors with keypad entry locks. Flight attendants (and/or air marshals) also stand guard, making it much more difficult to get to the pilots."
In airports, their security armament is various and sophisticated. They have metal detectors to check for weapons or suspicious items. The documentary on flight 253 (Christmas Day bombing attempt) states "when a passenger enters a metal detector arch, it sends pulses through the body creating a magnetic field that reflects back a signal. If the pulse meets anything metal, like a knife or the wires and components of a bomb, an opposing magnetic field is created, which triggers an alarm." Aside from metal detectors airports also have x-ray scanning machines to ensure that there are no dangerous ordinances in it. People are told to put their shoes through the x-ray scanner after the shoe bomb plot by Richard Reid.
Thanks to this technology the world has developed over the years, the security makes sure that flying is an incredibly safe experience.
Liam Neeson as an Air Marshal (Bill Marks) in Non-Stop chinametaldetector.com