├── LICENSE ├── README.md ├── bypass ├── bypass.go └── requests.go ├── constants └── constants.go ├── errors └── catch.go ├── go.mod └── utils └── utils.go /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 sp4reeee 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 | # go-recaptcha-v3-bypass 2 | 3 | 🔓 A Go library for bypassing reCAPTCHA challenges effortlessly. 4 | 5 | go-recaptcha-v3-bypass provides a seamless solution for bypassing reCAPTCHA challenges. With just a few lines of code, you can integrate this library into your Go applications and bypass CAPTCHAs efficiently. However, it's important to note that the usage of this library must be authorized by the website owner implementing the CAPTCHA. 6 | 7 | ## Installation 8 | 9 | To install go-recaptcha-v3-bypass, use go get: 10 | 11 | ### ```go get github.com/sp4reeee/go-recaptcha-v3-bypass``` 12 | 13 | ## Quick Start 14 | 15 | Using go-recaptcha-v3-bypass is simple! Here's an example to get you started: 16 | 17 | ``` 18 | package main 19 | 20 | import ( 21 | "fmt" 22 | 23 | "github.com/sp4reeee/go-recaptcha-v3-bypass/bypass" 24 | ) 25 | 26 | func main() { 27 | token := bypass.Bypass("RECAPTCHA ANCHOR URL", "") 28 | fmt.Println(token) 29 | } 30 | ``` 31 | 32 | ✨ In this example, the Bypass function is used to bypass the reCAPTCHA challenge. Provide the "RECAPTCHA ANCHOR URL" as the first parameter, which should contain the reCAPTCHA challenge. If a proxy is required, provide it as the second parameter; otherwise, leave it empty. 33 | 34 | ## Important Note 35 | 36 | Please ensure that you have proper authorization from the website owner before utilizing this library to bypass reCAPTCHA challenges. Unauthorized usage may violate the terms of service of the website and can lead to legal consequences. 37 | 38 | ## License 39 | 40 | This project is licensed under the MIT License - see the LICENSE file for details. 41 | 42 | 🔓 Unlock the power of bypassing reCAPTCHA challenges with go-recaptcha-v3-bypass! Remember to obtain proper authorization from website owners and enjoy hassle-free CAPTCHA bypassing in your Go projects. If you have any questions or concerns, feel free to reach out. Happy coding! 😊 43 | -------------------------------------------------------------------------------- /bypass/bypass.go: -------------------------------------------------------------------------------- 1 | package bypass 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/sp4reeee/go-recaptcha-v3-bypass/constants" 7 | "github.com/sp4reeee/go-recaptcha-v3-bypass/utils" 8 | ) 9 | 10 | func Bypass(url string, proxy string) string { 11 | 12 | v, k, co := utils.Param_Extract(url) 13 | 14 | token := get_recaptcha_token(url, proxy) 15 | 16 | version := utils.Match_Data(url, constants.REGEX_CAPTCHA_VERSION) 17 | 18 | post_url := fmt.Sprintf(constants.BASE_URL_POST, version, k) 19 | 20 | post_data := fmt.Sprintf(constants.POST_DATA, v, token, k, co) 21 | 22 | resp_token := get_recaptcha_response(post_url, post_data, proxy) 23 | 24 | return resp_token 25 | } 26 | -------------------------------------------------------------------------------- /bypass/requests.go: -------------------------------------------------------------------------------- 1 | package bypass 2 | 3 | import ( 4 | "io/ioutil" 5 | "net/http" 6 | "net/url" 7 | 8 | "strings" 9 | 10 | "github.com/sp4reeee/go-recaptcha-v3-bypass/constants" 11 | catch "github.com/sp4reeee/go-recaptcha-v3-bypass/errors" 12 | "github.com/sp4reeee/go-recaptcha-v3-bypass/utils" 13 | ) 14 | 15 | var session = &http.Client{} 16 | 17 | func get_recaptcha_token(u string, proxy string) string { 18 | 19 | req, err := http.NewRequest("GET", u, nil) 20 | if err != nil { 21 | return catch.ErrorToken() 22 | } 23 | 24 | req.Header.Set(constants.BASE_HEADERS_KEY, constants.BASE_HEADERS_VALUE) 25 | 26 | if proxy != "" { 27 | 28 | parsed, err := url.Parse(proxy) 29 | if err != nil { 30 | return catch.ErrorProxy() 31 | } 32 | 33 | transport := &http.Transport{ 34 | Proxy: http.ProxyURL(parsed), 35 | } 36 | 37 | session.Transport = transport 38 | } 39 | 40 | resp, err := session.Do(req) 41 | if err != nil { 42 | return catch.ErrorProxy() 43 | } 44 | defer resp.Body.Close() 45 | 46 | body, err := ioutil.ReadAll(resp.Body) 47 | if err != nil { 48 | return catch.ErrorToken() 49 | } 50 | 51 | token := utils.Match_Data(string(body), constants.REGEX_TOKEN_GET) 52 | 53 | return token 54 | } 55 | 56 | func get_recaptcha_response(u string, post_data string, proxy string) string { 57 | 58 | req, err := http.NewRequest("POST", u, strings.NewReader(post_data)) 59 | if err != nil { 60 | return catch.ErrorResponse() 61 | } 62 | 63 | req.Header.Set(constants.BASE_HEADERS_KEY, constants.BASE_HEADERS_VALUE) 64 | 65 | if proxy != "" { 66 | 67 | parsed, err := url.Parse(proxy) 68 | if err != nil { 69 | return catch.ErrorProxy() 70 | } 71 | 72 | transport := &http.Transport{ 73 | Proxy: http.ProxyURL(parsed), 74 | } 75 | 76 | session.Transport = transport 77 | } 78 | 79 | resp, err := session.Do(req) 80 | if err != nil { 81 | return catch.ErrorProxy() 82 | } 83 | defer resp.Body.Close() 84 | 85 | body, err := ioutil.ReadAll(resp.Body) 86 | if err != nil { 87 | return catch.ErrorResponse() 88 | } 89 | 90 | token := utils.Match_Data(string(body), constants.REGEX_TOKEN_POST) 91 | 92 | return token 93 | } 94 | -------------------------------------------------------------------------------- /constants/constants.go: -------------------------------------------------------------------------------- 1 | package constants 2 | 3 | const ( 4 | BASE_HEADERS_KEY = "Content-Type" 5 | BASE_HEADERS_VALUE = "application/x-www-form-urlencoded/" 6 | BASE_URL_POST = "https://www.google.com/recaptcha/%s/reload?k=%s" 7 | REGEX_TOKEN_GET = `(?s)"recaptcha-token" value="(.*?)"` 8 | REGEX_TOKEN_POST = `"rresp","(.*?)"` 9 | REGEX_CAPTCHA_VERSION = `recaptcha/(.*?)/anchor` 10 | POST_DATA = "v=%s&reason=q&c=%s&k=%s&co=%s&hl=en&size=invisible&chr=%5B89%2C64%2C27%5D&vh=13599012192&bg=!q62grYxHRvVxjUIjSFNd0mlvrZ-iCgIHAAAB6FcAAAANnAkBySdqTJGFRK7SirleWAwPVhv9-XwP8ugGSTJJgQ46-0IMBKN8HUnfPqm4sCefwxOOEURND35prc9DJYG0pbmg_jD18qC0c-lQzuPsOtUhHTtfv3--SVCcRvJWZ0V3cia65HGfUys0e1K-IZoArlxM9qZfUMXJKAFuWqZiBn-Qi8VnDqI2rRnAQcIB8Wra6xWzmFbRR2NZqF7lDPKZ0_SZBEc99_49j07ISW4X65sMHL139EARIOipdsj5js5JyM19a2TCZJtAu4XL1h0ZLfomM8KDHkcl_b0L-jW9cvAe2K2uQXKRPzruAvtjdhMdODzVWU5VawKhpmi2NCKAiCRUlJW5lToYkR_X-07AqFLY6qi4ZbJ_sSrD7fCNNYFKmLfAaxPwPmp5Dgei7KKvEQmeUEZwTQAS1p2gaBmt6SCOgId3QBfF_robIkJMcXFzj7R0G-s8rwGUSc8EQzT_DCe9SZsJyobu3Ps0-YK-W3MPWk6a69o618zPSIIQtSCor9w_oUYTLiptaBAEY03NWINhc1mmiYu2Yz5apkW_KbAp3HD3G0bhzcCIYZOGZxyJ44HdGsCJ-7ZFTcEAUST-aLbS-YN1AyuC7ClFO86CMICV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Wf2acKolZ9fU-gspeACUCN20EhGT-HvBtNBGr_xWk1zVJBgNG29olXCpF26eXNKNCCovsILNDgH06vulDUG_vR5RrGe5LsXksIoTMYsCUitLz4HEehUOd9mWCmLCl00eGRCkwr9EB557lyr7mBK2KPgJkXhNmmPSbDy6hPaQ057zfAd5s_43UBCMtI-aAs5NN4TXHd6IlLwynwc1zsYOQ6z_HARlcMpCV9ac-8eOKsaepgjOAX4YHfg3NekrxA2ynrvwk9U-gCtpxMJ4f1cVx3jExNlIX5LxE46FYIhQ" 11 | ) 12 | -------------------------------------------------------------------------------- /errors/catch.go: -------------------------------------------------------------------------------- 1 | package catch 2 | 3 | func ErrorToken() string { 4 | return "Error for getting GET token" 5 | } 6 | 7 | func ErrorResponse() string { 8 | return "Error for getting POST response token" 9 | } 10 | 11 | func ErrorProxy() string { 12 | return "Error with your proxy" 13 | } 14 | 15 | func ErrorParams() string { 16 | return "Error provided URL is incorrect" 17 | } 18 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sp4reeee/go-recaptcha-v3-bypass 2 | 3 | go 1.20 4 | -------------------------------------------------------------------------------- /utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "net/url" 5 | "regexp" 6 | 7 | catch "github.com/sp4reeee/go-recaptcha-v3-bypass/errors" 8 | ) 9 | 10 | func Match_Data(data string, pattern string) string { 11 | 12 | regex, err := regexp.Compile(pattern) 13 | if err != nil { 14 | return "Error when compilating REGEX" 15 | } 16 | 17 | match := regex.FindStringSubmatch(data) 18 | 19 | if len(match) < 1 { 20 | return "No match found maybe use a proxy" 21 | } 22 | 23 | return match[1] 24 | } 25 | 26 | func Param_Extract(u string) (string, string, string) { 27 | parsed, err := url.Parse(u) 28 | if err != nil { 29 | return catch.ErrorParams(), "", "" 30 | } 31 | 32 | query := parsed.Query() 33 | v := query.Get("v") 34 | if v == "" { 35 | return "Parameters 'v' not found", "", "" 36 | } 37 | k := query.Get("k") 38 | if k == "" { 39 | return "Parameters 'k' not found", "", "" 40 | } 41 | co := query.Get("co") 42 | if co == "" { 43 | return "Parameters 'co' not found", "", "" 44 | } 45 | 46 | return v, k, co 47 | } 48 | --------------------------------------------------------------------------------