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

Custom scrape rule to extract status code not working.. #749

Open
intrd opened this issue Oct 24, 2023 · 1 comment
Open

Custom scrape rule to extract status code not working.. #749

intrd opened this issue Oct 24, 2023 · 1 comment

Comments

@intrd
Copy link

intrd commented Oct 24, 2023

ffuf version:
v2.1.0-dev

Hey guys, I am trying to create a custom scrape rule to extract the HTTP code from the response and other elements like the Title from the body and the full URL and Location from the header. However, this rule is not functioning properly. Can you please help me understand why?

...
{
  "name": "status_code",
  "rule": "^HTTP\\/\\d\\.\\d\\s+(\\d+)\\s+.*$",
  "target": "headers",
  "type": "regexp",
  "onlymatched": true,
  "action": ["output"]
}
...

Thank you.

@intrd
Copy link
Author

intrd commented Oct 25, 2023

So, found the problem..
Debugging with:

...
{
      "name": "xDUMP",
      "rule": ".*",
      "target": "headers",
      "type": "regexp",
      "onlymatched": true,
      "action": ["output"]
}
...

I have noticed that the scraper "headers" are missing the first line of the response "HTTP/1.1 200 OK".

image

** Also, I am unable to extract information from the "request," such as the used method.

Yes, I know that I can use the -o option to save the requests/responses to a file and then work with that. However, I was specifically using the -scraperfile option to create a completely customized output on runtime.

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

No branches or pull requests

1 participant