Snakes have ‘inner ear’. Snakes have no ears outside like we have. When someone passes near a snakes , his muscles feel the vibrations. These vibrations send a signal to the bones of the inner ear of the snake. This way, the snake can hear all the vibrations on the ground.
Do you know why snakes keep flicking their tongue in and out ? It is so because snakes smell with their tongue ! just like a Lizard.