Yes you will need to go through an X-ray and security check during a connecting flight because during a stopover, sometimes called layover, you can have time to exit the airport, buy something outside and then return to the airport, to make your connecting flight.