phamleduy04 / texas-dps-scheduler

Texas DPS/DMV Automatic Scheduler
MIT License
267 stars 117 forks source link

Auth endpoint changes #175

Open phamleduy04 opened 3 weeks ago

phamleduy04 commented 3 weeks ago

Just take a look, they introduced new changes on the /auth endpoint which validated the captcha token correctly. There is some workaround for this since this might lead to the use of external services.

Originally posted by @phamleduy04 in https://github.com/phamleduy04/texas-dps-scheduler/issues/174#issuecomment-2296974804

phamleduy04 commented 3 weeks ago

Currently, my approach is something in the middle of both things I mentioned above, the bot will support both functions.

The config will have an option for you to either choose captcha solver or automatically grab the auth token. If the automatically grab token feature fails and captcha solver settings are set up, it will fall back to the captcha solver steps.

If anyone has a better idea please let me know by commenting here or emailing dui@agentbot.xyz. Thanks šŸ‘

zerowebcorp commented 3 weeks ago

I tested with a Puppeteer similar approach ( using Selenium) however, reCaptcha was able to detect that it is not a human

phamleduy04 commented 3 weeks ago
Captcha type: Recaptcha Enterprise
Sitekey: 6LesF7oaAAAAAEvJD0hjmTUib8Q5PGjTo54U2ieP
Website: https://public.txdpsscheduler.com/
phamleduy04 commented 3 weeks ago

I tested with a Puppeteer similar approach ( using Selenium) however, reCaptcha was able to detect that it is not a human

Did you try the puppeteer code that I already have on the app (but commented). This use Puppeteer stealth mode which make it harder to detect.

The code I mentioned is located here

Perksey commented 3 weeks ago

Note that SiteData indicates that the token expires every 20 minutes. The CATPCHA token can't be reused.

phamleduy04 commented 3 weeks ago

@Perksey , Yeah I know the auth token has an expiration but I don't know how long so thank you for letting me know. After the token expires we can just grab the new token using those tactics above and we can grab another token.

zxc2012 commented 3 weeks ago

pageurl: "https://public.txdpsscheduler.com/" sitekey: "6LesF7oaAAAAAEvJD0hjmTUib8Q5PGjTo54U2ieP" version: "V3"

phamleduy04 commented 3 weeks ago

@zxc2012 is that v3 or enterprise? cause I saw when getting the token the app request to https://www.google.com/recaptcha/enterprise/reload

zxc2012 commented 3 weeks ago

I've successfully obtained the captcha using enterprise v3.

@zxc2012 is that v3 or enterprise? cause I saw when getting the token the app request to https://www.google.com/recaptcha/enterprise/reload

phamleduy04 commented 3 weeks ago

@zxc2012 it is v3, just solve it.But I still got 401 unauth when sending a request to /auth endpoint with the solved captcha token. Maybe my IP got blocked?

zxc2012 commented 3 weeks ago

Yes. I'm also stuck at this point LoL.

@zxc2012 it is v3, just solve it.But I still got 401 unauth when sending a request to /auth endpoint with the solved captcha token. Maybe my IP got blocked?

phamleduy04 commented 3 weeks ago

it is not IP banned because the official one still returning good data. might be the URL is wrong, I will try some of the URLs soon.

found this on source code

          , E = {
            local: "https://localhost:44339/api/",
            dev: "https://txpublicwebsiteapi-dev.azurewebsites.us/api/",
            qa: "https://txpublicwebsiteapi-qa.azurewebsites.us/api/",
            preview: "https://txpublicwebsiteapi-preview.azurewebsites.us/api/",
            stage: "https://txpublicwebsiteapi-stage.azurewebsites.us/api/",
            production: "https://apptapi.txdpsscheduler.com/api/"
        };
Ceroshow commented 3 weeks ago

Hello Guys, is the fisrt time that i want to use this tool, but i don't understand how can i get the token. can someone please told me how can i do it ?

zerowebcorp commented 3 weeks ago

Both 2captcha and capsolver don't work. Well, it generated the recaptch token but the /auth endpoint is failing with it.

zerowebcorp commented 3 weeks ago

I tested with a Puppeteer similar approach ( using Selenium) however, reCaptcha was able to detect that it is not a human

Did you try the puppeteer code that I already have on the app (but commented). This use Puppeteer stealth mode which make it harder to detect.

The code I mentioned is located here

Yes tried it by uncommenting. It did generate the captch token however receiving 403 on the next step.

Perksey commented 3 weeks ago

Maybe they're validating the IP address the CAPTCHA was solved using? Have you tried obtaining the token, then performing the auth request through 2Captcha's proxy?

phamleduy04 commented 3 weeks ago

I dont want to pay for it, but i will try do to it local

zerowebcorp commented 3 weeks ago

I dont want to pay for it, but i will try do to it local

I can probably give you an API key for you to try out. I've already paid a couple of bucks to test.

phamleduy04 commented 3 weeks ago

I have an 2captcha api key, i just dont want to pay for the proxy

Perksey commented 3 weeks ago

You can use a free proxy. You could even setup a HTTP proxy on your local machine (for testing), open that up to the world using ngrok or something, and tell 2Captcha to use that.

phamleduy04 commented 3 weeks ago

make sense šŸ‘

phamleduy04 commented 3 weeks ago

2captcha doesn't support v3 with proxy. I will try capsolver then

phamleduy04 commented 3 weeks ago

easier way, i use burp to "stop" the request from sending to /auth endpoint then get the token, might easier

phamleduy04 commented 3 weeks ago

So I got the token, then turned on the VPN and sent the request, but the request still passed on my side.

zerowebcorp commented 3 weeks ago

So I got the token, then turned on the VPN and sent the request, but the request still passed on my side.

What method did you use to generate the token? I used your puppeteer script, the token it generated failed the /auth endpoint.

phamleduy04 commented 3 weeks ago

@zerowebcorp, I use burp to stop the request when the frontend is trying to communicate to the backend. Then I extracted the token and used another HTTP client to send the request to see if I can get the token

yoyoy74662000 commented 3 weeks ago

@zerowebcorp, I use burp to stop the request when the frontend is trying to communicate to the backend. Then I extracted the token and used another HTTP client to send the request to see if I can get the token

@phamleduy04 are you going to release new version soon?

phamleduy04 commented 3 weeks ago

@yoyoy74662000 , I have not found a solution yet. Will update here if I found something

NeatPopular commented 3 weeks ago

Hey, thanks for work you've put into this bot for us! @phamleduy04

As this is my first time, could anyone explain to me how to run the code after the fix has been published?

zerowebcorp commented 3 weeks ago

Looks like this is it. :( Time to move on?

zxc2012 commented 2 weeks ago

image For anyone who wants to test, you can simply put the recaptch token into this callback function and paste it into console. That serves as the same for POST /api/auth ___grecaptcha_cfg.clients['100000']['L']['L']['promise-callback']('Your token')

It's very clear that they added a minscore requirement for the auth endpoint. I even tried the minscore 0.9 version and it didn't work.

yousefa00 commented 2 weeks ago

@zerowebcorp, I use burp to stop the request when the frontend is trying to communicate to the backend. Then I extracted the token and used another HTTP client to send the request to see if I can get the token

@phamleduy04 to clarify, did you confirm that they are checking the captcha and request are made from the same ip / proxy? Is this the issue?

phamleduy04 commented 2 weeks ago

@yousefa00 can you check it again? I did but I might do something wrong in the process

khaiuy2005 commented 2 weeks ago

So I tried to run the code through githup and locally. All end up with 403. Can't even schedule on the officals website bc TypeError: Cannot read properties of undefined (reading 'data'). It's doom

nigelthurlow commented 2 weeks ago

I have used CapSolver to get the captch3 code. Same issues. 403.

zerowebcorp commented 2 weeks ago

Captcha solvers don't work, let's not waste money.

nigelthurlow commented 2 weeks ago

So is there any solution or is this a dead end now? If anyone knows how to make this work Iā€™m happy to have a chat. I may even hire you.

zerowebcorp commented 2 weeks ago

What they have implemented is reCaptcha V3 which validates user actions and generates a score that tells the backend whether it is a human or bot. If you want to beat the reCaptcha which is a product from Google to block bots which this app is, you need to be smarter than the people at Google.

So is there any solution or is this a dead end now? If anyone knows how to make this work Iā€™m happy to have a chat. I may even hire you.

nigelthurlow commented 2 weeks ago

What they have implemented is reCaptcha V3 which validates user actions and generates a score that tells the backend whether it is a human or bot. If you want to beat the reCaptcha which is a product from Google to block bots which this app is, you need to be smarter than the people at Google.

So is there any solution or is this a dead end now? If anyone knows how to make this work Iā€™m happy to have a chat. I may even hire you.

So this project is now at a dead end with no further development planned?

phamleduy04 commented 2 weeks ago

@nigelthurlow , I would say that. Even if we can find a way to implement this, it will be costly and even harder to use for non-technical users.

phamleduy04 commented 2 weeks ago

I will archive this repo and if someone finds something, email me at dui@agentbot.xyz. It's great working with u guys šŸ‘