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

Allow to show response headers in json output without using -irh option #1326

Merged
merged 8 commits into from
Sep 11, 2023
Merged

Allow to show response headers in json output without using -irh option #1326

merged 8 commits into from
Sep 11, 2023

Conversation

JoshuaMart
Copy link
Contributor

@JoshuaMart JoshuaMart commented Aug 18, 2023

Hi,
This PR add the -irh / -include-response-headers option to display the response headers without having to use -irr

This option allow to reduces the output size as -irr also includes the response body, which can considerably increase the size of the JSON if many targets are scanned.

I'm also taking advantage of this PR to pluralize some variables concerning headers.

@JoshuaMart JoshuaMart changed the title Feature/headers json output Allo to show response headers in json output without using -irr Aug 18, 2023
Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

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

LGTM

$ go run . -u scanme.sh -json -irh | jq .

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

                projectdiscovery.io

[INF] Current httpx version v1.3.4 (latest)
{
  "timestamp": "2023-09-01T11:29:38.211469631Z",
  "hash": {
    "body_md5": "444bcb3a3fcf8389296c49467f27e1d6",
    "body_mmh3": "-2088429648",
    "body_sha256": "2689367b205c16ce32ed4200942b8b8b1e262dfc70d9bc9fbc77c49699a4f1df",
    "body_simhash": "590632390773907579",
    "header_md5": "61f86158e2e9d13ba5b291bfff646c08",
    "header_mmh3": "-703836329",
    "header_sha256": "2011c02f1d5542dda7089129117589fc639608cd3a9812e85c9b5818ecef36fc",
    "header_simhash": "9814386056708734847"
  },
  "port": "443",
  "url": "https://scanme.sh",
  "input": "scanme.sh",
  "scheme": "https",
  "content_type": "text/plain",
  "method": "GET",
  "host": "128.199.158.128",
  "path": "/",
  "headers": {
    "content_length": "2",
    "content_type": "text/plain; charset=utf-8",
    "date": "Fri, 01 Sep 2023 11:29:38 GMT"
  },
  "time": "1.153600667s",
  "a": [
    "128.199.158.128",
    "2400:6180:0:d0::91:1001"
  ],
  "words": 1,
  "lines": 1,
  "status_code": 200,
  "content_length": 2,
  "failed": false,
  "knowledgebase": {
    "PageType": "nonerror"
  }
}

runner/runner.go Outdated Show resolved Hide resolved
runner/types.go Outdated Show resolved Hide resolved
@ehsandeep ehsandeep added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Sep 7, 2023
@ehsandeep ehsandeep changed the title Allo to show response headers in json output without using -irr Allow to show response headers in json output without using -irh option Sep 7, 2023
@Mzack9999 Mzack9999 linked an issue Sep 11, 2023 that may be closed by this pull request
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.

Add option to include response headers
4 participants