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

Inability to List Both Normal URLs and Extensions in a Single Operation #764

Open
swdbo opened this issue Feb 15, 2024 · 2 comments
Open
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@swdbo
Copy link

swdbo commented Feb 15, 2024

Katana Version:

v1.0.5

Current Behavior:

Currently, Katana does not provide a way to list both normal URLs and specific file extensions in one operation. Users can either obtain a list of URLs using the default settings or apply the extension match option (-em) to filter for specific file extensions. However, when using -em, URLs without an extension are omitted from the final output.

Desired Behavior:

Modify Katana's behavior to list all URLs and file extensions by default. Introduce functionality for the -em option to serve as a filter that includes only the specified file extensions in the output. This change would allow users to see the complete set of resources initially and have the option to narrow down the results based on specific extension criteria, enhancing usability and flexibility.

Steps To Reproduce (Current Behavior):

  1. Run Katana with the command: katana -u https://chaos.projectdiscovery.io -headless -depth 2
  2. Observe that only URLs are listed, and file extensions are not included.
  3. Execute Katana with extension filtering: katana -u https://chaos.projectdiscovery.io -headless -depth 2 -em css,js,ico,jpg,png,html
  4. Notice the inclusion of specified extensions in the results, but URLs without an extension are missing.

Results

katana -u https://chaos.projectdiscovery.io -headless -depth 2 

https://chaos.projectdiscovery.io
https://chaos.projectdiscovery.io/app.bundle.css
https://chaos.projectdiscovery.io/app.js
katana -u https://chaos.projectdiscovery.io -headless -depth 2 -em css,js,ico,jpg,png,html 

https://chaos.projectdiscovery.io/fevicon.png
https://chaos.projectdiscovery.io/app.bundle.css
https://chaos.projectdiscovery.io/app.js
https://chaos.projectdiscovery.io/361bc8b680f5b7c8f0bd7fb587ea7666.png
https://chaos.projectdiscovery.io/326b684b7243f6148e7ec7dcd3ba1d5b.png
https://chaos.projectdiscovery.io/e9b61c5e5a0c43cdcd96fcc568af8e36.png

Proposed Fix:

Implement changes to the crawling and listing mechanism to display all accessible URLs and assets by default. Adjust the -em flag functionality to act as a post-crawl filter that refines the output to include only the assets with the specified extensions. This approach ensures a comprehensive view of the site's resources is available by default, with the flexibility to focus on specific types of files as needed.

Benefits:

  • Provides a complete overview of all site resources without the need to run multiple commands.
  • Enhances user efficiency by simplifying the process of targeting specific file types.
  • Improves Katana's flexibility and adaptability to different use cases.
@swdbo swdbo added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 15, 2024
@olearycrew
Copy link
Contributor

Thanks for this issue @swdbo - I do think this is intended behavior but your ideas could be great enhancements.

@olearycrew
Copy link
Contributor

cc @Mzack9999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

2 participants