feat: add request.post_json command for same-origin JSON fetch via browser - #1745
Open
baotran152 wants to merge 1 commit into
Open
feat: add request.post_json command for same-origin JSON fetch via browser#1745baotran152 wants to merge 1 commit into
baotran152 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
cmdvaluerequest.post_jsonthat sends a JSON POST requestfrom within the browser's page context using
fetch(), after Cloudflarechallenge resolution.
Why
Some endpoints (e.g. sploitus.com/search) require an interactive Cloudflare
Turnstile token and session cookies that are only present in a live, solved
browser session. A plain HTTP POST from the host cannot carry those credentials.
By running
fetch()from inside Chrome after the challenge is solved, therequest is same-origin and all cookies and tokens are included automatically.
Key changes
dtos.py: addedjsonBody: str = Nonefield toV1RequestBaseflaresolverr_service.py: addedrequest.post_jsondispatcher branch_cmd_request_post_jsonhandler:_resolve_challenge(solves CF)fetch()POST withContent-Type: application/jsonviaexecute_async_script{s: <status>, b: <body>}envelope assolution.responseThe
sessionparameter is mandatory - the caller must create a session firstand pass its ID, so the driver is preserved between the navigation and the fetch.
Testing
Tested against
https://sploitus.com/search(Cloudflare Bot Management +interactive Turnstile). The command navigated to the origin, solved the
challenge, and returned HTTP 200 with valid JSON exploit results.