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

httpx unable to screenshot webservers on port 7 #1342

Closed
seeyarh opened this issue Sep 1, 2023 · 2 comments · Fixed by #1343
Closed

httpx unable to screenshot webservers on port 7 #1342

seeyarh opened this issue Sep 1, 2023 · 2 comments · Fixed by #1343
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@seeyarh
Copy link
Contributor

seeyarh commented Sep 1, 2023

httpx version:

main

Current Behavior:

When trying to screenshot a webserver running on port 7, the following error is shown

[WRN] Could not take screenshot 'https://x.x.x.x:7': navigation failed: net::ERR_UNSAFE_PORT

Expected Behavior:

An option is added to allow screenshotting on ports that chromium considers "unsafe."

Steps To Reproduce:

Find a host running http on port 7 using censys https://search.censys.io/search?resource=hosts&sort=RELEVANCE&per_page=25&virtual_hosts=EXCLUDE&q=services%3A%28port+%3D+7+and+service_name+%3D+%22HTTP%22%29 and attempt to scan it.

httpx -screenshot -u http://165.73.242.30:7 -verbose

Anything else:

Here is a link to the chrome source that lists unsafe ports https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc

@seeyarh seeyarh added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 1, 2023
@seeyarh
Copy link
Contributor Author

seeyarh commented Sep 1, 2023

Setting the following option when creating the launcher in runner/headless.go seems to fix the issue:

		Set("explicitly-allowed-ports", "1,7,9,11,13,15,17,19,20,21,22,23,25,37,42,43,53,69,77,79,87,95,101,102,103,104,109,110,111,113,115,117,119,123,135,137,139,143,161,179,389,427,465,512,513,514,515,526,530,531,532,540,548,554,556,563,587,601,636,993,995,1719,1720,1723,2049,3659,4045,5060,5061,6000,6566,6665,6666,6667,6668,6669,6697,10080").

@Mzack9999
Copy link
Member

Closing as completed as corresponding PR adding the option was merged

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 a pull request may close this issue.

2 participants