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

Patch: Add the Stored Response Path as Key in JSON Output #532

Conversation

ErikOwen
Copy link
Contributor

@ErikOwen ErikOwen commented Jul 21, 2023

Fixes #530

Sample (notice the stored_response_path key at the bottom):

> echo "https://www.google.com" | ./katana -d 1 -jsonl -sr -ob -or | jq

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

                projectdiscovery.io

[INF] Current katana version v1.0.2 (latest)
[INF] Started standard crawling for => https://www.google.com
{
  "timestamp": "2023-07-21T15:08:21.805182-07:00",
  "request": {
    "method": "GET",
    "endpoint": "https://www.google.com"
  },
  "response": {
    "status_code": 200,
    "headers": {
      "x_xss_protection": "0",
      "date": "Fri, 21 Jul 2023 22:08:21 GMT",
      "server": "gws",
      "set_cookie": "1P_JAR=2023-07-21-22; expires=Sun, 20-Aug-2023 22:08:21 GMT; path=/; domain=.google.com; Secure; SameSite=none;AEC=Ad49MVGE-wtY18YSzXtjF6BZNA_DMntnRsDIXDnmKnPaAxtrnBaGnT3kLC4; expires=Wed, 17-Jan-2024 22:08:21 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax;NID=511=rKpRB0xS_gf_Lzok4INecO2tnc-6frQYSlh2686isBcvaDpuTbDchviHET3mWsrWPu2Ecaa9N3TvqZIEkHFrrOb1oz7_47iw2Bxq0-OsehBnVdAZFcjRqVSAP4b3wLdFhUJaKJQ08HEFQ91TktlVnigyA2iivGEMMdtbsJZFcKE; expires=Sat, 20-Jan-2024 22:08:21 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none",
      "alt_svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
      "content_type": "text/html; charset=UTF-8",
      "content_security_policy_report_only": "object-src 'none';base-uri 'self';script-src 'nonce-eV1WfONAJSJYXqGu6QTK8Q' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp",
      "p3p": "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"",
      "strict_transport_security": "max-age=31536000",
      "origin_trial": "Ap+qNlnLzJDKSmEHjzM5ilaa908GuehlLqGb6ezME5lkhelj20qVzfv06zPmQ3LodoeujZuphAolrnhnPA8w4AIAAABfeyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJQZXJtaXNzaW9uc1BvbGljeVVubG9hZCIsImV4cGlyeSI6MTY4NTY2Mzk5OX0=;AvudrjMZqL7335p1KLV2lHo1kxdMeIN0dUI15d0CPz9dovVLCcXk8OAqjho1DX4s6NbHbA/AGobuGvcZv0drGgQAAAB9eyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJCYWNrRm9yd2FyZENhY2hlTm90UmVzdG9yZWRSZWFzb25zIiwiZXhwaXJ5IjoxNjkxNTM5MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0=",
      "cache_control": "private, max-age=0",
      "cross_origin_opener_policy": "same-origin-allow-popups; report-to=\"gws\"",
      "expires": "-1",
      "report_to": "{\"group\":\"gws\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/gws/other\"}]}",
      "permissions_policy": "unload=()",
      "x_frame_options": "SAMEORIGIN"
    },
    "technologies": [
      "HSTS",
      "Google Web Server",
      "HTTP/3"
    ],
    "stored_response_path": "katana_response/www.google.com/ef7efc9839c3ee036f023e9635bc3b056d6ee2db.txt"
  }
}

@ErikOwen ErikOwen changed the base branch from main to dev July 21, 2023 22:19
@ehsandeep ehsandeep added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label Jul 31, 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.

@ErikOwen, to keep it uniform as httpx, we can store the complete file path for stored_response_path

@ErikOwen
Copy link
Contributor Author

ErikOwen commented Aug 1, 2023

@ehsandeep - good catch. I have updated the stored_response_path to be the absolute path in c617126:

> echo "https://www.google.com" | ./katana -d 1 -jsonl -sr -ob -or | jq

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

                projectdiscovery.io

[INF] Current katana version v1.0.3-dev (development)
[INF] Started standard crawling for => https://www.google.com
{
  "timestamp": "2023-07-31T17:45:54.784419-07:00",
  "request": {
    "method": "GET",
    "endpoint": "https://www.google.com"
  },
  "response": {
    "status_code": 200,
    "headers": {
      "origin_trial": "Ap+qNlnLzJDKSmEHjzM5ilaa908GuehlLqGb6ezME5lkhelj20qVzfv06zPmQ3LodoeujZuphAolrnhnPA8w4AIAAABfeyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJQZXJtaXNzaW9uc1BvbGljeVVubG9hZCIsImV4cGlyeSI6MTY4NTY2Mzk5OX0=;AvudrjMZqL7335p1KLV2lHo1kxdMeIN0dUI15d0CPz9dovVLCcXk8OAqjho1DX4s6NbHbA/AGobuGvcZv0drGgQAAAB9eyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJCYWNrRm9yd2FyZENhY2hlTm90UmVzdG9yZWRSZWFzb25zIiwiZXhwaXJ5IjoxNjkxNTM5MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0=",
      "p3p": "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"",
      "content_security_policy_report_only": "object-src 'none';base-uri 'self';script-src 'nonce-mMqaOmkJMHQT62CDkUxG_A' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp",
      "x_xss_protection": "0",
      "content_type": "text/html; charset=UTF-8",
      "permissions_policy": "unload=()",
      "alt_svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
      "date": "Tue, 01 Aug 2023 00:45:54 GMT",
      "cross_origin_opener_policy": "same-origin-allow-popups; report-to=\"gws\"",
      "cache_control": "private, max-age=0",
      "set_cookie": "1P_JAR=2023-08-01-00; expires=Thu, 31-Aug-2023 00:45:54 GMT; path=/; domain=.google.com; Secure; SameSite=none;AEC=Ad49MVF-bRZewUZyz8NoZ--9gw99e642PplmmaquRLVxKiSayS4XSskl-dI; expires=Sun, 28-Jan-2024 00:45:54 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax;NID=511=uu58xLyieXpujR6-25wgT3m0y0ZBJ4yxaK2d6cillwv93IxFLDdNX95visfxfEx7R9XHP7koESUmSbW8ncqthv1MRgPp-iMeaX-a008F84reA9BuRmJ-5zs3CNsyvaYQnb-gmw5Ga0dptxGYzp5aR7Wmu8osga36H67Hf55nrDg; expires=Wed, 31-Jan-2024 00:45:54 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none",
      "expires": "-1",
      "strict_transport_security": "max-age=31536000",
      "report_to": "{\"group\":\"gws\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/gws/other\"}]}",
      "x_frame_options": "SAMEORIGIN",
      "server": "gws"
    },
    "technologies": [
      "Google Web Server",
      "HTTP/3",
      "HSTS"
    ],
    "stored_response_path": "/Path/to/directory/where/I/ran/katana/katana_response/www.google.com/ef7efc9839c3ee036f023e9635bc3b056d6ee2db.txt"
  }
}

@ehsandeep ehsandeep merged commit 743d073 into projectdiscovery:dev Aug 1, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stored Response Path Not in JSON Output When Using "-sr" and "-jsonl" Flags
3 participants