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 option to parse form, input, textarea & select elements #464

Merged
merged 4 commits into from
Jun 13, 2023

Conversation

aristosMiliaressis
Copy link
Contributor

Added the following option to parse forms

   -fx, -form-extraction        enable extraction of form, input, textarea & select elements

output format

forms": [                                                                                                                                                                                                       
  {                                                                                                                                                                                                              
    "method": "POST",                                                                                                                                                                                            
    "action": "/test",                                                                                                                                                                                           
    "parameters": [                                                                                                                                                                                              
      "firstname",                                                                                                                                                                                               
      "textarea1",                                                                                                                                                                                               
      "select1"                                                                                                                                                                                                  
    ]                                                                                                                                                                                                            
  }                                                                                                                                                                                                              
]

@ehsandeep ehsandeep added the Type: Enhancement Most issues will probably ask for additions or changes. label Jun 12, 2023
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.

@aristosMiliaressis looks very useful.

we can keep the inconsistent request method in the output uniform following CAPS for the method.

Current:

cat output | jq '.response.forms[].method' | sort -u

"GET"
"POST"
"get"
"post"

Expected:

cat output | jq '.response.forms[].method' | sort -u

"GET"
"POST"

@aristosMiliaressis
Copy link
Contributor Author

Hi @ehsandeep , thanks for the quick response, i just committed the change you suggested

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 !

@aristosMiliaressis thanks for PR and adding this awesome feature

$ ./katana -u https://www.hackerone.com/contact -fx -j  -or -ob | jq '.response.forms | select( . != null )'

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

		projectdiscovery.io

[INF] Current katana version v1.0.2-dev (outdated)
[INF] Started standard crawling for => https://www.hackerone.com/contact
[
  {
    "method": "POST",
    "action": "/product/insights",
    "parameters": [
      "email",
      "op",
      "form_build_id",
      "form_id",
      "url"
    ]
  }
]
[
  {
    "method": "POST",
    "action": "/ethical-hacker",
    "parameters": [
      "email",
      "op",
      "form_build_id",
      "form_id",
      "url"
    ]
  }
]

@ehsandeep ehsandeep linked an issue Jun 13, 2023 that may be closed by this pull request
@ehsandeep ehsandeep added this to the katana v1.0.3 milestone Jun 13, 2023
@ehsandeep ehsandeep merged commit 25dae9d into projectdiscovery:dev Jun 13, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adds option to parse form, input, textarea & select elements
3 participants