The ability to directly detect gravitational waves has enabled us to empirically probe the nature of ultracompact relativistic objects. Several alternatives to the black holes of classical general relativity have been proposed which do not have a horizon, in which case a newly formed object (e.g., as a result of binary merger) may emit echoes: bursts of gravitational radiation with varying amplitude and duration, but arriving at regular time intervals. Unlike in previous template-based approaches, we present a morphology-independent search method to find echoes in the data from gravitational wave detectors, based on a decomposition of the signal in terms of generalized wavelets consisting of multiple sine-Gaussians. The ability of the method to discriminate between echoes and instrumental noise is assessed by inserting into the noise two different signals: a train of sine-Gaussians, and an echoing signal from an extreme mass-ratio inspiral of a particle into a Schwarzschild vacuum spacetime, with reflective boundary conditions close to the horizon. We find that both types of signals are detectable for plausible signal-to-noise ratios in existing detectors and their near-future upgrades. Finally, we show how the algorithm can provide a characterization of the echoes in terms of the time between successive bursts, and damping and widening from one echo to the next