Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patched #13

Open
l10r opened this issue Dec 13, 2020 · 179 comments
Open

Patched #13

l10r opened this issue Dec 13, 2020 · 179 comments

Comments

@l10r
Copy link

l10r commented Dec 13, 2020

Apparently the solver just got patched.

@Anunayj
Copy link

Anunayj commented Dec 26, 2020

Nope apparently still seems to work (if you modify stuff a bit), the hsl.js location changed to https://assets.hcaptcha.com/c/53571876/hsl.js though

@l10r
Copy link
Author

l10r commented Dec 27, 2020

Nope apparently still seems to work (if you modify stuff a bit), the hsl.js location changed to https://assets.hcaptcha.com/c/53571876/hsl.js though

How did you find this, So I can solve this issue in the future. Thanks btw

@l10r
Copy link
Author

l10r commented Dec 27, 2020

Nope apparently still seems to work (if you modify stuff a bit), the hsl.js location changed to https://assets.hcaptcha.com/c/53571876/hsl.js though

Can you send me the modified version you did?

@FatihAraz
Copy link

in node_modules\hcaptcha-solver\index.js line 24 change:
const hsl = await request.get('https://assets.hcaptcha.com/c/500c658/hsl.js');
to
const hsl = await request.get('https://assets.hcaptcha.com/c/b147199/hsl.js');

or in the downloaded zip file change the index.js file

@Anunayj
Copy link

Anunayj commented Jan 8, 2021

Well I got the hsl.js location just opening a website that uses hcaptcha and looking at the Network tab. It is loaded from a result of series of very heavily obfuscated code.(everything starts here) So the easiest way to automate the file location would be running that javascript in jail imo, since it doesn't change often and can be safely used for near future.

@JustTalDevelops
Copy link

Does anyone know what causes the invalid movement issues? I updated the HSL and everything and I still get them.

@Klapkaak078
Copy link

Well I got the hsl.js location just opening a website that uses hcaptcha and looking at the Network tab. It is loaded from a result of series of very heavily obfuscated code.(everything starts here) So the easiest way to automate the file location would be running that javascript in jail imo, since it doesn't change often and can be safely used for near future.

Are you able to fork this repo and update? because I cant get it work.

@FatihAraz
Copy link

FatihAraz commented Feb 2, 2021

Is there any update?
since yesterday i am not able to solve hcaptcha.
TypeError: Cannot read property 'reduce' of undefined

@FatihAraz
Copy link

I was able to solve captchas after changing some codes BUT only let in work in the browser with Browserify. Because hcaptchas new JS uses window objects which are not available in nodejs.

@JustTalDevelops
Copy link

I was able to solve captchas after changing some codes BUT only let in work in the browser with Browserify. Because hcaptchas new JS uses window objects which are not available in nodejs.

HSW? You should make your findings public

@roachadam
Copy link

@FatihAraz have you had any progress?

@FatihAraz
Copy link

The new update is working fine but you get very fast ip rate limit. My solution is a big work around. Not so useful. You have to browserify the current version. And for sending post requests to your server start chrome in security disabled mode. As i said its a big workaround but its working fine

@andress134
Copy link

The new update is working fine but you get very fast ip rate limit. My solution is a big work around. Not so useful. You have to browserify the current version. And for sending post requests to your server start chrome in security disabled mode. As i said its a big workaround but its working fine

Can u share your updates?

@FatihAraz
Copy link

FatihAraz commented Feb 7, 2021

take the new update. Take a look at http://browserify.org/. Create a html page and let it work in chrome browser (cors diabled).
To start chrome with cors disabled "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:/Chrome"
Edit: Oh i see the update is gone :( I will post a detailed update. in 10 min.

@FatihAraz
Copy link

  1. create a folder in your local server: "C:\xampp\htdocs\hcapthchaForGithub"
  2. cd the folder "cd C:\xampp\htdocs\hcapthchaForGithub"
  3. npm install hcaptcha-solver
  4. Create "app.js" with the example content in the repository
  5. open the file: "node_modules\hcaptcha-solver\index.js"
  6. Line 55: "url: https://hcaptcha.com/checksiteconfig?host=${host}&sitekey=${sitekey}&sc=1&swa=0" change to: "url: https://hcaptcha.com/checksiteconfig?host=${host}&sitekey=${sitekey}&sc=1&swa=1"
  7. Line 67: "n: await hsl(response.c.req)," change to: "n: await hsw(response.c.req),"
  8. install Browserify http://browserify.org/ (if not already installed on your system)
  9. in your working dir. "browserify app.js -o bundle.js"
  10. in your working dir ceate a new index.html file with default html content. https://gist.github.com/MrChuffmanSnippets/2043416
  11. in your html index file add: <script src="https://assets.hcaptcha.com/c/b84668aa/hsw.js"></script> AND <script src="bundle.js"></script>
  12. Start Chrome in security disabled mode: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:/Chrome"
  13. In the new chrome session visit your local server. http://localhost/hcapthchaForGithub/
  14. voila check your console you will see the result

@andress134
Copy link

  1. create a folder in your local server: "C:\xampp\htdocs\hcapthchaForGithub"
  2. cd the folder "cd C:\xampp\htdocs\hcapthchaForGithub"
  3. npm install hcaptcha-solver
  4. Create "app.js" with the example content in the repository
  5. open the file: "node_modules\hcaptcha-solver\index.js"
  6. Line 55: "url: https://hcaptcha.com/checksiteconfig?host=${host}&sitekey=${sitekey}&sc=1&swa=0" change to: "url: https://hcaptcha.com/checksiteconfig?host=${host}&sitekey=${sitekey}&sc=1&swa=1"
  7. Line 67: "n: await hsl(response.c.req)," change to: "n: await hsw(response.c.req),"
  8. install Browserify http://browserify.org/ (if not already installed on your system)
  9. in your working dir. "browserify app.js -o bundle.js"
  10. in your working dir ceate a new index.html file with default html content. https://gist.github.com/MrChuffmanSnippets/2043416
  11. in your html index file add: <script src="https://assets.hcaptcha.com/c/b84668aa/hsw.js"></script> AND <script src="bundle.js"></script>
  12. Start Chrome in security disabled mode: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:/Chrome"
  13. In the new chrome session visit your local server. http://localhost/hcapthchaForGithub/
  14. voila check your console you will see the result

Do u have any ideea how can solve it if im using agouti and chromedriver ?

@matukaking
Copy link

Does anyone know how can I submit the hCaptcha form after i get the Token?

@Anunayj
Copy link

Anunayj commented Feb 19, 2021

submit the form with h-captcha-response field set to the token.

@matukaking
Copy link

matukaking commented Feb 19, 2021

submit the form with h-captcha-response field set to the token.

Im working with Chromedriver, and I can submit the form in reCaptcha with this line of code:
driver.execute_script('___grecaptcha_cfg.clients[0].o.o.callback("'+captcha+'")')

but when I'm trying to solve hCaptcha, i dont know how to submit after i set the response like:
driver.execute_script("""
let [captcha] = arguments
document.querySelector('[name="h-captcha-response"]').innerHTML = captcha
document.querySelector('[name="g-captcha-response"]').innerHTML = captcha
document.querySelector('#challenge-form').submit()
""", captcha)
but its not working ..

@Anunayj
Copy link

Anunayj commented Feb 19, 2021

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

@matukaking
Copy link

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

And it will submit automatically?

@Anunayj
Copy link

Anunayj commented Feb 19, 2021

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

And it will submit automatically?

no, keep the rest of your code, just change the innerHTML to value

@matukaking
Copy link

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

And it will submit automatically?

no, keep the rest of your code, just change the innerHTML to value

still nothing happening, probably this line:
document.querySelector('#challenge-form').submit()
aint do nothing

@Anunayj
Copy link

Anunayj commented Feb 19, 2021

does the form have challenge-form as it's id? Use the correct ID/class/whatever way you can reference it

@matukaking
Copy link

does the form have challenge-form as it's id? Use the correct ID/class/whatever way you can reference it

No, i have just copied it from somewhere else, but there is no form at all on the page

@andress134
Copy link

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

And it will submit automatically?

no, keep the rest of your code, just change the innerHTML to value

still nothing happening, probably this line:
document.querySelector('#challenge-form').submit()
aint do nothing

does the form have challenge-form as it's id? Use the correct ID/class/whatever way you can reference it

Do u have any ideea if some wrong here, i tried with this go code, and doest work

for html, _ := page.HTML(); strings.Contains(html, "cf_chl_captcha_tk"); html, _ = page.HTML() {
if pageurl, err := page.URL(); err == nil {
answer := strings.Trim(getAnswer(pageurl, userAgent), "\n")
page.RunScript(document.getElementsByName("h-captcha-response")[0].value = " + answer + ", nil, nil)
page.RunScript("document.querySelector('.challenge-form').submit()", nil, nil)

@matukaking
Copy link

Change that to

document.querySelector('[name="h-captcha-response"]').value = captcha
document.querySelector('[name="g-captcha-response"]').value = captcha

And it will submit automatically?

no, keep the rest of your code, just change the innerHTML to value

still nothing happening, probably this line:
document.querySelector('#challenge-form').submit()
aint do nothing

does the form have challenge-form as it's id? Use the correct ID/class/whatever way you can reference it

Do u have any ideea if some wrong here, i tried with this go code, and doest work

for html, _ := page.HTML(); strings.Contains(html, "cf_chl_captcha_tk"); html, _ = page.HTML() {
if pageurl, err := page.URL(); err == nil {
answer := strings.Trim(getAnswer(pageurl, userAgent), "\n")
page.RunScript(document.getElementsByName("h-captcha-response")[0].value = " + answer + ", nil, nil)
page.RunScript("document.querySelector('.challenge-form').submit()", nil, nil)

We need to find the function from the network panel and use that to submit our token. but I dont know how to find it

@matukaking
Copy link

When I solved reCaptcha I had to call the callback function to submit the form like:
driver.execute_script('___grecaptcha_cfg.clients[0].K.K.callback("'+captca+'")')

@Anunayj
Copy link

Anunayj commented Feb 19, 2021

If you don't mind me asking, can you link to the page you're trying to submit? You can encrypt it with my GPG key: 0xCCAFEFCCCCCCCCCC, if you don't want to share it publicly.

@matukaking
Copy link

If you don't mind me asking, can you link to the page you're trying to submit? You can encrypt it with my GPG key: 0xCCAFEFCCCCCCCCCC, if you don't want to share it publicly.

discord.com/register

@Discord-Monkey
Copy link

umm something i really want to say u guys can modifiy this https://github.com/AcierP/py-hcaptcha/blob/main/hcaptcha/startup.py indeed this doesnt works anymore but hsw and hsl solves with motiondata gen was in there , the thing u need to do possible is creating image recognisation it got the lin u guys need

@reactifie
Copy link

@azgar44

Hi azgar, do you have to DIscord?

@azgaresncf
Copy link

azgaresncf commented Nov 2, 2022

@azgar44

Hi azgar, do you have to DIscord?

Yes, I have it: https://discord.com/users/817817254187892767.

@azgaresncf
Copy link

azgaresncf commented Nov 2, 2022

for now, I just surrendered because I was interested about other projects and it is currently way harder to just bypass it (the captcha)

@Vordlex
Copy link

Vordlex commented Mar 28, 2023

any update?

@edenriquez
Copy link

is there any new regarding hsw ?

@Vordlex
Copy link

Vordlex commented Apr 5, 2023

is there any new regarding hsw ?

I don't think so, I tried but it's really complicated and it would take a lot of time, so I chose to do my stuffs with puppeteer

@edenriquez
Copy link

is there any new regarding hsw ?

I don't think so, I tried but it's really complicated and it would take a lot of time, so I chose to do my stuffs with puppeteer

reversing the site where I'm trying to bypass the captcha token I notice that there is a previous call

https://hcaptcha.com/checksiteconfig?v=xxxxx&host=xxxxxxx&sitekey=xxxxxx-11111-222-3333-xxxxxxx&sc=1&swa=1

which is on charge of generate a temporal token

{"features":{},"c":{"type":"hsw","req":"temporal_token"},"pass":true}

which later is sent to https://hcaptcha.com/getcaptcha/xxxxxx-11111-222-3333-xxxxxxx alongside other params

v: ...
siteKey: ...
host: ...
hl: language_code-country
motionData: {...}
c: {"type":"hsw","req":"temporal_token"}

I'm still reversing the code but I think is possible without the approaches of using puppeteer and AI tools

@aw1875
Copy link

aw1875 commented Apr 6, 2023

is there any new regarding hsw ?

I don't think so, I tried but it's really complicated and it would take a lot of time, so I chose to do my stuffs with puppeteer

reversing the site where I'm trying to bypass the captcha token I notice that there is a previous call

https://hcaptcha.com/checksiteconfig?v=xxxxx&host=xxxxxxx&sitekey=xxxxxx-11111-222-3333-xxxxxxx&sc=1&swa=1

which is on charge of generate a temporal token

{"features":{},"c":{"type":"hsw","req":"temporal_token"},"pass":true}

which later is sent to https://hcaptcha.com/getcaptcha/xxxxxx-11111-222-3333-xxxxxxx alongside other params

v: ...
siteKey: ...
host: ...
hl: language_code-country
motionData: {...}
c: {"type":"hsw","req":"temporal_token"}

I'm still reversing the code but I think is possible without the approaches of using puppeteer and AI tools

That initial request has been part of it for quite some time now. Also, not sure what your plans are once you've reversed the code to get a feel but just a heads up that you can dynamically generate the hsl or hsw token for each request by decoding the jwt token from the request (you can check out an example from some of my old code if you're interested).

@edenriquez
Copy link

is there any new regarding hsw ?

I don't think so, I tried but it's really complicated and it would take a lot of time, so I chose to do my stuffs with puppeteer

reversing the site where I'm trying to bypass the captcha token I notice that there is a previous call
https://hcaptcha.com/checksiteconfig?v=xxxxx&host=xxxxxxx&sitekey=xxxxxx-11111-222-3333-xxxxxxx&sc=1&swa=1
which is on charge of generate a temporal token
{"features":{},"c":{"type":"hsw","req":"temporal_token"},"pass":true}
which later is sent to https://hcaptcha.com/getcaptcha/xxxxxx-11111-222-3333-xxxxxxx alongside other params

v: ...
siteKey: ...
host: ...
hl: language_code-country
motionData: {...}
c: {"type":"hsw","req":"temporal_token"}

I'm still reversing the code but I think is possible without the approaches of using puppeteer and AI tools

That initial request has been part of it for quite some time now. Also, not sure what your plans are once you've reversed the code to get a feel but just a heads up that you can dynamically generate the hsl or hsw token for each request by decoding the jwt token from the request (you can check out an example from some of my old code if you're interested).

got it, makes sense I'm just following the execution flow and letting the process run (perform the decode on c.req and all that stuff) because I was thinking it was a required file (since some of the functions seems to be the ones that parses the https://newassets.hcaptcha.com/i/6fdd2f3/e buffer response) that I think is used as part of the request params for https://hcaptcha.com/getcaptcha

Captura de Pantalla 2023-04-06 a la(s) 18 40 16

so the only value I'm missing right know is the n value, I was previously using 2captcha service but it no longer work for the site I'm bypassing so they actually recommended me to find the callback function and pass the token there

not sure if I'm saying something wrong

@aw1875
Copy link

aw1875 commented Apr 7, 2023

is there any new regarding hsw ?

I don't think so, I tried but it's really complicated and it would take a lot of time, so I chose to do my stuffs with puppeteer

reversing the site where I'm trying to bypass the captcha token I notice that there is a previous call
https://hcaptcha.com/checksiteconfig?v=xxxxx&host=xxxxxxx&sitekey=xxxxxx-11111-222-3333-xxxxxxx&sc=1&swa=1
which is on charge of generate a temporal token
{"features":{},"c":{"type":"hsw","req":"temporal_token"},"pass":true}
which later is sent to https://hcaptcha.com/getcaptcha/xxxxxx-11111-222-3333-xxxxxxx alongside other params

v: ...
siteKey: ...
host: ...
hl: language_code-country
motionData: {...}
c: {"type":"hsw","req":"temporal_token"}

I'm still reversing the code but I think is possible without the approaches of using puppeteer and AI tools

That initial request has been part of it for quite some time now. Also, not sure what your plans are once you've reversed the code to get a feel but just a heads up that you can dynamically generate the hsl or hsw token for each request by decoding the jwt token from the request (you can check out an example from some of my old code if you're interested).

got it, makes sense I'm just following the execution flow and letting the process run (perform the decode on c.req and all that stuff) because I was thinking it was a required file (since some of the functions seems to be the ones that parses the https://newassets.hcaptcha.com/i/6fdd2f3/e buffer response) that I think is used as part of the request params for https://hcaptcha.com/getcaptcha

Captura de Pantalla 2023-04-06 a la(s) 18 40 16

so the only value I'm missing right know is the n value, I was previously using 2captcha service but it no longer work for the site I'm bypassing so they actually recommended me to find the callback function and pass the token there

not sure if I'm saying something wrong

That code I provided is for generating the appropriate n token based on the type of request.

@edenriquez
Copy link

I will check it out the code, thanks @aw1875 !

@HOHOHODED
Copy link

I didn't understand anything, have you solved it? how do I get the n argument?

@Vordlex
Copy link

Vordlex commented May 19, 2023

I didn't understand anything, have you solved it? how do I get the n argument?

I think he got it for an old version, what I do (and I think it's best) is always to leave a headless browser running this function in case you need it

@HOHOHODED
Copy link

thank you very much, yesterday the hsw function for some reason did not give a result, although the argument was correct, but now everything works. Thank you

@HOHOHODED
Copy link

how to send hsw function to selenium? after all, it is called in another frame and only when debagging

I didn't understand anything, have you solved it? how do I get the n argument?

I think he got it for an old version, what I do (and I think it's best) is always to leave a headless browser running this function in case you need it
how to send hsw function to selenium? after all, it is called in another frame and only when debagging

@HOHOHODED
Copy link

That's it, I solved the problem, thank you all

@HOHOHODED
Copy link

does anyone know how to get motion data?

@azgaresncf
Copy link

azgaresncf commented Jul 8, 2023

i think it would be an idea to make a rest api for get n header automatically (for the moment)

@azgaresncf
Copy link

for anybody, it has already been done https://hcaptcha.vxxx.cf/docs

@edenriquez
Copy link

edenriquez commented Jul 10, 2023

For those who are trying to RE hcaptcha code i think this is the peak of the iceberg (n token, hsw, etc ) 😅 i've been trying to bypass hcaptcha for a couple of months now and could developed a solid method but now no longer works, as per my understanding hcaptcha has a dynamic api which is weekly updated so the code could be changed at any time, in my case looks like the fingerprint of my browser session is in their blocking rules already so for all of you out there i need to tell you that after setting your n token and assign to h-captcha-response, setting proxied connections, overpass challenges ( image recognition ) and all of that, there would be another layer of complexity which would be not being detected by their monitoring systems, if there is anyone that has already developed something for that would like to hear what was your approach.

@Romhast
Copy link

Romhast commented Jul 13, 2023

for anybody, it has already been done https://hcaptcha.vxxx.cf/docs

can you give an example how i can use this with python

@Vordlex
Copy link

Vordlex commented Jul 13, 2023

for anybody, it has already been done https://hcaptcha.vxxx.cf/docs

can you give an example how i can use this with python

This is basically just the routes you need, you can copy from the project or reverse engineer.

@Romhast
Copy link

Romhast commented Jul 14, 2023

for anybody, it has already been done https://hcaptcha.vxxx.cf/docs

can you give an example how i can use this with

for anybody, it has already been done https://hcaptcha.vxxx.cf/docs

can you give an example how i can use this with python

This is basically just the routes you need, you can copy from the project or reverse engineer.

thanks, do you know a source to generate motion data

@azgaresncf
Copy link

we have to reverse engineer webassembly module

@HOHOHODED
Copy link

anyone found the solution for the n?

Long found, read above. All that's left is motion data

@aw1875
Copy link

aw1875 commented Mar 31, 2024

The motion data isnt even a problem. Unless they've made changes recently to actually validate it against something like a bezier curve, you really only need to have some data there and for extra measure have it in the proper format ghost-cursor can generate "realistic" data if you want to be safe and its super easy to modify to add the timestamp data (I did a few years ago but not sure if that code would still work)

@HOHOHODED
Copy link

The motion data isnt even a problem. Unless they've made changes recently to actually validate it against something like a bezier curve, you really only need to have some data there and for extra measure have it in the proper format ghost-cursor can generate "realistic" data if you want to be safe and its super easy to modify to add the timestamp data (I did a few years ago but not sure if that code would still work)

Fucking hell, then why the fuck hasn't anyone answered me in a year?

@Vordlex
Copy link

Vordlex commented Mar 31, 2024

The motion data isnt even a problem. Unless they've made changes recently to actually validate it against something like a bezier curve, you really only need to have some data there and for extra measure have it in the proper format ghost-cursor can generate "realistic" data if you want to be safe and its super easy to modify to add the timestamp data (I did a few years ago but not sure if that code would still work)

ghost-cursor doesn't work well with multiple browsers (at least my experience with it says so)

@flaryx32
Copy link

updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests