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

Don't write missing screenshots to index file #1193

Merged
merged 1 commit into from
May 26, 2023

Conversation

dogancanbakir
Copy link
Member

The screenshots in index_screenshot.txt do not correspond with the files in the screenshot directory. The error causing this issue is that ScreenshotWithBody returns context deadline exceeded for the following URLs:

  1. https://www.maglaj.ba/ba/investitori.php?id=%22%3E%3Cimg%20src=x%20onerror=alert(1);%3E
  2. https://maglaj.ba/ba/investitori.php?id=%22%3E%3Cimg%20src=x%20onerror=alert(1);%3E

And we are initializing the screenshotPath regardless of whether there is an error and returning it. Thus, we write it to the index_screenshot.txt file. There are two issues, actually:

  1. Screenshot mismatch, as mentioned in the beginning
  2. context deadline exceeded: we're getting an error when trying to capture a screenshot of the page with ScreenshotWithBody- the root cause.

To repro the issue(from #1125):

subfinder -d maglaj.ba | httpx -silent -path "/ba/investitori.php?id=%22%3E%3Cimg%20src=x%20onerror=alert(1);%3E" -mc 200 -follow-redirects -screenshot

I was able to fix the first issue by avoiding the initialization of screenshotPath beforehand. I'll further investigate the root cause.

@dogancanbakir dogancanbakir self-assigned this May 26, 2023
@Mzack9999 Mzack9999 linked an issue May 26, 2023 that may be closed by this pull request
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

$ go run . -silent -path "/ba/investitori.php?id=%22%3E%3Cimg%20src=x%20onerror=alert(1);%3E" -mc 200 -follow-redirects -screenshot -u http://192.168.1.1

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Httpx -path option with -screenshot don't work
2 participants