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

Use a random user agent string with each http request. #447

Closed
ehsandeep opened this issue Aug 10, 2021 · 5 comments · Fixed by #449 or #446
Closed

Use a random user agent string with each http request. #447

ehsandeep opened this issue Aug 10, 2021 · 5 comments · Fixed by #449 or #446
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@ehsandeep
Copy link
Member

Sometimes you might receive http 429 error or other http errors because of the user agent string. The websites (not only archiveis) are blacklisting certain user agent strings and/or identical get/post requests that are being repeated in a short period of time. In that case, to solve this issue you have to change the user agent string in the agent.go file or preferably use a random user agent string with each http request.

Originally posted by @maldevel in #445 (comment)

@ehsandeep ehsandeep added Status: Available No one has claimed responsibility for resolving this issue Type: Enhancement Most issues will probably ask for additions or changes. labels Aug 10, 2021
@ehsandeep
Copy link
Member Author

We already have this support in nuclei and httpx project.

@taythebot
Copy link

I'm working on implementing this feature and was wondering if we should keep the default user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 or change it to subfinder - Open-source Project (github.com/projectdiscovery/subfinder) to match httpx?

@ehsandeep
Copy link
Member Author

@taythebot httpx has now randon-agent enabled as default, we can follow the same here as the primary reason for this support to avoid blocking from WAP with known agents.

@taythebot
Copy link

taythebot commented Aug 11, 2021

@taythebot httpx has now randon-agent enabled as default, we can follow the same here as the primary reason for this support to avoid blocking from WAP with known agents.

If random-agent is enabled by default, should there still be a flag for it like httpx does? To my understanding having a boolean flag whose default value is true and passing the flag itself doesn't do anything.

I see that httpx has an unsafe flag which when passed uses the default user agent. Should we follow the same behavior?

@taythebot
Copy link

taythebot commented Aug 11, 2021

I've gone ahead and added the unsafe flag which uses the default user agent. If the random-agent or another flag is required please let me know!

Edit: unsafe flag is removed

@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Available No one has claimed responsibility for resolving this issue labels Aug 12, 2021
@ehsandeep ehsandeep removed a link to a pull request Aug 12, 2021
@ehsandeep ehsandeep linked a pull request Sep 25, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
2 participants