├── LICENSE
├── README.md
├── images
├── demo1.png
├── demo2.png
├── demo3.png
└── demo4.png
├── scripts
├── .captcha.jpg
├── solution1.py
└── solution2.py
└── template
├── captcha.php
├── index.html
├── lab1.php
├── lab2.php
└── monofont.ttf
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 D3Ext
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Captcha Bypassing Lab
2 |
3 | If you want to practise captcha bypassing, this is the right place!
4 |
5 | ## Introduction
6 |
7 | This repo contains a lab to practise captcha bypassing and a python script which is already able to "break" the captcha and get the numbers of it. The lab has 2 parts, one to simply parse the captcha and the other one to combine the captcha with a simple login form
8 |
9 | ## Requirements
10 |
11 | To use the python script you need to have install the python ***pytesseract*** package as well as the ***tesseract*** command. Both of them used to convert images to text:
12 |
13 | To launch the lab you just need a php server and in order to generate the captcha you need to have installed php-gd and to have it enabled on `/etc/php/php.ini` by uncommenting the line `extension=gd`
14 |
15 | ## Installation
16 |
17 | Clone the repo and set up a php server on the lab folder
18 |
19 | ```sh
20 | git clone https://github.com/D3Ext/Captcha-Bypassing-Lab
21 | cd Captcha-Bypassing-Lab/template
22 | php -S 0.0.0.0:80
23 | ```
24 |
25 | ## Solution
26 |
27 | In order to solve both labs the project has, there actually are infinite solutions but feel free to check the python scripts on the `scripts/` folder, `solution1.py` for the first part and `solution2.py` for the second one
28 |
29 | ## Demo
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ## References
40 |
41 | ```
42 | https://www.anura.io/blog/captcha-and-recaptcha-how-fraudsters-bypass-it
43 | https://book.hacktricks.xyz/pentesting-web/captcha-bypass
44 | ```
45 |
46 | ## License
47 |
48 | This project is under MIT license
49 |
50 | Copyright © 2024, *D3Ext*
51 |
52 |
--------------------------------------------------------------------------------
/images/demo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/D3Ext/Captcha-Bypassing-Lab/f169fd01a7453b4fdb93cb2ca316f2571bd58a86/images/demo1.png
--------------------------------------------------------------------------------
/images/demo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/D3Ext/Captcha-Bypassing-Lab/f169fd01a7453b4fdb93cb2ca316f2571bd58a86/images/demo2.png
--------------------------------------------------------------------------------
/images/demo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/D3Ext/Captcha-Bypassing-Lab/f169fd01a7453b4fdb93cb2ca316f2571bd58a86/images/demo3.png
--------------------------------------------------------------------------------
/images/demo4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/D3Ext/Captcha-Bypassing-Lab/f169fd01a7453b4fdb93cb2ca316f2571bd58a86/images/demo4.png
--------------------------------------------------------------------------------
/scripts/.captcha.jpg:
--------------------------------------------------------------------------------
1 |
The requested resource /lab1.phpcaptcha.php?rand=991113378
was not found on this server.
40 | Submitted captcha code is correct.
"; 41 | } 42 | } 43 | 44 | echo $status; 45 | ?> 46 | 47 | -------------------------------------------------------------------------------- /template/lab2.php: -------------------------------------------------------------------------------- 1 | Submitted captcha code does not match!"; 16 | } else { 17 | if ($_POST['username'] == $USER) { 18 | if ($_POST['password'] == $PASSWORD) { 19 | echo "Access Granted
"; 20 | } else { 21 | echo "Invalid Password
"; 22 | } 23 | } else { 24 | echo "Invalid User
"; 25 | } 26 | 27 | // $status = "Submitted captcha code is correct.
"; 28 | } 29 | } 30 | echo $status; 31 | ?> 32 | 33 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /template/monofont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/D3Ext/Captcha-Bypassing-Lab/f169fd01a7453b4fdb93cb2ca316f2571bd58a86/template/monofont.ttf --------------------------------------------------------------------------------