A Simple Generic Attack on Text Captchas
Total Page:16
File Type:pdf, Size:1020Kb
A Simple Generic Attack on Text Captchas Haichang Gao1*, Jeff Yan2*, Fang Cao1, Zhengya Zhang1, Lei Lei1, Mengyun Tang1, Ping Zhang1, Xin Zhou1, Xuqin Wang1 and Jiawei Li1 1. Institute of Software Engineering, Xidian University, Xi’an, Shaanxi, 710071, P.R. China 2. Security Lancaster & School of Computing and Communications, Lancaster University, UK ∗Corresponding authors: [email protected], [email protected] Abstract—Text-based Captchas have been widely deployed attacked many early Captchas deployed on the Internet [19]. across the Internet to defend against undesirable or malicious Yan and El Ahmad broke most visual schemes provided at bot programs. Many attacks have been proposed; these fine prior Captchaservice.org in 2006 [24], published a segmentation art advanced the scientific understanding of Captcha robustness, attack on Captchas deployed by Microsoft and Yahoo! [25] but most of them have a limited applicability. In this paper, in 2008, and broke the Megaupload scheme with a method we report a simple, low-cost but powerful attack that effectively of identifying and merging character components in 2010 [1]. breaks a wide range of text Captchas with distinct design features, including those deployed by Google, Microsoft, Yahoo!, Amazon In 2011, Bursztein et al. showed that 13 Captchas on pop- and other Internet giants. For all the schemes, our attack achieved ular websites were vulnerable to automated attacks, but they a success rate ranging from 5% to 77%, and achieved an achieved zero success on harder schemes such as reCAPTCHA average speed of solving a puzzle in less than 15 seconds on and Google’s own scheme [5]. In the same year, Yan’s team a standard desktop computer (with a 3.3GHz Intel Core i3 CPU published an effective attack on both of these schemes [2]. At and 2 GB RAM). This is to date the simplest generic attack CCS’13, Gao’s team and Yan jointly published a successful on text Captchas. Our attack is based on Log-Gabor filters; a attack on a family of hollow schemes [13]. The latest attack famed application of Gabor filters in computer security is John on Captchas [4] was published in August 2014. Daugman’s iris recognition algorithm. Our work is the first to apply Gabor filters for breaking Captchas. As a side note, other notable attacks include [14, 17, 20, 23, 27]. But they studied alternative Captcha designs such as I. INTRODUCTION animation, image and audio schemes, rather than text ones. Therefore, we will not look into the details. Captcha allows websites to automatically distinguish com- puters from humans. This technology, in particular text-based These fine prior art advanced the scientific understanding Captchas, has been widely deployed on the Internet to curb of Captcha robustness, but most of them have a limited abuses introduced by automated computer programs mas- applicability. Many of them broke specific schemes, and only querading as human beings. Although many text Captchas a few broke a security mechanism as a whole. We quote the have been broken, the most recent studies, such as one by following from a well-cited paper [25]. a UC Berkeley team [21] and one by Stanford and Google [6], suggest that Captchas are still an effective security tool. The relatively wide applicability of our attack on the MSN scheme is encouraging. However, we Captcha has had many failure modes. Designers typically doubt that there is a universal segmentation attack learn from previous failures to design better schemes. Current that is applicable to all text Captchas, given that Captchas are much more sophisticated than the earliest gener- hundreds of design variations exist. Instead, a more ation designed at Carnegie Mellon. As predicated in [25], this realistically expectation is to create a toolbox (i.e. a technology has been going through a process of evolutionary collection of algorithms and attacks, ideally organ- development, like cryptography, digital watermarking and the ised in a composable way) for evaluating the strength like, with an iterative process in which successful attacks lead of Captchas. to the development of more robust systems. This toolbox approach has been a common practice (with The robustness of text Captchas has been an active field in a few exceptions) in the Captcha research community, as the research communities. Many attacks have been proposed. evidenced by papers published afterwards. Decaptcha [5], was For examples, in 2003, Mori and Malik used sophisticated a well conceived tool for analysing Captcha robustness and object recognition algorithms to break two early designs: EZ- was considered to be a generic attack, but it followed such a Gimpy and GIMPY [18]. In 2005, Chellapilla and Simard toolbox approach, as we will explain in details later. In this paper, we propose a simple but effective attack that Permission to freely reproduce all or part of this paper for noncommercial breaks a wide range of text Captchas. Our attack is based on purposes is granted provided that copies bear this notice and the full citation on the first page. Reproduction for commercial purposes is strictly prohibited Log-Gabor filters, a versatile signal processing technique. A without the prior written consent of the Internet Society, the first-named author key innovation of John Daugman’s iris recognition algorithm (for reproduction of an entire paper only), and the author’s employer if the was to encode iris patterns into binary bits using 2D Gabor paper was prepared within the scope of employment. filters [10]. Our attack uses 2D Log-Gabor, a variant of Gabor NDSS ’16, 21-24 February 2016, San Diego, CA, USA Copyright 2016 Internet Society, ISBN 1-891562-41-X filters. By convolving a Captcha image with Log-Gabor filters http://dx.doi.org/10.14722/ndss.2016.23154 of four different orientations (i.e. directions) respectively, we extract character components along each orientation. Then, we octave. If the bandwidth is larger, a non-zero DC component use a recognition engine to combine adjacent components in will exist. If a wide spectrum is needed, Gabor filters are not different ways to form individual characters. The most likely optimal. combination is output as our recognition result. Proposed by David Field in 1987, Log-Gabor filters [11] We have tested our attack on Captchas deployed by top 20 improve normal Gabor filters in the following sense. Log- most popular websites according to Alexa ranking [3]. These Gabor’s transfer function is a Gaussian on a logarithmic real-world Captchas include Google’s new reCAPTCHA, hol- frequency axis. Normal Gabor filters often over-represent the low schemes, and conventional designs; they represent a wide low frequencies, but it is not the case for the Log-Gabor. Log- range of design features. We have also tested our attack on Gabor filters allow arbitrary bandwidth and the bandwidth can much harder Captchas such as an old version of reCAPTCHA be optimised to produce a filter with minimal spatial extent. and two other designs. Our attack is designed to aim for sim- Field suggested that Log-Gabor filters encode natural images plicity and general applicability, rather than high success rates more efficiently than ordinary Gabor functions, and that the for breaking individual schemes. However, it has successfully former are consistent with measurements of mammalian visual broken all the schemes we tested, judged by both criteria systems which indicate we human beings have cell responses commonly used in the Captcha community [5, 7]. For most that are symmetric on the log frequency scale. of the schemes, it has achieved a good success rate. Mathematically, 2D Log-Gabor filters are constructed in Novelty and significance. Our attack uses a single segmen- the polar coordinate system of frequency domain as follows. tation and recognition strategy, and it is to date the best in terms of simplicity, power and general applicability. Breaking some Captchas is rarely news, but breaking all the Captchas G(f,θ)= G(f) · G(θ) (1) with a single method that is so simple is surprising (even to 2 2 G(f) = exp {−[log (f/f0)] /[log (σ/f0)] } (2) ourselves). Although we have had much experience in breaking 2 2 various Captchas, we did not expect at the beginning that our G(θ) = exp [−(θ − θ0) /2σθ ] (3) method would work so well. f and θ represent the radial and angle coordinate, respec- Our attack might suggest that the current common practice tively. f0 and θ0 represent center frequency and direction of of text Captcha designs is doomed, but it does not pronounce the filter, respectively. σ and σθ represent radial bandwidth and a death sentence to the idea of text Captcha altogether. It’s directional bandwidth of the filter. highly likely that new text Captchas will be invented. We are experimenting some new ideas, for example. G(f) is the radial component that controls the bandwidth of the filter, and G(θ) is the angle component that controls the On the other hand, another important value of our attack choice of filter orientations. G(f,θ) defines a complete 2D is that it can be used as a standard test: any new design that Log-Gabor function. By definition, Log-Gabor filters always cannot pass this test should not be deployed. Moreover, for have no DC component. people working in security economics, this work also suggests the possibility that adversaries can launch concerted automated Gabor filters were used before in the context of computer attacks on Captchas to reduce their cost. security, but mainly in the field of biometrics. The most famous application of Gabor filters in computer security is Daugman’s We organise this paper as follows. Section II briefly intro- iris recognition [10]. Our work is the first application of Gabor duces the essence of Log-Gabor filters.