In the process of network interaction, CAPTCHA (completely automated public Turing test to tell computers and humans apart) is usually required. At present, the main method for differentiating between humans and machines is to use CAPTCHA, which includes images and text. Users need to interface with CAPTCHA for verification, which prolongs the interaction step. The interactive experience is poor, and the process of verification is not concealed. To simplify the verification process, optimize the interaction behavior and increase the security of verification, this paper proposes a CAPTCHA method based on a user's mouse operation behavior, and carries out a study on cursor trajectory recognition. This method can reduce the manual procedure and improve the user interactive experience. In this article, we propose an ensemble learning algorithm model based on sliding sampling to classify and recognize cursor trajectory data. Experiments show that the classification performance of the model is reliable for recognition based on human–machine cursor trajectories, which is a new concept for CAPTCHA.