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

Added option to log XHR requests. #481

Merged
merged 7 commits into from
Jun 19, 2023

Conversation

aristosMiliaressis
Copy link
Contributor

Added the following option to log xhr requests

-xhr, -xhr-extraction             extract xhr requests

Screenshot from 2023-06-17 13-01-02

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 main.go -j -or -ob -hl -xhr -u http://localhost:8000/test.html | jq

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

                projectdiscovery.io

[INF] Current katana version v1.0.3-dev (development)
[INF] Started headless crawling for => http://localhost:8000test.html
{
  "timestamp": "2023-06-19T08:06:05.87752038Z",
  "request": {
    "method": "GET",
    "endpoint": "http://localhost:8000/test.html"
  },
  "response": {
    "status_code": 200,
    "headers": {
      "last_modified": "Mon, 19 Jun 2023 08:05:28 GMT",
      "server": "SimpleHTTP/0.6 Python/2.7.18",
      "date": "Mon, 19 Jun 2023 08:06:05 GMT",
      "content_type": "text/html",
      "content_length": "267"
    },
    "technologies": [
      "Python:2.7.18",
      "SimpleHTTP:0.6"
    ],
    "xhr_requests": [
      {
        "url": "http://scanme.sh/",
        "method": "GET"
      }
    ]
  }
}

test.html:

<!DOCTYPE html>
<html>
  <head>
    <title>Scanme.sh XHR Request</title>
    <script>
    const req = new XMLHttpRequest();
    req.open("GET", "http://scanme.sh");
    req.send();
    </script>
  </head>
  <body>
    <h1>Scanme.sh XHR Request</h1>
  </body>
</html>

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

lgtm - Note: the current implementation is redundant with the headless crawling logic but temporarily necessary until graph navigation is implemented.

@Mzack9999 Mzack9999 merged commit 11af8cc into projectdiscovery:dev Jun 19, 2023
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.

5 participants