NoahCardoza / CaptchaHarvester

Solve captchas yourself without having to pay for services like 2captcha for use in automated projects.
https://pypi.org/project/captcha-harvester/
MIT License
662 stars 63 forks source link

Help Getting started #25

Closed verybadsoldier closed 4 years ago

verybadsoldier commented 4 years ago

I am using your CloudProxy project but I often get this message:

2020-09-02T10:50:00.240Z INFO REQ-294 Captcha detected but no automatic solver is configured.

So I thought I should take a look at this project. But I cannot get it to work. As far as I know I should start it just by typing harvester but then I get this:

(cloudproxy) C:\Users\User>harvester
usage: harvester [-h] [-a DATA_ACTION] -k SITE_KEY -d DOMAIN [-H HOST]
                 [-p PORT] [-b BROWSER] [-B] [-r] [-e LOAD_EXTENSION] [-v]
                 {recaptcha-v2,recaptcha-v3,hcaptcha}
harvester: error: the following arguments are required: type, -k/--site-key, -d/--domain

So it seems I need 3 arguments. type seems to specify the captcha type. Well sorry, but how do I know? And what is a site-key and where to get it?

Sorry for these (probably nooby) questions... Thanks for help.

NoahCardoza commented 4 years ago

First off, adding -h will give you a lot more info (you may have done it already, but for future reference):

> harvester -h
usage: harvester [-h] [-a DATA_ACTION] -k SITE_KEY -d DOMAIN [-H HOST]
                 [-p PORT] [-b BROWSER] [-B] [-r] [-e LOAD_EXTENSION] [-v]
                 {recaptcha-v2,recaptcha-v3,hcaptcha}

CaptchaHarvester: Solve captchas yourself without having to pay for services
like 2captcha for use in automated projects.

positional arguments:
  {recaptcha-v2,recaptcha-v3,hcaptcha}
                        The type of captcha that that that domain/sitekey pair
                        is for.

optional arguments:
  -h, --help            show this help message and exit
  -a DATA_ACTION, --data-action DATA_ACTION
                        Sets the action in rendered recaptcha-v3 when
                        collecting tokens (required with recaptcha-v3)
  -k SITE_KEY, --site-key SITE_KEY
                        The sitekey used by the captcha.
  -d DOMAIN, --domain DOMAIN
                        The domain of the site which hosts the captcha you
                        want to solve.
  -H HOST, --host HOST  Defaults to 127.0.0.1.
  -p PORT, --port PORT  Defaults to 5000.
  -b BROWSER, --browser BROWSER
                        Allows you to pass the path to any Chromium browser.
  -B, --no-browser      Keeps the harvester from launching a browser br
                        default.
  -r, --restart-browser
                        If this flag is not passed, a new instance of the
                        browser will be opened. this flag is most helpful when
                        solving Googles ReCaptchas because if you restat your
                        main profile you'll most likely be logged into Google
                        and will be given an easier time on the captchas.
  -e LOAD_EXTENSION, --load-extension LOAD_EXTENSION
                        Loads unpacked extensions when starting the browser,
                        to load multiple extensions sepparate the paths with
                        commas (must be used with -b/--browser).
  -v, --verbose         Show more server and browser (when using -b/--browser)
                        logging.

For help contact @MacHacker#7322 (Discord)

If you are using ClouldProxy, you are probably solving hCaptchas since CF moved over to them from ReCaptchas.

To find the sitekey, you'll have to go to the page with the captcha, and search through the HTML for data-sitekey (It's the special key given when registering your domain for most types of captchas, it's what identifies that the captcha is meant to be loaded at the given domain).

Lastly, the domain is just the string between http(s):// and the first /.

Let me know if you have anymore questions and feel free to ask them in the Discord server.

This also reminds me, I need to update the CP's code a little because currently it won't work with v2 of the harvester... that being said, it will have to wait till tomorrow since it's 4 AM and I need my beauty sleep 😂

Good luck!

verybadsoldier commented 4 years ago

Ok, thanks for the help. I think I understand now. But I realized that it will display the captcha to the user to manually solve it, right? I might try to get 2captcha to work in CloudProxy.

NoahCardoza commented 4 years ago

If you happen to build a good connecter feel free to submit a PR and add it under the /src/captcha directory.