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

ReCaptcha bypass #2

Open
meta-ks opened this issue Jun 8, 2019 · 4 comments
Open

ReCaptcha bypass #2

meta-ks opened this issue Jun 8, 2019 · 4 comments

Comments

@meta-ks
Copy link

meta-ks commented Jun 8, 2019

This is a very nice wrapper, especially the fuzzy match.
Recently irctc and Indian rail started using recaptcha which puts all such apis at halt. Any thougths on how we can get around recaptcha ?

@PrinceKumar10498
Copy link

URL in API_ENDPOINT present in utils.py is not working.

@meta-ks
Copy link
Author

meta-ks commented Sep 21, 2019

URL in API_ENDPOINT present in utils.py is not working.

Can you elaborate? The API seems fine.

Request:

GET /enquiry/CommonCaptcha?inputCaptcha=419&inputPnrNo=3333333333&inputPage=PNR&language=en HTTP/1.1
Host: www.indianrail.gov.in
Connection: keep-alive
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: some valid UA
rcheck: 03AOLTBLQEjcVPk3C3RQKMmRau7Ws5uFmF2ZO8n-kR9tWW1etgqm5d22YRe4b5_BNbMKN1nLngSrKh_94cpndnqfqKDf65v8P08-2UWikyAeGow_gXdf2FUbPG5VB5fOWUw2lGibRU9ypWN-OYg5_rLoVOI7wwh_mX67vhploJTtt1nUtXnGvrs84g0vgms3pK1ORnoaAiFVgAM5H-t6am6jPJ7AnW4MczxJwxL1UZu36lJ-h_1ohEnw87x_6OIEIWlyFUuiI3r6d5ZNtIjA3jO2PTGEyUmc4k0skBoKHP6EVE8IB79ax9OX3KSJ-iCyP5f0_aojmS24hgEGVbc8nBEQTnsT7Fdd8hgz-E-42L1--uTlXzEgofkthHOVcDsJ0vOf3xadS7EXnZv4gt2DWDqECodH5o4DedyFCkgNDegbEoOKQCJ7DmiLzf8t8GOlToLiLlY2fd0aEA
Referer: http://www.indianrail.gov.in/enquiry/PNR/PnrEnquiry.html?locale=en
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: JSESSIONID=kc0LNgytQnR0fpB1_t7nQpmR8KxUOwGRUKsyYGmt.host6:server6-2; f5avrbbbbbbbb.......... a lot of them

Response:

{"errorMessage": "PNR No. is not valid","serverId": "appserver","generatedTimeStamp":{"year":2019,"month":9,"day":21,"hour":17,"minute":0,"second":4}}

N.B. See the rcheck header, That's the standard ReCaptcha token. If somehow there is a workaround , the rest of @nikhilkumarsingh 's code needs minimal modification.

@PrinceKumar10498
Copy link

URL in API_ENDPOINT present in utils.py is not working.

Can you elaborate? The API seems fine.

Request:

GET /enquiry/CommonCaptcha?inputCaptcha=419&inputPnrNo=3333333333&inputPage=PNR&language=en HTTP/1.1
Host: www.indianrail.gov.in
Connection: keep-alive
Accept: */*
X-Requested-With: XMLHttpRequest
User-Agent: some valid UA
rcheck: 03AOLTBLQEjcVPk3C3RQKMmRau7Ws5uFmF2ZO8n-kR9tWW1etgqm5d22YRe4b5_BNbMKN1nLngSrKh_94cpndnqfqKDf65v8P08-2UWikyAeGow_gXdf2FUbPG5VB5fOWUw2lGibRU9ypWN-OYg5_rLoVOI7wwh_mX67vhploJTtt1nUtXnGvrs84g0vgms3pK1ORnoaAiFVgAM5H-t6am6jPJ7AnW4MczxJwxL1UZu36lJ-h_1ohEnw87x_6OIEIWlyFUuiI3r6d5ZNtIjA3jO2PTGEyUmc4k0skBoKHP6EVE8IB79ax9OX3KSJ-iCyP5f0_aojmS24hgEGVbc8nBEQTnsT7Fdd8hgz-E-42L1--uTlXzEgofkthHOVcDsJ0vOf3xadS7EXnZv4gt2DWDqECodH5o4DedyFCkgNDegbEoOKQCJ7DmiLzf8t8GOlToLiLlY2fd0aEA
Referer: http://www.indianrail.gov.in/enquiry/PNR/PnrEnquiry.html?locale=en
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: JSESSIONID=kc0LNgytQnR0fpB1_t7nQpmR8KxUOwGRUKsyYGmt.host6:server6-2; f5avrbbbbbbbb.......... a lot of them

Response:

{"errorMessage": "PNR No. is not valid","serverId": "appserver","generatedTimeStamp":{"year":2019,"month":9,"day":21,"hour":17,"minute":0,"second":4}}

N.B. See the rcheck header, That's the standard ReCaptcha token. If somehow there is a workaround , the rest of @nikhilkumarsingh 's code needs minimal modification.

Actually I tried fetching trains between stations but when I run the code it gives Invalid Request. How can I solve this issue can you please tell.

@BijayaKumarTiadi
Copy link

remake everything

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

3 participants