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

Adds flag to allow katana to use an existing Chrome instance #490

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

DanielIntruder
Copy link
Contributor

This PR adds the -cwu/-chrome-ws-url flag to allow katana to connect to a running Chrome instance instead of launching a new one. This allows for authenticated spidering by reusing a browser session where you're already logged in on a website.

For testing, you can launch chrome with the --debug-devtools and --remote-debugging-port flags, e.g. on macOS:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=$(mktemp -d) --debug-devtools --remote-debugging-port=9222

This will give a debugging URL which can be used with the -cwu flag in katana:

katana -headless -u https://blog.long.lat -cwu ws://127.0.0.1:9222/devtools/browser/8b1fccef-4d3e-4ca6-b2df-63601f277868 -no-incognito

Running this should show katana using the existing browser session.

@ehsandeep ehsandeep changed the base branch from main to dev June 22, 2023 14:43
@ehsandeep ehsandeep linked an issue Jun 27, 2023 that may be closed by this pull request
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanielIntruder, this looks useful; thank you for adding this! Probably useful in the context of #310 as well.

@ehsandeep ehsandeep added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Jun 27, 2023
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !!

$ ./katana -cwu "ws://127.0.0.1:9222/devtools/browser/79bc6238-6181-4311-8057-ed8b17bd9f2f" -noi -u https://tesla.com

   __        __                
  / /_____ _/ /____ ____  ___ _
 /  '_/ _  / __/ _  / _ \/ _  /
/_/\_\\_,_/\__/\_,_/_//_/\_,_/							 

		projectdiscovery.io

[INF] Current katana version v1.0.3-dev (development)
[INF] Started standard crawling for => https://tesla.com
https://www.tesla.com/
https://tesla.com

@ehsandeep ehsandeep removed the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Jun 28, 2023
@ehsandeep ehsandeep merged commit bdfdc81 into projectdiscovery:dev Jun 28, 2023
@DanielIntruder
Copy link
Contributor Author

Thank you for the tidying up and the merge. Much appreciated

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

Successfully merging this pull request may close these issues.

Adds flag to allow katana to use an existing Chrome instance
3 participants