Attached to the tail or wings you have this. It is firmly attached so that nothing short of catastrophic failure will detach it.
Inside would be a small number of components to keep it light and cheap.... (more)
I just found this clip from Avengers: Age of Ultron where you can clearly see that as Vision hits Ultron with the hammer lightning and thunder are discharged. I made it into a very slow frame by frame gif so you can see this ...(more)