-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
kind/triageUnclassified issuesUnclassified issues
Description
Problem Description
dns_use_hosts_file has no effect with --mode reverse
Steps to reproduce the behavior:
$ echo 127.0.0.1 example.com >> /etc/hosts$ strace -fff -e trace=openat mitmweb -p 443 --no-web-open-browser --mode reverse:https://example.com --showhost --set dns_use_hosts_file=false --set dns_name_servers=8.8.8.8 2>&1|grep etc/hosts¹$ curl -k --resolve example.com:443:127.0.0.1 https://example.com
Actual result:
mitmwebopens/etc/hostsand an infinite loop occurs sincemitmwebresolvesexample.comto127.0.0.1based on/etc/hostswhich is not desired./etc/hostswas modified in order to alter an client's application resolution behavior which (unlike curl's example) can't be modified/poisoned otherwise.
Expected result:
mitmwebmust considerdns_name_serversto resolveexample.comand ignore/etc/hostsas requested and returnsexample.com's body
¹ sudo sysctl net.ipv4.ip_unprivileged_port_start=80
System Information
Mitmproxy: 11.0.0
Python: 3.12.3
OpenSSL: OpenSSL 3.2.2 4 Jun 2024
Platform: Linux-6.8.0-47-generic-x86_64-with-glibc2.39
References
See also #3139
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/triageUnclassified issuesUnclassified issues